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

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 Christopher_R, Today, 12:29 AM
        0 responses
        9 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,235 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        3 views
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        8 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,415 views
        0 likes
        Last Post Traderontheroad  
        Working...
        X