I am trying to develop a strategy with two timeframes. I use 30min bars and the code is finished. It works.
However, I want to add a filter that check whether the EMA of the DAILY bars.
For backtest, I imported the CAC40 05-08.txt in 30 min bars and I imported the CAC40 ##-##.txt with daily bars, So i write in the inialize method:
Add("CAC40 ##-##",PeriodType.Day,1);
Add(EMA(BarsArray[1], MediaLarga));
And then, in the OnBarUpdate method:
if (Close[0] > EMA(BarsArray[1], MediaLarga)[0]));
The strategy compiles ok but it is not taking into account the EMA of the daily bars
What I am missing here?
Thanks!!!
Comment