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 chbruno, Today, 04:10 PM
                0 responses
                3 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                436 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                6 views
                0 likes
                Last Post FAQtrader  
                Started by rocketman7, Today, 09:41 AM
                5 responses
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by frslvr, 04-11-2024, 07:26 AM
                9 responses
                127 views
                1 like
                Last Post caryc123  
                Working...
                X