Friday, May 17, 2019

I've identified 6 backtesting libraries for Python, but none of them seems to support options backtesting? Am I missing something, or do any of you know how to backtest options?

PyAlgoTrade

PyAlgoTrade is a muture, fully documented backtesting framework along with paper- and live-trading capabilities. Data support includes Yahoo! Finance, Google Finance, NinjaTrader and any type of CSV-based time-series such as Quandl. Supported order types include Market, Limit, Stop and StopLimit.

PyAlgoTrade supports Bitcoin trading via Bitstamp, and real-time Twitter event handling.

bt - Backtesting for Python

bt “aims to foster the creation of easily testable, re-usable and flexible blocks of strategy logic to facilitate the rapid development of complex trading strategies”.

The framework is particularly suited to testing portfolio-based STS, with algos for asset weighting and portfolio rebalancing. Modifying a strategy to run over different time frequencies or alternate asset weights involves a minimal code tweak. bt is built atop ffn - a financial function library for Python.

Backtrader

This platform is exceptionally well documented, with an accompanying blog and an active on-line community for posting questions and feature requests. Backtrader supports a number of data formats, including CSV files, Pandas DataFrames, blaze iterators and real time data feeds from three brokers. These data feeds can be accessed simultaneously, and can even represent different timeframes. Supported brokers include Oanda for FX trading and multi-asset class trading via Interactive Brokers and Visual Chart.

pysystemtrade

pysystemtrade developer Rob Carver has a great post discussing why he set out to create yet another Python backtesting framework and the arguments for and against framework development. The backtesting framework for pysystemtrade is discussed in Rob’s book, "Systematic Trading".

pysystemtrade lists a number of roadmap capabilities, including a full-featured back tester that includes optimisation and calibration techniques, and fully automated futures trading with Interactive Brokers. Open source contributors are welcome.

Zipline

Zipline is an algorithmic trading simulator with paper and live trading capabilities. Accessible via the browser-based IPython Notebook interface, Zipline provides an easy to use alternative to command line tools. Supported and developed by Quantopian, Zipline can be used as a standalone backtesting framework or as part of a complete Quantopian/Zipline STS development, testing and deployment environment. Zipline provides 10 years of minute-resolution historical US stock data and a number of data import options.

QSTrader

QSTrader is a backtesting framework with live trading capabilities. QuantStart Founder Michael Halls-Moore launched QSTrader with the intent of building a platform robust and scalable enough to service the needs of institutional quant hedge funds as well as retail quant traders. QSTrader currently supports OHLCV "bar" resolution data on various time scales, but does allow for tick data to be used.

Both backtesting and live trading are completely event-driven, streamlining the transition of strategies from research to testing and finally live trading. Core strategy/portfolio code is often identical across both deployments.

The main benefit of QSTrader is in its modularity, allowing extensive customisation of code for those who have specific risk or portfolio management requirements.


No comments:

Post a Comment