pythonバックテストフレームワーク

pythonのバックテストフレームワークについて調べていた時にこんな記事を見つけました。 

 

 

この記事では6つのフレームワークが取り上げられています。

 

  • PyAlgoTrade
  • bt - Backtesting for Python
  • Backtrader
  • pysystemtrade
  • Zipline
  • QSTrader

 

以下、2017年9月時点での情報です。

PyAlgoTrade

公式ページ

PyAlgoTrade - Algorithmic Trading

python ver Python 2.7
サンプルコード SMA Crossover

 

bt - Backtesting for Python

公式ページ

http://pmorissette.github.io/bt/

python ver Python 2.7
サンプルコード SMA Crossover

 

Backtrader

公式ページ

backtrader - Backtesting / Trading

python ver Python 2.x/3.x
サンプルコード SMA Crossover

 

pysystemtrade

公式ページ

https://github.com/robcarver17/pysystemtrade

python ver Python 3.x
サンプルコード  

この本の著者によるpythonバックテストフレームワーク

 

Zipline

公式ページ

http://www.zipline.io/

python ver Python 2.7/3.4/3.5
サンプルコード Dual Moving Average Cross-Over

quantopianのスタンドアローンバージョン

 

QSTrader

公式ページ

https://www.quantstart.com/qstrader

python ver Python 2.x/3.x
サンプルコード SMA Crossover

 

使用するフレームワークを選ぶ

動かすまでが一苦労です。それぞれのフレームワークに合った環境構築ができていないと動かないのでノンプログラマーの私には大変でした。ドキュメントが比較的充実していて動作確認まで最初にたどり着けたBacktraderをこのブログでは扱っていきたいと思います。