PDA

View Full Version : do not plot value


velocity
05-30-2009, 09:03 PM
I created a value of +1 and -1 depending upon the color of a bar. The problem is that it screws up the scale because it plots the value of 1 or -1.

How do I not get the value to plot? here is some of my code to see where I am going wrong.

protectedoverridevoid Initialize()
{
Input = Median;
Add(new Plot(Color.Green, PlotStyle.Hash, "UpTrend"));
Add(new Plot(Color.Red, PlotStyle.Hash, "DownTrend"));
Add(new Plot(Color.Red, PlotStyle.Hash, "buysellTrend")); // +1 uptrend / -1 downtrend
CalculateOnBarClose = true;
.....
.....
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries buysellTrend
{
get { return Values[2]; }
}

Thanks

NinjaTrader_Ray
05-31-2009, 05:56 AM
Somewhere in your code you are setting values to your plots, such as:

UpTrend.Set(value);

How about setting the indicator parameter "Auto scale" to false when adding the indicator to your chart?

ctrlbrk
05-31-2009, 06:35 AM
Velocity,

If your intention is to have a DataSeries that is accessible for a strategy or other indicator (Signal -1: short, Signal 1: long), then you can do it without a Plot. Just do:

#variables
private DataSeries signal;

#init
signal = new DataSeries(this);

#onbarupdate
Signal.Set(1); // long
Signal.Set(-1); // short

#parms
public DataSeries Signal
{
get { return signal; }
}

Alternatively, you can do as Ray suggests and set auto scale to false, it will solve the problem as well.

Mike

velocity
05-31-2009, 06:52 AM
thansk guys, that solved it.