![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
|
I can get values but I can't plot this line. Code is below:-
Code:
protectedoverridevoid Initialize()
{
Add(new Plot(Color.Magenta, PlotStyle.Line, "PlotA"));
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
myDataSeries = new DataSeries(this);
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
if (CurrentBar < 3) return;
myDataSeries.Set(Math.Min(Low[1],Close[2]));
Print("true low is" + myDataSeries.ToString());
}
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
|
Kay, you never plot this series - does it give you any prints?
Try for example - PlotA.Set(Math.Min(Low[1],Close[2])); or Value.Set(Math.Min(Low[1],Close[2]));
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
|
Hi Bertrand,
I get an error message "The name 'PlotA' does not exist in the current context but when i use Value.Set it works! Why is that the case?
Last edited by kaywai; 06-01-2010 at 08:28 AM.
Reason: adding more information
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
|
Great, then please check how you named your public DataSeries to be associated with your Plot in the Properties section of the code and adjust my snippet then as needed.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
|
sorry betrand. what am i suppose to put in the properties section?
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
|
You would need to expand the properties section of your code and see how the public DataSeries associated with your Plot is named, as then reflect this properly in your snippet code. As an example check into our BollingerBands indicator and see how Upper, Lower and Middle work codewise.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
|
issue resolved. thx for the pointers bertrand!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trying to Plot Line in Strategy | yamdigger | Strategy Development | 2 | 05-27-2009 11:17 AM |
| Plot horizontal line | ssg10 | General Programming | 1 | 05-13-2009 05:54 AM |
| Line Plot | velocity | General Programming | 10 | 05-07-2009 05:59 AM |
| Missing line part | tagomi | Indicator Development | 2 | 09-03-2008 08:44 AM |
| Plot a line of the bar close | dryan_uk | General Programming | 1 | 06-09-2008 11:44 AM |