I open NinjaTrader
I DO NOT connect and apply an indicator that I have developed. That indicator includes a toobar with multiple buttons on it.
Everything fine.
Connect to data.
Duplicating tool bar and error message : Error on calling 'OnStateChange' method: The calling thread cannot access this object because a different thread owns it.
If I connect before adding the indicator everything's fine and I have no error.
In my code I use the Dispatcher.InvokeAsync to built the toolbar menu and I also use the dispatcher to dispose in OnTerminated method.
Seems to reload the indicator on connection without disposing of previous indicator.
Need guidance
Thank you
Comment