I have a problem in a strategy, please can you help me to fix it?
Is a MultiTimeFrame and MultiIndicator Strategy, for TF1 I use Chart Back Color and for TF2 Candle Color.
Here the position of the related code...
1.
(State == State.SetDefaults)
{
...
TF1Type = BarsPeriodType.Volume;
TF1Period = 50000;
TF1Indi = tf1Indi.Macd_Ema;
}
2.
(State == State.Configure)
{
AddDataSeries(TF1Type, TF1Period);
}
3.
(State == State.DataLoaded)
{
if (_TF1Macd == null)
{
_TF1Macd = MACD(BarsArray[1],12,26,9);
}
if (BarsPeriod.BarsPeriodType == TF1Type && BarsPeriod.Value == TF1Period)
{
switch (TF1Indi)
{
case tf1Indi.Macd_Ema:
{
AddChartIndicator(_TF1Ema);
AddChartIndicator(_TF1Macd);
} break;
}
}
I have set that only when I choose to visual the same Chart of TF1 it show the indicator ...otherwise I see only color of the chart.
This is for volume/50000 (TF1) to see the indicators
Error 1: if the strategy is running changing TF (period or type). example choosing volume 10000. The indicators desappear but leave a "white space below"
Error 2: If the strategy is running and I choose the TF1 to see the indicator. The indicators open in the "panel chart"
All came back right with disable/enable the strategy (or re-setting the same period/type value of the chart).
Any idea about fix it please? Many thanks.
Comment