Custom timeseries for Indicators

How do you keep indicator timeseries constant (seconds or days) when the chart time interval changes? For example, if I change my timeseries to 1M, 10M or 1Hour, my indicator calculations should remain on days.

I have added an additional timeseries

AddDataSeries(Data.BarsPeriodType.Day, 1);

Thank you.

Depending on your indicator, it could possibly start to look funky. What you need to do is specifically use that data series you added and not the one on the chart. Kind of like this. See PRIMARY_SERIES and SECONDARY_SERIES. Although the primary series is technically what’s on the chart which is index 0. For this, I used the constant PRIMARY_SERIES for index 1 because I don’t care what the chart is using.

1 Like