Does anybody know how to selectively plot indicators in a strategy?
I have a strategy program that my need the EMA(fast) and EMA(slow) in some instances and the EMA(Close,13) and VOLMA(20) in other instances, but I do not want to plot them all simultaneously.
Since the "if" condition cannot be used within the Initialize() method, what other resourse may I use?
For example:
protected override void Initialize()
{
Add(EMA(fast));
Add(EMA(slow));
Add(EMA(Close,13));
Add(VOLMA(20));
Add(ATR(aTRperiods));
}
I would like to be able to do something like the following:
if condition 1
{
Add(EMA(fast));
Add(EMA(slow));
EMA(fast).Plots[0].Pen.Color = Color.Blue;
EMA(slow).Plots[0].Pen.Color = Color.Green;
}
else
{
Add(EMA(Close,20));
Add(VOLMA(20));
Add(ATR(aTRperiods));
EMA(Close,20).Plots[0].Pen.Color = Color.Gold;
EMA(Close,20).Plots[0].Pen.Width = 2;
}
Thank you.

Comment