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