Python

You can easily and sensibly run multiple versions of Python with pyenv

Python 3.9 just came out recently, and I thought it would make sense to check out some of the new features (dict union operators, string remove prefix and suffix, etc.). Of course, doing this requires a Python 3.9 environment. Since new versions of Python may break existing code, I don’t want to update my entire …

You can easily and sensibly run multiple versions of Python with pyenv Read More »

How to get historical market data from Interactive Brokers using Python

When exploring the world of quantitative finance or algorithmic trading, you quickly end up facing a very common issue. Where do you get historical market data? If you have an account with Interactive Brokers, you can download historical data from them using Python. This article will show you how. No matter what sort of analysis …

How to get historical market data from Interactive Brokers using Python Read More »

How to connect to Interactive Brokers using Python

The discount brokerage space is getting very competitive with commissions going to zero recently at many brokerages, including Interactive Brokers. IB has long been a broker with one of the largest breadth of products and service offerings targeting a professional audience. IB is also a low cost brokerage, so that makes it a good option …

How to connect to Interactive Brokers using Python Read More »

Backtrader, a Python backtesting and trading framework

After looking at zipline, another backtesting framework, I thought it would make sense to take a look at some other options in the open source community for backtesting and trading. The next framework to investigate is backtrader, an open source project that aims to provide tooling for backtesting and live trading algorithmic strategies. I’ll use …

Backtrader, a Python backtesting and trading framework Read More »

Zipline, an open source backtesting library from Quantopian

Developing an algorithmic trading strategy is a challenging process, with many factors to consider. One part of the process in developing a strategy is to measure its performance using historical data in what is called a backtest. It can be very helpful is to have a decent library that abstracts away some of the challenging …

Zipline, an open source backtesting library from Quantopian Read More »