I have a multiple time frame issue: I could not add Daily data series to minute data series.
In my case, the primary chart is 1 minute. I have no problem in adding another minute data series of different period, no problem in adding second and tick data series. But When i add day series and above, the program will not work. The compiling will be successful, though, without any error message.
I have simplified the issue in the following code. No variable is declared so this one can be tested by copy and paste.
Any comments/suggestions are welcome.
protectedoverridevoid Initialize()
{
//Add(PeriodType.Minute, 60);
//Add(PeriodType.Second, 30);
//Add(PeriodType.Tick, 30);
Add(PeriodType.Day, 2); // BarsInProgress == 1. BarsArray[1]
CalculateOnBarClose = false;
}
protectedoverridevoid OnBarUpdate()
{
if (Close[1]>Close[2])
{
Print("Data series 0 value is" + ATR(1)[0].ToString());
Print("Data series 1 value is" + ATR(BarsArray[1],1)[0].ToString());
}
}
Comment