I am using a simple open-price daily SMA as the main indicator for the strategy. It's calculated like this:
Quote:
indicators.sma(instrument,Period.DAILY, OfferSide.BID, IIndicators.AppliedPrice.OPEN, MAPeriod, 0)
And this is put inside an onBar() event, and checked at every period==Period.DAILY.
The backtest goes speedy, unless I put this indicator over the chart, to see what the strategy is doing.
I put it on the chart of the backtest (Daily chart, EUR/USD), Indicator price is Open price, period is 14.
The speed massively slows down. I even have to backtest without the indicator on the chart, because it takes forever with the indicator on chart.
When I started to backtest the strategy, I did with the indicator off the chart, and it was running fast. However, I forgot I did that in the beginning, and when I got to latter stages, I added the indicator. I was running on a friend's virtual machine with 2 cores allocated, but the speed drop was so significant that I cleared the registry, rebooted machine, got an extra core and extra memory and the drop is still significant. That's when I realised it was the on-chart indicator causing the issue.
Check the code for your indicator implementation. It probably recalculates at each tick, causing the massive slowdown, but it's open price, it shouldn't do that!