When I first add the Indicator and click OK it takes around 30 seconds to process 30,000 or so bars. My code is executing in max 1ms (I have tested this in VS debugger under debug mode).
It's calling OnBarUpdate for every bar with the number of bars increasing as it goes. The delay seems to be in how quickly this OnBarUpdate is called.
Once it has done this and the live feed is runnng, OnBarUpdate is a single call with the maximum bars and the 1ms is not an issue.
Is there any setting or option that I can use to speed up the initial add where it can be given the complete bar count instead of looping through them?
Comment