Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Multi instrument, multi timeframe question...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multi instrument, multi timeframe question...

    In my strategy I want to compare against an index and where the price is at since open. To do this I do the following:

    Code:
    else if (State == State.Configure)
    			{
    				// add dow daily for comparison to index 1
    				AddDataSeries("^DJIA", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "US Equities RTH", false);
    				
    				// add dow tick for comparison to index 2
    				AddDataSeries("^DJIA", new BarsPeriod { BarsPeriodType = BarsPeriodType.Tick, Value = 1 }, "Default 24 x 7", false);
    
    			}
    Basically I'm loading daily data at index 1 and tick data at index 2. Thus on my main instruments update interval I am attempting to do something like the following:

    Code:
    double sinceOpen = Closes[2][0] - Opens[1][0];
    However on a historical test it seems the Daily bar is not loaded until the day has passed and thus my tick data never has anything to compare against which makes sense since Ninja does not handle intrabar data in a backtest. Any other recommendations besides looking for the first tick of the day to determine opening price to compare against?

    #2
    Hello fxRichard,

    Thank you for your post.

    You could use Tick Replay in the historical backtest allowing you to hard code the option Calculate to OnPriceChange and thus being able to see the intra-bar movement.

    For information on Tick Replay please visit the following link: https://ninjatrader.com/support/help...ick_replay.htm

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by samish18, Yesterday, 08:57 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by yertle, Today, 08:38 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by love2code2trade, Yesterday, 01:45 PM
    3 responses
    22 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by trilliantrader, Today, 08:16 AM
    2 responses
    6 views
    0 likes
    Last Post trilliantrader  
    Started by samish18, Today, 08:31 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X