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

Historic vs real time processing?

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

    Historic vs real time processing?




    "Your script has complex logic that changes the bar color on the chart. You are running tick by tick, as per the above "Figure 2" image, the 5th 1 minute bar is looking at OHLCV data from the second 3 minute bar. Your script changes the fifth 1 minute bar color to green. In the future, you reload your script into the chart and the fifth 1 minute bar is now a historical bar. As per Figure 1 above, the fifth 1 minute bar now references the OHLCV data of the first 3 minute bar (instead of the 2nd 3 minute bar as per Figure 2) and as a result, your script logic condition for coloring the bar green is no longer valid. The result is that now your chart looks different.​"
    So this page is telling us that historic vs realtime processing is different when using OnEachTick, but doesn't provide any solution to getting identical behavior... What is the recommended way to get a tick indicator to behave the same in real time vs historical? I don't recall seeing any specific handling of this in sample/reference code?

    Thanks
    Nick



    #2
    Hello NickyD,

    Thank you for your post.

    This quote is assuming Tick Replay is disabled. When Tick Replay is enabled (or the script is running in real-time) if state is historical, use bars ago 0 for most recently fully closed bar and in real-time use bars ago 1 for most recently fully closed bar.

    Enable Tick Replay on your indicator to playback 1 tick historical data to build the bars as if they had been build live. Please note that an indicator running Tick Replay needs to have been specifically designed to take advantage of Tick Replay.

    Please see this Help Guide page on Developing for Tick Replay, which includes a helpful graphic:



    If you have any further questions, please let us know.
    Gaby V.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    11 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,980 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Yesterday, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X