Coding Devops Distributed Systems Getting Started in Coding Scala Software Engineering Uncategorized

Robinhood CLI for Quick Stock Exits + Multi-Factor Login Support

Screen Shot 2019-02-19 at 4.40.05 PM

What Robinhood is Missing

I’ve really enjoyed trading with Robinhood (NO FEES) these last few months, but viewing some metrics in their web UI and mobile app take too many clicks. For one, determining my percent return requires three clicks for each Stock position. This is too slow when you want to be quickly informed on when to make quick exits.

The CLI Tool

Preferably, I wanted a quick and dirty CLI tool in Python to crunch these numbers for me. I ended up finding a great open source Python framework to interact with Robinhood’s backend API and decided to make some tweaks to it to support:

  1. Streamlined Multi-factor Auth Login
  2. Improved Security with credentials as environment variables
  3. Calculate and display percent return on each position

You can find my working Fork here:

Running the Tool

Executing Script + Login Prompt + MFA Code: 

(I have a bash/zsh alias here “robin” pointing to the script Shot 2019-02-19 at 3.57.12 PM

Metrics Output:

By sorting each position on this newly generated percent return field, your eyes are quickly drawn to the positions that you may want to exit soon.

Screen Shot 2019-02-19 at 3.33.58 PM

Happy trading!

Note: There are plans to have this work merged back into source repo in some fashion.