I developed a system on 1min bars, I want to put a condition on the 5min bars.
I did so:
protected override void Initialize()
{
Add(PeriodType.Minute, 5);
Add(EMA(20));
CalculateOnBarClose = true;
}
// Condition set 1
if (EMA(BarsArray[1], 2)[0] > EMA(BarsArray[1], 20)[0])
{
...
}
Then I run it on 1m data. Is it correct? I'm asking because, when I watch the 1m chart of the back test, I see plotted the two EMAs (but they're supposed to be calculated on 5m!).
Does BarsArray[1] automatically refers to the 5m data only, or I should use another BarsArray[2] for the 1m data (which I don't think makes sense anyway).
Thank you a lot

Comment