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

Understanding OnDataPoint() when working with bars.IsResetOnNewTradingDay to true

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

    Understanding OnDataPoint() when working with bars.IsResetOnNewTradingDay to true

    I am trying to store the volume information as it was executed in bid or ask price. As OnDataPoint() processes the historical data on a tick basis (BarsPeriodType.Tick), I am processing and storing the bid and ask volume in a custom array that holds the bid and ask value per price level, per bar. Everything is working correctly as long as bars.IsResetOnNewTradingDay = false (Break at EOD setting in the Data Series config window).

    When bars.IsResetOnNewTradingDay = true, the bars.Count begins at the value of the bar before the last EOD Break. I am assuming that some type of caching is occurring here. Do to this internal caching, only the historical data since the last EOD Break gets processed through OnDataPoint(). This leaves me without any information for all the bars before the EOD Break. I know that previous OHLCV data is keep in the bars object as I can query it using the Get methods and proving an index such as 0 or any other value less than the bars.Count.

    Is the only way to overcome this limitation is to enable Tick Replay which forces OnDataPoint() to process all bars, regardless of the bars.IsResetOnNewTradingDay setting?

    #2
    Hello GARZONJ,

    Thank you for your post.

    It's important to remember that yes, bars are cached. When building/debugging bars types, it is important to purposefully clear the cache between your tests.

    To delete the cache, follow the steps below.
    • Shut down NinjaTrader.
    • Open the Documents > NinjaTrader 8 > db folder.
    • Delete the sub-folder named 'cache'.
    • Restart NinjaTrader and test.
    Do you see anything specific still in question when purposefully clearing the cache between tests?

    Please let us know if we may be of further assistance.

    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cutzpr, Today, 08:54 AM
    0 responses
    6 views
    0 likes
    Last Post cutzpr
    by cutzpr
     
    Started by benmarkal, Today, 08:44 AM
    0 responses
    11 views
    0 likes
    Last Post benmarkal  
    Started by Tin34, Today, 03:30 AM
    2 responses
    26 views
    0 likes
    Last Post Tin34
    by Tin34
     
    Started by sastrades, Yesterday, 09:59 AM
    2 responses
    41 views
    0 likes
    Last Post brucerobinson  
    Started by ETFVoyageur, Today, 12:52 AM
    1 response
    24 views
    0 likes
    Last Post Leeroy_Jenkins  
    Working...
    X