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 Brevo, Today, 01:45 AM
    0 responses
    6 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    241 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X