![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
The following code stops plotting to the chart all the time when running on intraday data and updating every tick. If I format the indicators it will update but it will stop again after awhile. When it stops updating the plot to the chart, I believe it also does not alert but it does continually update the number at the right of the screen.
{ if (CurrentBar < 4) return; if (Bars.PercentComplete>0) { Plot0.Set(Volume[0] /Bars.PercentComplete); } if (Volume[0] /Bars.PercentComplete > 1.2 *Volume[1]) { if (alarmOn ==1) { Alert("myAlert", NinjaTrader.Cbi.Priority.High, "PRV", "Alert1.wav", 90, Color.Black, Color.Yellow); } } } |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
If an indicator stop working you will see an error message in the log of the Control Center window with some idea of the error being generated. If the indicator stops plotting, you will have to do some further debugging to see why the Plot0.Set() method is not being called...or what value is actually being set.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
I already solved this one a couple of weeks ago. I'd bet you're still getting a divide by zero.
See: http://www.ninjatrader-support.com/v...ead.php?t=3761 |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
Shoot, I protected it against divide by zero in the first part of the code but not in the alert part... thanks...
Last edited by maxpi; 11-09-2007 at 10:31 AM.
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
Even after getting all the divide by zero problems out of the code it still stopped plotting exactly the same. I had to move the plot0 statement so it was not dependent on the Bars.PercentComplete>0 condition, now it seems to run all the time like it should.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bid/Ask spread indicator updating even if no trades take place | RedDuke | General Programming | 10 | 05-12-2008 03:29 PM |
| chart stops updating | deanldavis475 | Charting | 32 | 10-01-2007 05:42 PM |
| Problem with updating indicator at new day | max1ci6 | Indicator Development | 8 | 08-17-2007 08:22 AM |
| when updating an indicator | Thomas | Indicator Development | 2 | 08-12-2007 03:02 PM |
| Updating V4 to V5 | underground | Automated Trading | 1 | 01-03-2006 02:56 AM |