I want to build a strategy based on indicator values of a multiple time series.
1.) I added 3 different time series of the same instrument on a chart and added for each of them the same indicator, but each with different periods to consider.
This seems to work fine, but trying to reflect this in a strategy, I am somehow stuck, as I cannot make the plot to work correctly (the indicators are shown, but with different, unexpected values).
2.) For the Strategy, I added 3 Data series for the same instrument (Tick) in the Configure state.
In the Data Loaded state, I assigned the indicator variables to the corresponding (different) Bar Series. When trying to plot the indicator (different periods) for each of the different Bar series, only one is plotted correctly (Bar series 0). The other Indicators based on the other Bar Series differ from the values shown from the chart + added indicators above, as per 1.). - > compare attached image.
Is this an expected behavior or am I missing something?
Below the relevant code I used:
else if (State == State.Configure)
{
AddDataSeries("FDAX 03-24", Data.BarsPeriodType.Tick, 100, Data.MarketDataType.Last);
AddDataSeries("FDAX 03-24", Data.BarsPeriodType.Tick, 200, Data.MarketDataType.Last);
AddDataSeries("FDAX 03-24", Data.BarsPeriodType.Tick, 400, Data.MarketDataType.Last);
}
else if (State == State.DataLoaded)
{
CCI1 = CCI(Closes[1], 44);
CCI2 = CCI(Closes[2], 22);
CCI3 = CCI(Closes[3], 11);
CCI1.Plots[0].Brush = Brushes.Lime;
AddChartIndicator(CCI1);
CCI2.Plots[0].Brush = Brushes.Blue;
AddChartIndicator(CCI2);
CCI3.Plots[0].Brush = Brushes.Red;
AddChartIndicator(CCI3);
//Panel
CCI1.Panel = 3;
CCI2.Panel = 3;
CCI3.Panel = 3;
Comment