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

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. ​
    Gaby V.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by David Hill, 07-18-2024, 07:41 AM
    4 responses
    24 views
    0 likes
    Last Post David Hill  
    Started by aban1alpha, Today, 02:01 PM
    0 responses
    2 views
    0 likes
    Last Post aban1alpha  
    Started by jaybedreamin, Today, 01:08 PM
    0 responses
    2 views
    0 likes
    Last Post jaybedreamin  
    Started by Rheiverson, 07-18-2024, 04:28 PM
    2 responses
    19 views
    0 likes
    Last Post Rheiverson  
    Started by p1kn1t, Today, 11:32 AM
    0 responses
    12 views
    0 likes
    Last Post p1kn1t
    by p1kn1t
     
    Working...
    X