Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

market replay - days to load

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

    market replay - days to load

    How do I get my strategy to only run the timeframe I select with the play,pause when using market replay.
    Currently once I start the market replay it seems to run through the last 3 days or so through my entire strategy resulting in trades being entered, exit, cancelled, etc.
    I see that you can manually set days to load. Can it be done programatically and can it be 0?
    I already have:
    PHP Code:
    if (Historical)return; 
    
    Seems to have no affect when used with market replay?

    Thanks

    #2
    Hi trtrav,

    There's no programmatic control here, but you can set in the GUI the from and to date.

    if (Historical) return; works the same in market replay as live, but maybe not the way you expect. Market replay simulates a real time feed, so the tick by tick playback will flag bars with Historical = false. There can still be historical bars, but the script shouldn't calculate them if you have that return statement. To check what your strategy is doing on Historical/ RealTime bars add this statement

    Print(CurrentBar + " Historical: " + Historical);

    Since you are returning out when Historical, you should expect that this statement will always look like: # Historical: false and will only receive output when there is playback.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X