protected override void Initialize()
{
Add(EMA(11)); // plots the moving average continuously
//
// adds a StrategyPlot indicator to paint the 'stop loss' with.
Add(StrategyPlot(0));
StrategyPlot(0).Plots[0].Pen.Color = Color.Black;
StrategyPlot(0).Plots[0].PlotStyle = PlotStyle.Square;
StrategyPlot(0).PanelUI = 1;
StrategyPlot(0).Name = "StopLoss";
} // so that is all fine
// but I only want to have plotting completed on certain conditions as:
protected override void OnBarUpdate()
{ // this condition
if (EMA(11)[0] > (EMA(5)[0] // does not
{ // plot something somehow} //have a way of plotting
// and this condition
while (EMA(11)[0] > (EMA(5)[0] // also does not
{ // plot something somehow} //have a way of plotting
}
// so what can I use in OnBarUpdate to plot on certain conditions
TIA,
Jon

Comment