Giter Club home page Giter Club logo

tradingbot-pytorch's Introduction

TradingBot-pytorch Demo

目的

给定某只股票某年的分钟级数据,通过强化学习训练机器得到最佳操盘模型,最后用同只股票其他年份的分钟级数据进行回测,考察其表现

原理

  1. 数据处理(data.py),应用Ta-lib从原始分钟级数据(Open, High, Low, Close, Volume)提取出若干训练因子(RSI, SAR, WILLR, MACD等)
  2. 决策模型(models.py),经过处理的数据作为观察值state导入深度学习模型得出policy
  3. 环境互动(environ.py),将policy通过Agent(如epsilon-greedy或Probability selection)获得对应的动作action(持有或空仓),并和环境互动后得到下一分钟的观察值next_state、盈亏比例reward、回合完成的指令done、和其他信息info
  4. 训练模型(train.py),得到若干(next_state, reward, done, info)后,根据所选的强化学习类型(DQN或Actor-critic)计算loss并回溯优化模型参数,保存最佳参数并通过tensorboard监测模型表现

参考

  1. Book Deep Reinforcement Learning Hands-On
  2. Repo Deep-Reinforcement-Learning-Hands-On

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.