Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate() - never seems to be called?

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

    OnBarUpdate() - never seems to be called?

    In my strategy the OnBarUpdate method seems to never be called (I have some lines of code in there to print text to the output window so I can see what's happening). The indicators appear on the chart but nothing else seems to happen.

    How can I debug this? I don't understand why it's never being called and I don't know how to start stepping through the code to see why it's never been called? It compiles correctly.

    Can anyone help?

    Thanks

    #2
    a) are you talking about a custom indicator or a custom strategy?
    b) how does "The indicators appear on the chart" relate?
    c) are there any funny messages in the logs?

    Comment


      #3
      This is a custom strategy.
      I add some indicators to the chart in the initialize method, so I can see that part is working ... it just never seems to get into OnBarUpdate after that.
      I'm sure I checked the log screen and didn't see any strange messages. However .. have just looked in the files contained in C:\EMC\NinjaTrader 6.5\log and see the following 09/03/2008 17:35:22|3|128|Failed to call method 'Initialize' for strategy 'TestStrategy': 'Bars' property can not be accessed from within 'Initialize' method.

      But I did see the indicators on the chart ... and they're in the initialize method.

      Sorry, this is my first foray into NT - Apologies if I have made a schoolboy error somewhere?

      Comment


        #4
        You can not access the "Bars" property in the Initialize method of your strategy.

        Comment


          #5
          As far as I'm aware I'm not trying to access the Bars property in my initialize method.
          The only thing that I see is Add(PeriodType.Minute, 60); //BarsArray[1]
          but BarsArray is commented out?

          I can't test this at the moment but when I can is there anyway I can find out what line of code is causing this problem?

          thanks

          Comment


            #6
            This is a good starting point for debugging: http://www.ninjatrader-support.com/v...ead.php?t=3418

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bmartz, 03-12-2024, 06:12 AM
            4 responses
            31 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by Aviram Y, Today, 05:29 AM
            4 responses
            12 views
            0 likes
            Last Post Aviram Y  
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            28 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X