So in NT7 I used to have a lot of multi-series indicators which worked on both day and minute charts. To do this without hardcoding them as either day or minute indicators, I would use the following so that the indicator would automatically derive the secondary series from the primary series of the chart/strategy:
Add("XYZ", BarsPeriods[0].Id, BarsPeriods[0].Value);
AddDataSeries("XYZ", BarsPeriods[0].BarsPeriodType, BarsPeriods[0].Value);
Print (CurrentBars[0] + " / " + CurrentBars[1] + " : " + CurrentBars[2]);
1 / 777 : 689
2 / 1166 : 1034
3 / 1555 : 1379
4 / 1932 : 1724
When I change the code in the indicator to the following, I get the following as expected:
AddDataSeries("XYZ", BarsPeriodType.Day, 1);
2 / 2 : 2
3 / 3 : 3
4 / 4 : 4
5 / 5 : 5
6 / 6 : 6
Comment