private BoolSeries adxTrending; // Define a BoolSeries variable
protectedoverridevoid Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Dot, "ADXRising"));
Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Dot, "ADXNotFalling"));
adxTrending=new BoolSeries(this);
CalculateOnBarClose = true;
Overlay = false;
PriceTypeSupported = false;
}
protectedoverridevoid OnBarUpdate()
{
if(ADX(14)[1]>25){
adxTrending.Set(true);
}
[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 BoolSeries ADXTrending
{
get { return adxTrending; }
}
Comment