Contango
Contango is a python engine to backtest, parameterize, and graph trading strategies.
Getting Started
Strategies
There's two ways to build a strategy. If you want full control, subclass Strategy directly and write everything yourself. If you'd rather create strategies quicker, RuleBasedStrategy gives you streams, conditions, rules, intents, and position sizing so you can compose a strategy without writing as much boilerplate.
Data
Historical data comes from a data provider (Yfinance works with no API key needed), gets checked against a calendar for expected timestamps, and gets cached locally so you're not polling the same data.
Running Backtests
- Engine
- Backtester
- Static Runner - runs a single strategy once.
- Grid Search Runner - runs every combination of a parameter grid.