Did some more testing, it's not looking good.
Basically, the problem lies entirely with the way the backtester is processing data.current(stock,'last_traded') < get_datetime() specifically the stocks SPXL and EDV are the ones stopping it. Other stocks stop it at their own different times, SPY rarely stops it, probably because it's so widely traded it has a better data stream.
The actual days it trades are completely random. Sometimes it trades 3 times in a month, sometimes once per 3 months all depending on if if the data stream is caught up to the minute when it hits 11am, usually it is 5-15 minutes behind for some reason. All my attempts to make it trade on a regular schedule (daily, weekly, bi-monthly, monthly) have ended with terrible backtests. In live trading I suspect that the data stream would be more accurate and thus give you the worst returns. Basically, it's impossible to trade this type of algorithm because it's not giving you good returns based on sound logic but pure luck of SPXL and EDV's data timestamps in the backtester.
I've modified this one quite a bit but you can use it to turn off or turn on the effects of the logic that's causing the problem. The list context.text can be set to test whatever stocks you want to test stopping the trading. If you set test to SPXL, EDV, and SPY (comment out line 21) it replicates the original logic and also tells you which days trading was stopped and which days the trades were executed in the log. The chart also records error rates so you can see that visually. By separating test and purchase lists you can set it to purchase a stock like SPY/TLT or VTI/TLT for a much longer backtest. However it's really not worth it, this algo should not be traded!