Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Force call to OBU()

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

    Force call to OBU()

    I have a script which adds additional bars object to the chart.

    I want OBU() to fire for the primary bars object, after the last fire of OBU() for the added bars object. Is that possible?

    Something like that:

    if (BarsInProgress == 1 && CurrentBar == Count - 1)
    {
    done = true
    }

    if (done)
    {
    // fire OBU for Bars[0]
    }

    #2
    savekad,

    You could force something like this to happen for added data series only. Things like Closes[X][Y] would still be getting updated not in the order you want since it happens under the hood.

    Here is something you may be able to exploit a little :

    EMA(15).Update() //forces an onbarupdate call
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I have an indicator which calculates values for several time intervals.

      Do you think it will be better to divide it into several indicators that each one handles a singe time frame and by that be able to call each at a specific order?

      Comment


        #4
        savekad,

        These still get pegged to the bars under the hood according to the following :



        You could try forcing an OBU call by using something like :

        EMA(15).Update()

        But you wouldn't really be able to control forcing one OBU to occur before another in every instance. Note in the link I gave you above the bar updates behave differently if you use "CalculateOnBarClose = false". You might be able to exploit that to do what you want.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        55 views
        0 likes
        Last Post CarlTrading  
        Working...
        X