![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Miscellaneous Support Miscellaneous support issues. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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?
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
You can not access the "Bars" property in the Initialize method of your strategy.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#6 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
This is a good starting point for debugging: http://www.ninjatrader-support.com/v...ead.php?t=3418
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is a function calculated each time when it is called? | FireFly | General Programming | 3 | 12-26-2007 01:09 PM |
| What is the method called for closing positions? | tomiboi | Strategy Development | 1 | 12-14-2007 03:43 AM |
| OnBarUpdate from different datafeeds | sergioloff | Strategy Development | 2 | 10-29-2007 02:34 PM |
| Stateful OnBarUpdate | kgillis23 | General Programming | 2 | 05-30-2007 11:01 AM |
| Is there a counterpart of Initialize, called when strategy is stopped? | californiaruby | Automated Trading | 2 | 02-20-2007 03:39 AM |