Skip to content

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

License

Notifications You must be signed in to change notification settings

codfish-zz/cn-trader

Repository files navigation

cn-trader

license.png

English | 简体中文

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published