Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose / OnBarUpdate Strategy Event fires and current values

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

    CalculateOnBarClose / OnBarUpdate Strategy Event fires and current values

    I had some general questions about the CalculateOnBarClose.

    If the CalculateOnBarClose is set to true, when does the OnBarUpdate fire, the last tick of the bar or the first tick of the next bar? Are there other items that trigger the OnBarUpdate.

    If CalculateOnBarClose is set to true, I am also using OnMarketData. When I try to retreive a value from an indicator, for example, EMA(High,3).Value[0], I don't get the current bar that is building value, I get the last bar that was completed. Is there a way to get the current value of the bar that is being built? Is there a was to call an event to get the value?

    I forgot to mention that my indicators are dynamically generated, so they change in real time on the chart.
    Last edited by TradingDreamer; 06-29-2010, 02:19 PM.

    #2
    TradingDreamer, if CalculateOnBarClose is set to true, OnBarUpdate() fires on the first tick of the next bar. There are no other items that trigger it.

    To get indicators to update in real time, it is necessary to set CalculateOnBarClose to false.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks, that is what I figured.

      Comment


        #4
        TradingDreamer, that last reply was cut short by a quick employee meeting, sorry about that. There is a method that might be able to update your indicator in real-time even with CalculateOnBarClose = true. The method is called Update() and is generally used to update indicators nested inside other indicators or strategies. I've never seen it used to update an indicator while COBC = true though, so it might not work. I just figured I'd let you know about this method in case you wanted to try it.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        89 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X