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

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 benmarkal, Today, 12:52 PM
        0 responses
        1 view
        0 likes
        Last Post benmarkal  
        Started by stafe, 04-15-2024, 08:34 PM
        11 responses
        58 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by pechtri, 06-22-2023, 02:31 AM
        5 responses
        116 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Tim-c, Today, 03:54 AM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by FAQtrader, Today, 12:00 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X