Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Calculate.OnEachTick ( Playback vs. Real Time )

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

    Using Calculate.OnEachTick ( Playback vs. Real Time )

    I came across a comment in one of my files about the real first tick during Playback being right after State == State.Historical goes false and before IsFirstTickOfBar is Set. The comment made
    it sound like they were separated by one OnBarUpdate(). This information may be dated. But here is the relevant point for my code going forward.
    I don't want to use Tick Replay, During the Tick by Tick portion it is not necessary to Playback exactly. What is super important is for the Playback and Realtime to give me the exact same Closing prices. So the portion of my code that processes on IsFirstTickofBar must give me the same closes in Playback as in RealTime and must match the bars on the chart.

    Do I have to do something special here to get that. if so please elaborate.

    Thanks
    Jerry

    #2
    Hello JerryWar,

    Thank you for your post.

    If you are using Playback with Market Replay, Tick Replay wouldn't be necessary since Market Replay data is playing back the data as it would have occurred in real-time. Tick Replay would be necessary if you were using back-testing using historical data.

    From the Help Guide:

    "When using market replay, the NinjaTrader core market data updates occur at the granularity provided by the market data provider. However, the NinjaTrader user interface only visually updates in 1-second intervals for performance optimizations. Even though the NinjaTrader UI's are only visually updating at 1-second intervals, orders, indicators, and strategies will calculate just as they were running in real-time."

    https://ninjatrader.com/support/helpGuides/nt8/index.html?playback.htm#UnderstandingHowThePlaybac kWorks

    If you are using historical data, TickReplay must be enabled for Calculate to work with .OnPriceChange or .OnEachTick. With TickReplay disabled, IsFirstTickOfBar will always be true in historical data.

    Please let us know if you have any further questions. ​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    113 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    60 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    40 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    43 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    81 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X