I have been trying to implement a momentum strategy. When I first deployed my first backtest about 2 days ago, the returns were relatively positive. My start date was 2018-8-1 and I did not set an end date (set to default) and this gave me 90% return over the period with a 100000 starting capital. 
The strategy ranks the top momentum stocks and longs them with a monthly rebalancement. Anyway, after I tweaked around a few parameters, the backtest results went way off and so I changed the entire code back to the original one (literally copy and pasted the same code). However, the results were completely different. I tried closing the project, creating the algorithm again and still the backtest results were completely different even though I was using the same original code. I went to look into the orders of the new backtest and the orders made were completely different even though I was using the same exact code. For example, in the original backtest with the positive results I would have bought Tesla a couple of times in 2020 but instead the new backtest results did not contain a single Tesla and I was buying completely random and different stocks.

 

Has anyone come across this problem before? Any help is appreciated! Thank you

Author