Support different broker APIs in separate modules (start with RobinHood and alpaca) such that if the general program decides to sell an asset, a generic call to sell can be routed to the specific sell function for the API of the active broker per the environment variables. Evaluate the priority current price table. If no order exists for this ticker, and x periods (set in environment variables) have passed, and price has moved a greater percentage in the same direction each period then place a purchase order with less than x% (set in environment variables) of the available cash (rounded down). If all x periods exceed 2 standard deviations moving away from the moving average or all x periods are moving towards the moving average, then buy options (expiring the next Friday beyond today at the next strike price in the direction that the price is moving and that is being actively traded and The purchase represents no more than x% (set in environment variables) of the current volume of options being traded). If the price is rising, buy call options If the price is falling, buy put options If we already own options, continue to monitor the current price every x seconds. When two periods have passed where the price change has been slowing down, or a period has passed where the price has not changed or has reversed, sell the options if we meet the requirements for day trading, else purchase an offsetting call or put option to lock in our current gain, selling whichever option is losing money at the next days opening, and later selling the other option when it stops gaining. With each sale \ (purchase), add to \ (subtract from) the brokerage account cash balance Also, add each gain and subtract each loss from the total account balance Robinhood Alpaca Surmount Tradestation Fidelity Schwab As major indices show a strong upward price trend, give more emphasis to call options. As stock prices make new highs or bounce up from levels of support, purchase call options, but only if the next level of expected resistance represents at least a 5% price increase in the call option. As price increases slow, stop or reverse to back test previous support levels, sell the call options, preferably as prices are still slowly increasing. If necessary to avoid day trading, lock in the current gains by purchasing an offsetting put option, then probably sell both the next day. (Immediately sell the one losing money, then later the one gaining money) As major indices show a strong downward price trend, give more emphasis to put options. Do the opposite for put options than what is described above for call options, but hold put options for a shorter time than we would for a call option.