I don't see anything internally regarding threading issues with OnFundamentalData, but we do document some precautions for cross thread exceptions. Due to the multi-threaded nature of NinjaTrader 8 it would be expected to run into such issues with separate threads. Subscribing and Unsubscribing on separate threads would qualify here.
Our cross thread exception advisories can be referenced in the Multi-threading considerations page of the help guide.
When accessing objects included on the UI, you may receive the following error if you attempt to access a certain property/method from the wrong thread:
"Error on calling 'OnBarUpdate' method on bar 0: You are accessing an object which resides on another thread. I.E. creating your own Brush without calling .Freeze(), or trying to access a UI control from the wrong thread without using a Dispatcher"
This error can be avoided by invoking the Dispatcher used on the appropriate UI thread.
If you disagree that this is explained (in general) in the Multi Threading Considerations page, please send us a test script so we can forward your inquiry to Development. (We are capable of creating test scripts on the NinjaScript team for review, but we also have other priorities that we need to take first. It is best if we can receive a test script from you that explains the matter in clear terms so we can avoid any guess work, get the issue reported as you see it, and so we can continue assisting others in a timely manner.)
I look forward to being of any further assistance.
Leave a comment: