Madrid, Spain
Experience: Beginner
Platform: NinjaTrader + Dendric
Broker: IB/Kinetick
Trading: Futures
Posts: 17 since May 2014
Thanks Given: 5
Thanks Received: 9
|
Hello @RMorgan,
Anyway I’ll waste a little time. You add the indicators in the Initialize() method:
protected override void Initialize()
{
Add(ATR(ATRPeriod));
Add(EMA(EMAPeriod));
Add(Bollinger(numStdDev, BPeriod));
…
} In order to set colours, you reference indicators by “this.Indicators” collection in the same order you added them. If the indicator has several lines, you reference them by “this.Indicators[N].Plots” collection. Have a look:
this.Indicators[0].Plots[0].Pen.Color = Color.FromArgb(R, G, B); // ATR
this.Indicators[1].Plots[0].Pen.Color = Color.FromArgb(R, G, B); // EMA
this.Indicators[2].Plots[0].Pen.Color = Color.FromArgb(R, G, B); // Bollinger 1
this.Indicators[2].Plots[1].Pen.Color = Color.FromArgb(R, G, B); // Bollinger 2
this.Indicators[2].Plots[2].Pen.Color = Color.FromArgb(R, G, B); // Bollinger 3 I’m not sure but I think “this.Indicators[2].Plots[0]” corresponds to middle Bollinger band, “this.Indicators[2].Plots[1]” to upper band and ““this.Indicators[2].Plots[2]” to lower band.
|