Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    590 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    342 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    555 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X