The Eight Best Python Libraries For Algorithmic Trading
The Eight Best Python Libraries For Algorithmic Trading
1. FinTA
FinTA (Financial Technical Analysis) implements over eighty trading indicators in
Pandas. Unlike many other trading libraries, which try to do a bit of everything,
FinTA only ingests dataframes and spits out trading indicators. Even the
comments above each method are instructive, e.g., this comment annotating
MACD. You'll likely see some indicators you don't even recognize, and the breadth
of technical analysis encourages experimentation.
2. Zipline
Zipline is the best of the generalist trading libraries. It has almost 13k stars (see
my article on using data to evaluate software packages here) and powers
Quantopian, one of the most popular quant-finance communities, at least until
Robinhood recently acquired it. Zipline allows you to ingest data from the
command line (or a Jupyter notebook) and comes built-in with methods to
facilitate writing complex strategies and backtesting them.
https://thecarrots.io/blog/best-python-libraries-for-algorithmic-trading 1/4
4/2/2021 The Eight Best Python Libraries for Algorithmic Trading
3. CCXT
CCXT (CryptoCurrency eXchange Trading) is a lifesaver if you programmatically
trade cryptocurrency. No more will you have to write custom logic for each
exchange. CCXT abstracts away differences between individual exchange APIs
with a unified interface. It supports more than 120 exchanges. If you're not a
Pythonist, you can even use the JavaScript and PHP implementations of CCXT
(though you should get better taste in programming languages).
4. Freqtrade
Freqtrade is another crypto trading library that supports many exchanges. It
facilitates backtesting, plotting, machine learning, performance status, reports,
etc. You might be sighing at this point. How many cryptocurrency trading libraries
does one algorithmic trading enthusiast need? What's amazing about Freqtrade
is that you can control it with Telegram. That's right: you can henceforth DM your
robot investment manager. Here are some of its awesome Telegram commands:
/daily <n> : profit or loss per day, over the last n days.
If you want to power up your Freqtrade trading bot and turn it into a Gundam
ready to ravage financial markets on your behalf, check out Freqtrade Strategies,
which is what its name suggests.
5. YFinance
If you've been trading for long, you've likely heard of Yahoo! Finance. YFinance
allows you to reliably and efficiently download market data from Yahoo! Finance.
The library arose from a dire need when Yahoo decommissioned their historical
data API. The library's creator wrote a helpful tutorial here.
6. Backtrader
https://thecarrots.io/blog/best-python-libraries-for-algorithmic-trading 2/4
4/2/2021 The Eight Best Python Libraries for Algorithmic Trading
7. TensorTrade
TensorTrade is a framework for building trading algorithms that use deep
reinforcement learning. It provides abstractions over numpy , pandas , gym , keras ,
and tensorflow to accelerate development. TensorTrade is still in beta, but it's
quickly gaining traction and will likely become a mainstay in the quant
community. Adam King, the creator of Tensor Trade, wrote an excellent tutorial.
8. Trump2Cash
I saved the memeiest library for last. Trump2Cash monitors Donald Trump's
tweets. When he mentions publicly traded companies, it analyzes the tweet's
sentiment and executes trades accordingly. The library even includes a utility to
benchmark its historical performance. I'm not making any kind of
recommendation, but the algorithm has been surprisingly successful.
Even supposing that Trump's ability to influence financial markets will soon
wane, the source code is easily adaptable to other Twitter accounts. If you're
interested in Twitter sentiment as a feature for a trading strategy, the repo is
more than worth a look.
— Sam Winter
Sign Up
https://thecarrots.io/blog/best-python-libraries-for-algorithmic-trading 3/4
4/2/2021 The Eight Best Python Libraries for Algorithmic Trading
FIND JOBS
BLOG
TELEGRAM
CONTACT
Privacy Policy
https://thecarrots.io/blog/best-python-libraries-for-algorithmic-trading 4/4