This is a question about OnStartUp but 100% separate from my earlier question of yesterday.
If the answer you would give is - this is undocumented, then if possible please point me in the right direction.
Is the NinjaTrader internal call to OnStartUp synchronous in that I can do as much processing in OnStartUp as needed without being concerned about timing issues? This is primarily related to optimization but if there is a general answer to this, that would be best.
I am writing some custom code for optimization and I need to instantiate a dll that may or may not have been fully initialized internally (I know NT loads it).
The initialization can take a while as it needs to verify the state of an external database, initialize certain things within the database and in general do a lot of stuff.
The easiest and cleanest place for me to do that is in the constructor of the primary dll class but I also don't want to cause other issues within NT.
Central to my issue with OnStartUp is that in a sense, for an optimization run, it is recursive-like, in that I don't have any NT methods/variables to let me know where I am in the process.
I might be at the very beginning of the first backtest run or I might be 100 iterations into the process. I keep various state variables in the dll (and from there at times in the database) so that isn't the issue; I just don't want to affect the timing of how the optimizer works.
Best Regards,
Scott

Comment