Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    595 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    554 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X