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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file backtest-0.7.8.tar.gz.

File metadata

  • Download URL: backtest-0.7.8.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.9.0b4

File hashes

Hashes for backtest-0.7.8.tar.gz
Algorithm Hash digest
SHA256 b36da3489fb0b67299cc21584fb5ade706a3c488fb212e527e92c98d608e7fef
MD5 b475dc4b2f3c2f3e80e039c32ecf0b53
BLAKE2b-256 5a1bcd174c6a3bce465e8f10370bc7af165c9f5fee4e6407900c6fdaeff5ac67

See more details on using hashes here.

File details

Details for the file backtest-0.7.8-py3-none-any.whl.

File metadata

  • Download URL: backtest-0.7.8-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.9.0b4

File hashes

Hashes for backtest-0.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 738ffb215347a378bec43aa5d43e7ff3d6a8ed5f8a3a0c7094529b8eced12022
MD5 bce550aeb0b58f010a88b5244895386b
BLAKE2b-256 a289a265896ac06bc39365554fbb888ba6053a1e0014e5c021de40ce84b61afe

See more details on using hashes here.

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