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 sidlercom80, 10-28-2023, 08:49 AM
            172 responses
            2,277 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            17 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post adeelshahzad  
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            3 views
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Working...
            X