Algorithmic trading with Robinhood using Wolfinch

Joshith Rayaroth Koderi
Coinmonks
Published in
3 min readJul 9, 2020

--

Photo by Austin Distel on Unsplash

Wolfinch is an open source algorithmic trading platform written in python. It allows users to create a trading strategy and execute trades automatically. Wolfinch supports algorithmic trading on equity markets and cryptocurrency markets. It supports multiple brokers and exchanges for placing the trades.

You can read more about installing and using Wolfinch bot here.
Wolfinch project is hosted here in github.

Now let’s focus on using Wolfinch for algorithmic trading on Robinhood. There are primarily two steps in this.

Setting up Wolfinch

Wolfinch configuration is done through a YAML config file. There are tons of configuration options available to tweak and tune various features in the bot. The config file is divided in to multiple sections to configure exchanges, strategies, various limits etc.

here is a sample config file.

The YAML config file is pretty intuitive by itself. However, you can find more details here.

The sample config file above is pretty exhaustive to show the config options. In reality the config file can be much simpler.
The only section specific to Robinhood is the exchange config at the top. This is where the stock symbols and their limits are configured. Also, it takes an exchange specific config file for configuring Robinhood access details.

Setting up Robinhood

Wolfinch takes trading decisions based on the strategy configured. However, the trades are ultimately performed in an exchange or a broker.

Since we are using Robinhood for placing our trades, we need to configure Robinhood access for Wolfinch. The exchange config for Wolfinch is done with a simple YAML config file. This is a separate file from the main bot config file for security reasons.

Here is a sample exchange config file for Robinhood.

2FA is required for Wolfinch to seamlessly access Robinhood APIs. To enable 2FA, you can go to your Robinhood Web App. Go to settings, turn on 2FA, select “Authentication App”, click “Can’t Scan It?”, and copy the 16-character QR code. More details here.

Note: Robinhood required minimum $25K balance to avoid Pattern Day Trader (PDT) flagging. You can consider this and model your strategy accordingly, either to avoid PDT or embrace it.

Implementation Detail

For those who are curious, here is a little more implementation details about Robinhood exchange module.

Wolfinch Robinhood module uses Robinhood APIs for placing trades and finding order status and similar tasks. Most of the exchange interactions are using the well known RH python client here https://github.com/robinhood-unofficial/pyrh

For Real-time ticker updates and for historic candlestick data, Yahoo Finance APIs are being used. Ticker updates uses a websocket endpoint for real-time feed.

Closing notes

Robinhood and Wolfinch provides a perfect combination for a successful algorithmic trading system. Finding an efficient strategy is the real creative work behind any successful algorithmic trading system. Wolfinch provides the right platform and the necessary tools for making that quest seamless.
Happy trading!

Also, Read

Get Best Software Deals Directly In Your Inbox

--

--