I've a strategy which works great on backtest, but causes my PC to freeze up when I run it in real time - i believe purely from having to perform too many calculations befor the next onBarUpdate arrives.
The strategy involves looping through multiple instances of an indicator i've written, with an ever decreasing parameter value.
The indicator is visually similar to Bollinger Bands, so in the following example I use "Bollinger Band" to signfy my indicator.
The strategy starts with an arbitrary Bollinger Band parameter value, say 20, and looks for a trade signal, then runs the strategy with a parameter 1 unit less (19) and looks for a trade signal etc.. etc.. When it generates a trade signal a Limit order is enterred (EnterLongLimit or EnterShortLimit).
The nature of the strategy is to have lots of buy and sell signals below and above the market, ready to take advantage of spikes below and above the BollingerBand style indicator. For this reason there are many many orders enterred every minute and only a fraction of which are ever executed.
Ideally i'd like to run this strategy on all the liquid futures markets concurrently, as in backtests its dose very well. However, in its current form I can't even run it on one market without causing a freeze up.
Any suggestions greatly appreciated!
Code is attached.
Cheers
Ben Heaton
Comment