This approach has worked up until the last couple of days. It is now throwing the following runtime error:

[ERROR] FATAL UNHANDLED EXCEPTION:Engine.Run(): During the algorithm initialization, the following exception has occurred: Attempted to divide by zero. in BuyingPowerModel.cs:line 11

To replicate the error in the attached backtest, uncomment line 20.

Does anyone have any suggestions on this? Thanks!