# stocks_quotation_quant_backtest **Repository Path**: wyx_develop/stocks_quotation_quant_backtest ## Basic Information - **Project Name**: stocks_quotation_quant_backtest - **Description**: No description available - **Primary Language**: Python - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-04-02 - **Last Updated**: 2025-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 股票行情-量化-数据回测 ## architecture 架构设计 1. 获取行情,get quotation 存入数据库 2. 读取行情,做回测 3. 持续集成,持续发送回测报告 ## stocks strategy ### 神奇九转 [神奇九转](./shenqijiuzhuan.md) ### RSI 专家系统 [RSI 专家系统](./RSI_expert_system.md) ## about quotation 1. [pytdx](https://gitee.com/better319/pytdx) 2. mirror 的[easyquotaton](https://gitee.com/qiangge_666/mirror_easyquotation) 3. [stock_pick](https://gitee.com/qiangge_666/stock_pick) ## how to dev ```bash code=https://gitee.com/qiangge_666/stocks_quotation_quant_backtest git clone $code # conda activate py38 cd stocks_quotation_quant_backtest pre-commit install pre-commit install pre-push # conda install pymysql # pacman/apt -Sy mypy # pacman/apt -Sy shellcheck # pacman/apt -Sy shfmt pip3 install pymysql pip3 install types-PyMySQL git checkout git commit git push # make a pull request ``` ## how to use mysql ```bash docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql docker exec -ti mysql-test /bin/bash mysql -u root -p ``` sql cmd ```bash show databases; create database gupiao; show databases; use gupiao; show tables; describe gujia; ``` then change the ip of db in the main_easyquotation.py file then run the test_creat_table.py test ```bash pytest test_create_table.py ``` ## the sql table structure ```bash mysql> describe gujia; +-------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+----------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | gupiaoid | char(20) | NO | | NULL | | | name | char(20) | YES | | NULL | | | open | float | YES | | NULL | | | close | float | YES | | NULL | | | now | float | YES | | NULL | | | high | float | YES | | NULL | | | low | float | YES | | NULL | | | buy | float | YES | | NULL | | | sell | float | YES | | NULL | | | turnover | float | YES | | NULL | | | volume | float | YES | | NULL | | | bid1_volume | float | YES | | NULL | | | bid1 | float | YES | | NULL | | | bid2_volume | float | YES | | NULL | | | bid2 | float | YES | | NULL | | | bid3_volume | float | YES | | NULL | | | bid3 | float | YES | | NULL | | | bid4_volume | float | YES | | NULL | | | bid4 | float | YES | | NULL | | | bid5_volume | float | YES | | NULL | | | bid5 | float | YES | | NULL | | | ask1_volume | float | YES | | NULL | | | ask1 | float | YES | | NULL | | | ask2_volume | float | YES | | NULL | | | ask2 | float | YES | | NULL | | | ask3_volume | float | YES | | NULL | | | ask3 | float | YES | | NULL | | | ask4_volume | float | YES | | NULL | | | ask4 | float | YES | | NULL | | | ask5_volume | float | YES | | NULL | | | ask5 | float | YES | | NULL | | | date | char(20) | YES | | NULL | | | time | char(20) | YES | | NULL | | +-------------+----------+------+-----+---------+----------------+ 34 rows in set (0.00 sec) ``` ## git use Git 全局设置: ```bash git config --global user.name "liq07lzucn" git config --global user.email "916482193@qq.com" ``` 创建 git 仓库: ```bash mkdir stocks_quotation_quant_backtest cd stocks_quotation_quant_backtest git init touch README.md git add README.md git commit -m "first commit" git remote add origin git@gitee.com:qiangge_666/stocks_quotation_quant_backtest.git git push -u origin master ``` 已有仓库? ```bash cd existing_git_repo git remote add origin git@gitee.com:qiangge_666/stocks_quotation_quant_backtest.git git push -u origin master ``` ## todo ## 运行代码 ```bash pipx run tox ```