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

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...
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by manueldecastro, Yesterday, 10:26 AM
    5 responses
    24 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by memonic, 05-01-2024, 01:23 PM
    5 responses
    30 views
    0 likes
    Last Post memonic
    by memonic
     
    Started by dcriador, Yesterday, 10:45 AM
    2 responses
    18 views
    0 likes
    Last Post dcriador  
    Started by SnailHorn, Yesterday, 10:49 PM
    1 response
    10 views
    0 likes
    Last Post SnailHorn  
    Started by TraderIqbal, 10-20-2023, 10:12 AM
    2 responses
    121 views
    0 likes
    Last Post Funnywo
    by Funnywo
     
    Working...
    X