Im trying to develop a MTF indicator that plots data from higher timeframes.
I wanted to start simple to test MTF functionality but Im lost.
I already searched and read here and bigmike forums but cannot find the path.
I have the following code, but I cannot see any line ploted:
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.AppWorkspace), PlotStyle.Line, "M15"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "H1"));
Add(new Plot(Color.FromKnownColor(KnownColor.Yellow), PlotStyle.Line, "H4"));
Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "D1"));
Add(PeriodType.Minute, 60);
Add(PeriodType.Minute, 240);
Add(PeriodType.Day, 1);
Overlay = true;
}
protected override void OnBarUpdate()
{
M15.Set(SMA(BarsArray[0],20)[0]);
H1.Set(SMA(BarsArray[1],20)[0]);
H4.Set(SMA(BarsArray[2],20)[0]);
D1.Set(SMA(BarsArray[3],20)[0]);
}

Comment