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-DataSeries Indicator works differently in Market Replay

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

    Multi-DataSeries Indicator works differently in Market Replay

    Hi, I built an indicator that I add to a 400 tick chart. In its Initialize() event, the indicator creates two additional dataseries (via the Add(instrument, PeriodType, count) method), based on the same instrument as the 400 tick chart, but for different time frames: a dataseries for one second, and another for five minutes.

    During OnBarUpdate(), the code checks BarsInProgress and branches to the appropriate code for each dataseries. The code for the 400 tick dataseries also tests Count and CurrentBar, to determine when historical data has finished loading.

    What I've noticed is, BEFORE historical data has finished loading -

    - when running in real time, OnBarUpdate() events arrive for all three dataseries, in the proper order, as you would expect.

    - when running under Market Replay, only OnBarUpdate() events for the original 400 tick dataseries - the series on the chart - arrrive. No events arrive for the one second or five minute dataseries.

    After historical data has finished loading, Market Replay behaves like real time - with OnBarUpdate events arriving for all three data series.

    Is it supposed to work this way? Is there a way my code can programmatically tell that it's running under Market Replay, so I can get (force) the indicator to behave the same way under both conditions?

    thanks

    #2
    SatChitAnanda, sorry for our late reply here.

    There would be unfortunately no supported code way to check for being in replay, however as a hint you can look into this snippet from our BarTimer indicator -

    Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay

    The behavior you've seen in replay for the MultiSeries is unfortunately expected in this loading scenario.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sidlercom80, 10-28-2023, 08:49 AM
    167 responses
    2,260 views
    0 likes
    Last Post jeronymite  
    Started by warreng86, 11-10-2020, 02:04 PM
    7 responses
    1,361 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Perr0Grande, Today, 08:16 PM
    0 responses
    5 views
    0 likes
    Last Post Perr0Grande  
    Started by elderan, Today, 08:03 PM
    0 responses
    9 views
    0 likes
    Last Post elderan
    by elderan
     
    Started by algospoke, Today, 06:40 PM
    0 responses
    10 views
    0 likes
    Last Post algospoke  
    Working...
    X