Hello! I've really enjoyed working with your platform and learning Python at the same time. I've tried to re-create a strategy called "Defensive Asset Allocation" that has been posted on these forums before. It uses a momentum score using differing weights of 1, 3, 6, and 12 month momentum. It also uses the momentum score in two ETFs (VWO/BND) as a "canary" signal to change to a lower risk asset such as bond ETF. 

The problem is that when I run the same backtest with a different starting date or changing the number of assets held in the portfolio at any one time, I get different results in the "canary" signal which cause the strategy to go into bonds when it should not have. I assume this is because the MOMP numbers are different for some reason. I cannot understand why changing the # of assets held would affect that in the code. I'll try to include both backtests covering the same date period but with different results. It's most easy to see in 2017. I also had it print the momentum score in the logs to help with figuring out the difference.  

 

Thanks!

Author