bfortuner / punisher

Cryptocurrency trading library for machine learning research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My, Man!

alt text

Quickstart

  1. Download price data from S3
python -m punisher.data.ohlcv_fetcher --exchange binance --symbol ETH/BTC --timeframe 30m --action download
  1. Run the strategy script in backtesting mode
python -m punisher.strategies.simple -ohlcv .data/binance_ETH_BTC_30m.csv -t 30m -m backtest -a ETH/BTC -ex binance
  1. View the results (visit localhost:8000)
python -m punisher.charts.dash_charts.dash_record --name default_backtest

Install

  1. Install Miniconda with Python 3.6

  2. Create conda environment

conda env create -f environment.yaml -n punisher
source activate punisher
  1. Add your API keys to dotenv_example and rename .env.

No API keys? You can still download data from our S3 bucket for backtesting. Or access the Exchange public APIs by emptying the dictionary we pass in as a config to the CCXTExchange class.

  1. Initialize submodules
git submodule init
git submodule update
  1. Install Extras (Optional)
conda install ipywidgets
jupyter nbextension enable --py --sys-prefix widgetsnbextension
conda install -c tim_shawver/label/dev qgrid==1.0.0b10
conda install -c conda-forge python.app
conda install pytorch torchvision -c pytorch (http://pytorch.org/)

Download data from S3

OHLCV

python -m punisher.data.ohlcv_fetcher --exchange gdax --symbol BTC/USD --timeframe 1d --action download

Reddit

python -m punisher.data.reddit_fetcher --subreddit bitcoin --action download

Twitter

python -m punisher.data.tweet_fetcher --query 'bitcoin OR btc' --lang en --action download

Running Tests

python -m pytest tests/ (all tests)
python -m pytest -k filenamekeyword (tests matching keyword)
python -m pytest tests/utils/test_sample.py (single test file)
python -m pytest tests/utils/test_sample.py::test_answer_correct (single test method)
python -m pytest --resultlog=testlog.log tests/ (log output to file)
python -m pytest -s tests/ (print output to console)

How to commit (cleanly)

  1. Before coding:
git pull master
git checkout -b feature
  1. After coding, when you're ready to merge
# Pull latest changes from repo
git checkout master
git pull

# Merge master into feature branch.
git checkout feature
git merge master
  1. Resolve conflicts

  2. Merge feature into master and squash all your commits

git checkout master
git merge feature --squash
git commit -m 'Detailed Commit message describing your changes'
git push

Resources

Data

Exchanges

Research

Tutorials

Blogs/News

  • TODO

Tools / Charts

Repos

Known Issues

About

Cryptocurrency trading library for machine learning research


Languages

Language:Jupyter Notebook 85.3%Language:Python 14.7%