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

FirstTickofBar with Historic data?

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

    FirstTickofBar with Historic data?

    I see that FirstTickofBar is accurate to real time, but always returns True on historic data. Is there anyway around this? If not, how to do people accommodate? Wouldn't this mean that you then need to test your code to live data, which is pretty limiting. Thanks

    #2
    Hello timmbbo,

    Thanks for your post.

    Historical data consists only of the Open, High, Low, Close and Volume data per bar. The historical data does not contain all of the ticks that created the bar, only the finished bar. When processing historical data the OnBarUpdate() method is called once per bar (regardless of the CalculateOnBarClose setting). FirstTickOfBar will also be true as you have observed because it is true once per bar.

    If your code is based on tick processing one option is to test using Market Replay where the data is the same as live, IE: tick by tick processing occurs.

    Another option is to recode your strategy by adding a 1 tick data series to your strategy, however this introduces other multi time frame considerations that you would have to evaluate by reviewing the helpguide here: http://ninjatrader.com/support/helpG...nstruments.htm

    You may also want to review: http://ninjatrader.com/support/forum...ead.php?t=6652
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Aviram Y, Today, 05:29 AM
    0 responses
    3 views
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    36 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    6 views
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    218 views
    1 like
    Last Post PaulMohn  
    Working...
    X