![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2009
Posts: 47
Thanks: 0
Thanked 0 times in 0 posts
|
I am puzzled why the code below in the indicator won't show on the chart when I use a DataSeries variable called AD to set a value, but if I set my new indicator (AdMA) to a hard coded value, it shows on the chart. I also know that AD has values, because it shows on the chart (Values[0]). My new one is Values[1]).
protected override void Initialize() { Add(new Plot(Color.Green, PlotStyle.Line, "AD")); Add(new Plot(Color.YellowGreen, PlotStyle.Line, "AdMa")); //dsAD = new DataSeries(this); } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { double dBuff = 0; int i=0; AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0)); for (i = 0; i < period; i++) { dBuff = dBuff + AD[i]; // ISSUE!!!! } AdMa.Set(0, dBuff); } public DataSeries AD { get { return Values[0]; } } public DataSeries AdMa { get { return Values[1]; } } |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
Do you see any errors in the log? Most likely run into this issue here -
http://www.ninjatrader-support2.com/...ead.php?t=3170
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Member
Join Date: Aug 2009
Posts: 47
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you. That was the issue!
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vista 64bit - Indicator issue | thanga | Installation and Licensing | 6 | 09-11-2009 08:38 AM |
| Connection Issue | Garro | Installation and Licensing | 0 | 06-15-2009 08:26 PM |
| NT support: please tell me if this is a simulator issue or a live trading issue! | JS999 | SuperDOM and other Order Entry Windows | 14 | 04-28-2009 09:28 AM |
| Issue with indicator display on charts | kashman | Charting | 0 | 04-11-2009 11:47 PM |
| Arbitrage issue... | frostengine | Miscellaneous Support | 4 | 01-12-2009 02:58 PM |