NexusFi: Find Your Edge


Home Menu

 





Compare the difference of one indice to another


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one williammanda with 4 posts (0 thanks)
    2. looks_two MXASJ with 1 posts (3 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 3,328 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread

Compare the difference of one indice to another

  #1 (permalink)
 williammanda 
chattanooga, tn
 
Posts: 12 since May 2010

I'm in need of and indicator that compares the difference of one indice to another. I've looked over NT's site and this one but have come up empty handed. The details are as follows:

value = (NQ closing price RTH - NQ current last price) / (ES closing price RTH - ES current last price)

What this gives me is the overall bias of the market. Currently I do this in my head throughout the day but life would be much easier if it was just plotted.

So if someone could point me in the right direction whether that is an existing indicator or something that would need programming, it would be much appreciated. Currently I'm using NT 7 beta 16.

Moderator Notice
Moderator Notice


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
33 thanks
Just another trading journal: PA, Wyckoff & Trends
26 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
19 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Such an indicator is not directly available. The indicators that are close to what you are looking for are

- Pairs Ratio from NinjaTrader Tim's Pairs Suite
- Ratio Indicator from kdoren

Both indicators can be downloaded from the NinjaTrader forum.

To get what you are looking for, you would have to normalize the ratio to 1 at the moment of the close. You could do this by adding a user defined value to the indicator to be adjusted manually or by autocalculating the factor from the ratio of the close values. To get the close values you would need to define the approriate session and let the indicator collect the values at session break.


williammanda View Post
I'm in need of and indicator that compares the difference of one indice to another. I've looked over NT's site and this one but have come up empty handed. The details are as follows:

value = (NQ closing price RTH - NQ current last price) / (ES closing price RTH - ES current last price)

What this gives me is the overall bias of the market. Currently I do this in my head throughout the day but life would be much easier if it was just plotted.

So if someone could point me in the right direction whether that is an existing indicator or something that would need programming, it would be much appreciated. Currently I'm using NT 7 beta 16.


Reply With Quote
Thanked by:
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,444 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608

I believe MXASJ has written a couple of things that do this here on futures.io (formerly BMT).

I'll ask him to take a look at this post.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800



That indicator plots the ratio between two instruments of a given quantity. You could tweak the code in the RatioCalculator method to make it your own formula for spreads, differences, etc. Here is what that method looks like now:

 
Code
                            
private void RatioCalculator()
{
try
{
ratioRough = (Closes[0][0]*nominatorQuantity)/(Closes[1][0]*denominatorQuantity);
myRatio.Set(Math.Round(ratioRough2));
}
catch (
Exception e)
{
Print(
Time[0]+ " Indicator Ratio2Instrument on " Instrument.FullName" Error: Ratio Calculation Error "
e.ToString());
}

As Fat Tails points out something that would require some thought is how to add the two new dataseries of a different session template if you want to use this indicator outside of RTH. If both yesterdays close and Now are only used for RTH it is fairly simple to do.

Reply With Quote
Thanked by:
  #6 (permalink)
 williammanda 
chattanooga, tn
 
Posts: 12 since May 2010


MXASJ View Post


That indicator plots the ratio between two instruments of a given quantity. You could tweak the code in the RatioCalculator method to make it your own formula for spreads, differences, etc. Here is what that method looks like now:

 
Code
                            
private void RatioCalculator()
{
try
{
ratioRough = (Closes[0][0]*nominatorQuantity)/(Closes[1][0]*denominatorQuantity);
myRatio.Set(Math.Round(ratioRough2));
}
catch (
Exception e)
{
Print(
Time[0]+ " Indicator Ratio2Instrument on " Instrument.FullName" Error: Ratio Calculation Error "
e.ToString());
}

As Fat Tails points out something that would require some thought is how to add the two new dataseries of a different session template if you want to use this indicator outside of RTH. If both yesterdays close and Now are only used for RTH it is fairly simple to do.

Thanks for the reply!
I'm in a situation where I can program just enough to be dangerous, I no nothing about NT programming. With that said if I could get you to help me maybe or you could do it? On your recommendation having this only work during RTH would be acceptable. Please advise.

Reply With Quote
  #7 (permalink)
 williammanda 
chattanooga, tn
 
Posts: 12 since May 2010

OK I'm stumbling along.....I have found an indicator that I can hack. All I need to do is copy and rename the existing indicator so I can make some changes. But I'm not sure how to do that also keeping in mind that I want to continue to use the original indicator. Once I get past this point I can open the indicator in the NT editor and make the change and compile. Any help would be appreciated!
Thanks

Reply With Quote
  #8 (permalink)
 williammanda 
chattanooga, tn
 
Posts: 12 since May 2010

OK I found this link which helped me out...



So I was successful in hacking my 1st indicator!

Reply With Quote
  #9 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184


williammanda View Post
OK I found this link which helped me out...



So I was successful in hacking my 1st indicator!

William,

Did you post your version? I am thinking use this on range bars, historical, intraday monitoring of the ForX pairs, but not in a strategy. What did your modification consist of?

Thanks,
TJ

Reply With Quote




Last Updated on September 17, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts