Git Product home page Git Product logo

sequoia's Introduction

Sequoia选股系统

简介

本程序使用AKShare接口,从东方财富获取数据。

本程序实现了若干种选股策略,大家可以自行选择其中的一到多种策略组合使用,参见work_flow.py,也可以实现自己的策略。

各策略中的end_date参数主要用于回测。

准备工作:

环境&依赖管理

推荐使用 Miniconda来进行 Python 环境管理 Miniconda — conda documentation

安装 conda 后,切换到项目专属环境进行配置,例如:

conda create -n sequoia39 python=3.9
conda activate sequoia39

根据不同的平台安装TA-Lib程序

推荐使用Python3.8以上以及pip3

Python 依赖:

pip install -r requirements.txt 

更新akshare数据接口

本项目已切换至akshare数据接口,该项目更新频率较高,使用前建议检查接口更新

pip install akshare --upgrade

生成配置文件

cp config.yaml.example config.yaml

运行

本地运行

$ python main.py

运行结果查看 logs 目录下生成的日志文件 格式为 logs/sequoia-$YEAR-$MONTH-$DAY-$HOUR-$MINUTE-$SECOND.log 如:logs/sequoia-2023-03-03-20-47-56.log

服务器端运行

定时任务

服务器端运行需要改为定时任务,共有两种方式:

  1. 使用Python schedule定时任务

    • config.yaml中的cron配置改为truepush.enable改为true
  2. 使用crontab定时任务

    • 保持config.yaml中的cron配置为falsepush.enabletrue
    • 安装crontab
    • crontab -e 添加如下内容(服务器端安装了miniconda3):
     SHELL=/bin/bash
     PATH=/usr/bin:/bin:/home/ubuntu/miniconda3/bin/
     # m h  dom mon dow   command
     0 3 * * 1-5 source /home/ubuntu/miniconda3/bin/activate python3.10; python3 /home/ubuntu/Sequoia/main.py >> /home/ubuntu/Sequoia/sequoia.log; source /home/ubuntu/miniconda3/bin/deactivate

微信推送

使用WxPusher实现了微信推送,用户需要自行获取wxpusher_tokenwxpusher_uid,并配置到config.yaml中去。

如何回测

修改config.yamlend_date为指定日期,格式为'YYYY-MM-DD',如:

end = '2019-06-17'

sequoia's People

Contributors

sngyai avatar dependabot[bot] avatar ethqunzhong avatar yipko avatar qfzy1233 avatar ymm238 avatar riseinrose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.