I made simplest Multu-timeframe indicator. It must plot indicator from another timeframe.
It works on history, but on line it works not correct.
This is screenshot and text of indicator.
Please tell me: is this NT7 bug, or I did something wrong?
protected override void Initialize()
{
Add(new Plot( new Pen( Color.Blue, 1), PlotStyle.Line, "MA"));
Add(new Plot( new Pen( Color.Blue, 2), PlotStyle.Line, "Sma"));
Add(new Line(Color.FromKnownColor(KnownColor.Blue), 0, "LevelUp"));
Add(new Line(Color.FromKnownColor(KnownColor.Blue), 0, "LevelDn"));
//Add(new Line(Color.FromKnownColor(KnownColor.Blue), 0, "ZeroLine"));
Add(BarsPeriod.Id, Tf);
CalculateOnBarClose = false;
Overlay = false;
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 1 ) { d = iMyOsc(Level, PeriodMA, PeriodPrice, Type).MA[0]; return; }
Lines[0].Value = Level;
Lines[1].Value = -Level;
MA.Set(d);
Sma.Set(SMA(Values[0], 5)[0]);
if (Values[0][0] >= Level) BackColor = Color.LightGreen;
if (Values[0][0] <= -Level) BackColor = Color.Pink;
}
Comment