Javier Rodríguez Chatruc 7e8462c600 Merge pull request #53 from lambdaclass/add_matplotlib_dep
Added matplotlib to Pipfile
2020-01-09 12:40:41 -03:00
2019-05-13 17:28:34 -03:00
2019-08-21 18:38:25 -03:00
2019-08-09 10:31:40 -03:00
2019-05-13 15:28:23 -03:00
2019-05-08 11:48:05 -03:00
2019-09-24 18:19:49 -03:00
2020-01-09 12:38:08 -03:00
2020-01-09 12:38:08 -03:00
2019-05-16 14:18:12 -03:00

Options Backtester

Simple backtester to evaluate and analyse options strategies over historical price data.

Requirements

  • Python >= 3.5
  • pipenv

Setup

For backtesting, set $OPTIONS_DATA_PATH to the appropriate directory where the data is located. All file paths parsed by the backtester will be relative to this directory.

To use the data scraper the following environment variables need to be set:

  • $SAVE_DATA_PATH: where the data will be saved to (default is ./data/scraped)
  • $TIINGO_API_KEY: used to fetch data from Tiingo
  • $S3_BUCKET: name of the S3 bucket to backup data
  • $AWS_ACCESS_KEY_ID: AWS acces key id
  • $AWS_SECRET_ACCESS_KEY: AWS secret key
  • $SLACK_WEBHOOK: used to send Slack notifications

You can configure the data scraper by editing the configuration file data_scraper.conf (json-formated).

Sample file:

{
  "cboe": {
    "mute_notifications": ["BFB", "CBSA"]
  }
}

HINT: store environment variables in an .env file and pipenv will load them automatically when using make env.

Usage

Create environment and download dependencies

$> make init

Activate environment

$> make env

Run tests

$> make test

Scrape data (supported scrapers: CBOE, Tiingo)

$> make scrape scraper=cboe

$> make scrape scraper=tiingo

Run backtester with benchmark strategy

$> make bench

For complete novices in finance and economics, this post gives a comprehensive introduction.

Books

Introductory

  • Option Volatility and Pricing 2nd Ed. - Natemberg, 2014
  • Options, Futures, and Other Derivatives 10th Ed. - Hull 2017
  • Trading Options Greeks: How Time, Volatility, and Other Pricing Factors Drive Profits 2nd Ed. - Passarelli 2012

Intermediate

  • Trading Volatility - Bennet 2014
  • Volatility Trading 2nd Ed. - Sinclair 2013

Advanced

  • Dynamic Hedging - Taleb 1997
  • The Volatility Surface: A Practitioner's Guide - Gatheral 2006
  • The Volatility Smile - Derman & Miller 2016

Papers

Data sources

Options trading strategies backtests

Exchanges

Historical Data

S
Description
Simple backtesting software for options
Readme MIT 32 MiB
Languages
Jupyter Notebook 98.5%
Python 1.5%