Why is this backtest stopping??

Not really sure what's going on I'm sure I'm just missing something but none of my backtests are going to their end dates.

Update Backtest

I just cloned it and ran a backtest, two potential causes is max trades for a free account in the backtest (I remmeber hearing about this because when I'm running this on my account its making it farther than your attached test)? As well as you dont have a filter to only open one position at a time so it keeps adding as long as the conditions are true which is hitting a margin call a lot. Also mine just errored out saying max memory used.


Sorry do you know how to put that filter on to have only one position open because when I attempt to do it the backtest only fulfills 3 or 4 trades over the course of a year did I do something wrong.


Well its very rare for a pair to be > 100 pips from its 5 day average, that may be the case.


i changed the difference and it is still only making 3 trades


You have written self.Portfolio["EURUSD"].Invested == False as a condition for entering an order. From what I can tell, there's no way it's going to get back to that state (because there's no logic to exit the position when being Invested).


Update Backtest


The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


This discussion is closed