Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Outside of OnBarUpdate?

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

    Outside of OnBarUpdate?

    I want to do the following:

    Compare the low of a daily bar series to the low of a weekly bar series (Add(PeriodType.Week, 1)) and if they are ==, retrieve the day of the week of the Low of the daily bar series.

    Doing this within the OnBarUpdate method is complicated since I cannot access the Low of the week until the week is over (i want to complete this as a study, rather than a trading strategy, so I don't care if i am accessing information from 'the future')

    I guess completing this would mean accessing arrays of price data inside a custom method? Is this possible?

    As always, help is much appreciated.

    #2
    Space123, unfortunately it's not supported to access future data points - for backtesting you're correct, you would need to simulate the weekly frame then with the daily granularity to be able to compare those two on the same OnBarUpdate() call. For realtime use, you would let the strategy run on CalculateOnBarClose = false to get updates on each tick to those values...

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    152 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    87 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    131 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    127 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    106 views
    0 likes
    Last Post CarlTrading  
    Working...
    X