Skip to main content

Back testing system for China market

Project description

<p>cn-trader</p>

<a href="https://github.com/codfish-zz/cn-trader/blob/master/LICENSE">

    <img alt="GitHub" src="https://huui1998.pythonanywhere.com/admin/uploads/cn-trader/license.svg?color=blue">

</a>

<p>

    <b>English</b> |

    <a href="https://github.com/codfish-zz/cn-trader/blob/master/README_zh-hans.md">简体中文</a>

Overview

Python back testing system for trading strategies, based on backtrader and AkShare, customized for China market.

Installation

This repository is tested on Python 3.10+, backtrader 1.9+ and AkShare 1.4+.

With pip

pip install cn-trader

With source

$ git clone https://github.com/codfish-zz/cn-trader

$ cd cn-trader

$ pip install -r requirements.txt

Or

$ git clone https://gitee.com/huui/cn-trader.git

$ cd cn-trader

$ pip install -r requirements.txt

Quick tour

Run cn-trader with UI interface.

>>> from cn_trader import ui

>>> ui.main()

Main menu Main menu

Input stock symbol Input stock symbol

Change default parameters Change default parameters

Show picture or not Show picture or not

Show log or not Show log or not

Full picture Full picture

Zoom the picture Zoom the picture

Show log and summary Show log and summary

Menu auto-completing Menu auto-completing

Testing

Run single test case.

$ cd tests

$ python -m unittest tests.test_stock_mainland.StockMainlandTestCase.test_strategy_check_sma_cross

Output Output

Run all test cases.

$ cd tests

$ python -m unittest discover -v

Output Output

Create new strategy

Coming soon...

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cn_trader-1.0.2-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file cn_trader-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: cn_trader-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for cn_trader-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d28cedc4257a555a136c18db9dadae1454d13183b8a22dc73f566bc1a422cae1
MD5 149733bedd977b6a1e4500a51896e530
BLAKE2b-256 dcadbab5a1a0417cf6a88ba174c9ffc373afc2ab8dd2b99806711d1e74de32ba

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