Error on calling 'OnBarUpdate' method on bar 101: The calling thread cannot access this object because a different thread owns it.
The second line of code here get the error:
SolidColorBrush color = Brushes.Red;
BarBrush = color;
The indicator starts no new threads. It used to work correctly.
I tried this:
ChartControl.Dispatcher.InvokeAsync((() =>
{
BarBrush = color;
}));
The error doesn't occur, but only a few of the bars get colored. Which ones get colored seems random.
Note: The indicator was written to be called by a strategy. It works when used that way. But when loaded it by itself it gets the error. But the indicator should be able to stand alone and used to work that way. For all intents, it should be a black box.

Comment