The secret is to spawn multiple AIs to bump the stock, and then for the first AI to cash out early, leaving the other AI instances penniless. Somehow this results in a net positive.
The trick is for those other AIs to reserve a few bucks, so they can repeat the process but this time cash out early. Keep repeating until everybody wins.