i tried to rebuild the "plot color" definition from the turorial -
{
// Add two plots
Add(new Plot(Color.Blue, PlotStyle.Line, "Upper"));
Add(new Plot(Color.Orange, PlotStyle.Line, "Lower"));
}
protected override void OnBarUpdate()
{
// Sets values to our two plots
Upper.Set(SMA(High, 20)[0]);
Lower.Set(SMA(Low, 20)[0]);
// Color the Upper plot based on plot value conditions
if (Rising(Upper))
PlotColors[0][0] = Color.Blue;
else if (Falling(Upper))
PlotColors[0][0] = Color.Red;
else
PlotColors[0][0] = Color.Yellow;
// Color the Lower plot based on plot value conditions
if (Rising(Lower))
PlotColors[1][0] = Color.Blue;
else if (Falling(Lower))
PlotColors[1][0] = Color.Red;
else
PlotColors[1][0] = Color.Yellow;
}
what am i doing wrong?
i guess it has something to do with the "set value" section?
on the other side:
the indicator: "EMA_Slope_Color" is working fine.
but as i want to implement it into my existing indicator, without rewriting everything:
how can i reference to the EMA i'd needed ?
- I have added a new plot into my indicator: (Add (new Plot (Color.Green, PlotStyle.Line, "EMA1"));
- than: set CurrentBar <3
- and than set: EMA1.Set (EMA_Slope_Color (14) [0]);
but i'm again receving the error message "name "EMA1" not existing"
thanks for your ideas !!
Comment