I know you are just playing with it, but if you want to do something that you can trust, add commissions and slippage to the algo. I can imagine that your dreams will vanish after doing that. And they call the EA Invincible
"Expert advisor", they call it like that on the Metatrader software https://www.mql5.com/en/market/mt4
So what makes you think the dividends are just ROC lol. They can return capital at times to maintain a high dividend which is healthy...and it means you don't pay tax on your own capital being returned. https://www.investopedia.com/terms/r/returnofcapital.asp Also, even if you bought at the worst time (recent highs) you are still up in MSTY with dividends in...how would your non-dividend stock hold up?
You are assuming that MSTY will recover its price immediately after setting the dividend date, which might not happen that quickly; otherwise it would be a printing money machine.
I'm not assuming anything. I couldn't care less what msty price does lol...I'm in it for the dividends not capital gains. If price drops that just means more dividends on the cheap!