Building a Robinhood Stock Trading Bot

Here’s the repo:

Okay, that’s nice to know, but what does the bot actually do?

As of now, it implements the golden cross strategy, so if a stock’s 50-day moving average crosses above its 200-day moving average, we purchase it. Likewise, we own a stock and its 50-day moving average crosses below its 200-day moving average (AKA a death cross), we sell it. A really simple and well-known strategy. The nice thing about the code is that it’s really simple to write and plug in new strategies, which I’ll likely be adding in the near future.

So how do I run it?

Install Python on your machine if you haven’t already (I use Python 3), and use pip to install robin-stocks, ta, numpy, pandas, and matplotlib.

  1. Related to commodities and range-bound, so the golden cross strategy is not very suited for trading them.
Chart for Amazon showing golden cross in late April

I code stuff.