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 helpwanted, Today, 03:06 AM
    1 response
    10 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    9 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    5 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    242 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    387 views
    1 like
    Last Post Gavini
    by Gavini
     
    Working...
    X