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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X