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

OnBarUpdate not fired for last plotted bar

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

    OnBarUpdate not fired for last plotted bar

    I am not sure why this happens! Especially if i am loading chart daily data after market close and not interested in after hours data. Is this by design or do i need to change some setting?

    Although it wont work on individual daily chart, i ran the indicator in Market Analyzer and it seems to work there. Not sure how this really works....

    Any help is appreciated. Thanks in advance for your help and support.
    Last edited by isitpossible; 07-31-2009, 05:00 PM.

    #2
    isitpossible, the OnBarUpdate() for your daily chart would be called if the bar closes (if CalculateOnBarClose set to 'true'), thus if the opening tick of the next day is received.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      But if that is true then howcome this works in MA even when the CalculateOnBarClose = true in the indicator!!!

      Comment


        #4
        isitpossible, are you using the same session time in both the chart and Market Analyzer? Per default indicators in the MA are set to CalculateOnBarClose = false, so you might want to doublecheck your setting.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          The value of CalculateOnBarCloase is set to true in the indicator. Now when i apply this on the daily chart I will not get a plot for the last bar since it is considered not closed till the next day. But if i apply this indicator to MA to scan stocks for certain conditions then it seems to work for the current day). I want this to work for current day on daily chart as well and wondering I do I do this?

          Where do i set this session time?
          Last edited by isitpossible; 08-01-2009, 08:52 AM.

          Comment


            #6
            Yes, you would still see a value displayed, but this the value from the last OnBarUpdate call, not including the 'not yet closed' current daily bar. When you set the indicator to false, it will display the value of the last onbarbar update call of the day (the last received tick).
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thats how I understood this but when I set the variable to false in the indicator and run it on a daily chart (not on minutes but day), it will not display the plot for the last bar. If I understand this correct then for daily chart the last tick is considered as the opening tick for the next day and hence the last bar is not closed until next day morning, is this right assumption?

              Is there a way by which I can set the time so that the software knows that the official market day is closed and that could be trigger to calculateonbarcloase!!!

              Comment


                #8
                Your assumption is correct, since NinjaTrader 6.5 is event driven, not time driven. NinjaTrader 7 will offer more features in this regard. I would suggest you recheck your indicator on Monday when the market is open with CalculateOnBarClose set to false.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by trilliantrader, Today, 03:01 PM
                0 responses
                2 views
                0 likes
                Last Post trilliantrader  
                Started by pechtri, 06-22-2023, 02:31 AM
                9 responses
                122 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by frankthearm, 04-18-2024, 09:08 AM
                16 responses
                67 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by habeebft, Today, 01:18 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by benmarkal, Today, 12:52 PM
                2 responses
                19 views
                0 likes
                Last Post benmarkal  
                Working...
                X