Skip to main content

Backtest engine for algorithmic trading

Project description

Backtest

Python version PyPI version Test Build Coverage Docs License: GPL v3

A backtest engine for developing algorithmic trading strategy.

Table of Contents

Installation

$ pip install backtest

Preparation

Fetching symbols of KOSPI and KOSDAQ exchanges:

$ python -m backtest.utils.symbols_krx symbols.json
Fetched 2,820 symbols
Saved in symbols.json

Usage

The following will execute the backtest after loading configuration file, config.json in same directory.

python -m backtest

Sample content of config.json

{
  "cash": 1000000,
  "ticks_dir": "ticks",
  "ledger_dir": "ledger",
  "symbols_file": "symbols.json",
  "strategy": "strategy",
  "exchanges": [
    "backtest.exchanges.kospi",
    "backtest.exchanges.kosdaq"
  ]
}

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

Testing

Test codes are prepared in tests/ based on PyTest framework.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backtest-0.7.8.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

backtest-0.7.8-py3-none-any.whl (38.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page