I have an indicator, that uses ChartControl.BackColor. This indicator
makes some simple calculations and paints the candles on the chart.
When it is used as an indicator - it woks without any problem.
When I make some simple strategy, that uses this indicator mentioned above,
the strategy fails, because the strategy and indicator bars are not in sync.
(I call Update() correctly when accessing internal data, that is not source of the problem)
That means, the indicator is not updated properly to be in sync with strategy.
I have very curious problem (I spent half day to isolate to find the cause),
where using ChartControl.BackColor causes the problem and replacing it
with Color.Black (any color constant) removes the problem.
This code causes failure:
BarColor = isRisingBar ? barColor : ChartControl.BackColor;
BarColor = isRisingBar ? barColor : Color.Black;
Do you have any idea, how can this be possible?
Can it have some side effects?

Comment