Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Catch the end of a minute bar on a tick by tick OnBarUpdate event

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

    Catch the end of a minute bar on a tick by tick OnBarUpdate event

    I was wondering if there is a way to catch the end of a minute bar when updating a strategy on a tick per tick basis?

    I explain:

    protectedoverridevoid Initialize()
    {
    ....
    Add(PeriodType.Minute,1);
    CalculateOnBarClose = false;

    }

    On the OnBarUpdate function, let say I want to compute and indicator only at the end of the minute bar serie, if I use I(BarsArray[1],some paremeters)[1] I will have the value of that indicator at the end of last bar.

    The value of the indicator for the current bar computed by I(BarsArray[1],some paremeters)[0] being updated at every tick.

    However the problem with this method is that I need to wait the first tick of the new bar to have the value of the previous finished 1 minute bar.

    Is there any other ways in Ninja to avoid my 1 tick delay and know that the current bar is finished, some form of EndOfBar finished event? That event could be triggered by some timer event.

    Thanks for the support.
    Fabrice.

    #2
    Please see here: http://www.ninjatrader-support.com/v...ead.php?t=2571

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Aviram Y, Today, 05:29 AM
    0 responses
    5 views
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    36 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    6 views
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    219 views
    1 like
    Last Post PaulMohn  
    Working...
    X