There seems to be a bug with multi time frame strategies in beta 21.
On a 6 range chart, I want to access EMAs on an 18 range data series and then just change the back colour when the 6 range bar spans the EMA on the 18 range dataseries.
This is the code:
protected override void Initialize()
{
CalculateOnBarClose = false;
Enabled = true;
Add(PeriodType.Range, 18);
}
protected override void OnBarUpdate()
{
BackColor = Color.Transparent;
int mtf = 1;
int mtfAverage = 20;
double mtfEMA = EMA(BarsArray[mtf], mtfAverage )[0];
DrawDot("Ema" + CurrentBar.ToString(), true, 0, mtfEMA, Color.DarkMagenta);
if ( High[0] > mtfEMA
&& Low[0] < mtfEMA
&& Close[0] == High[0] )
{
BackColor = Color.Bisque;
}
}
That is all the strategy does at the moment - there is no other code to cause the bars to be highlighted incorrectly.
Thanks
Chris

Comment