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, 05-11-2026, 05:56 AM
        0 responses
        26 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        182 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        335 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        260 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X