Giter Site home page Giter Site logo

ianynchen / personae Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ceruleanacg/personae

0.0 1.0 0.0 10.15 MB

Personae is a repo of implements and enviorment of Deep Reinforcement Learning & Supervised Learning.

License: MIT License

Python 100.00%

personae's Introduction

Personae - RL & SL Methods and Envs For Trading

Personae is a repo of implements and environment of Deep Reinforcement Learning & Supervised Learning.
This repo tries to implement new methods and papers in different ways (TensorFlow or PyTorch) and test them in Financial Market (Stock Market).

Contents

Environment

A basic test environment of Financial Market is implemented.

  • Stock Market
    Implement of Stock Market, Trader, Positions as a gym env (gym is not required), which can give a env for regression or sequence data generating for RL or SL model.

Also, more function is updating.

Experiments

Total Profits and Baseline Profits. (Test Set)

  • DA-RNN (DualAttnRNN)
    Train a Predictor to predict stock prices, using stocks data set from 2008-01-01 to 2018-01-01, where 70% are training data, 30% are testing data.

Prices Prediction Experiments on 4 Bank Stocks. (Test Set)

Requirements

Before you start testing, following requirements are needed.

  • Python3.5
  • TensorFlow-1.4
  • PyTorch
  • Numpy
  • Pandas
  • sklearn
  • mongoengine
  • tushare
  • matplotlib
  • CUDA (option)
  • Docker (option)

It's best that if you are a Docker user, so that you can use run the whole project without installing those dependencies.

And you can also use Ansible to run CUDA-Playbook and Docker-Playbook to install CUDA and Nvidia-Docker if you want to run tests in a Docker Container.

How to Use

If you use Docker

About base image

My image for this repo is ceruleanwang/haru, and haru is inherited from ceruleanwang/quant.
The image ceruleanwang/quant is inherited from nvidia/cuda:8.0-cudnn6-runtime.
So please make sure your CUDA version and cuDNN version are correct.

Instructions

First you should make sure you have stocks data in your mongodb. If you don't have, you can use a spider writen in this repo to crawl stocks data by following code:

docker run -t -v local_project_dir:docker_project_dir --network=your_network ceruleanwang/haru spider/finance.py

But remember to set stock codes that you want to crawl, the default are:

codes = ["600036", "601328", "601998", "601398"]

And they can be modified in:

You can also use a mongo container (option) by following code:

docker run -p 27017:27017 -v /data/db:/data/db -d --network=your_network mongo

Then you can just run a model by:

docker run -t -v local_project_dir:docker_project_dir --network=yuor_network ceruleanwang/haru algorithm/RL or SL/algorithm_name.py

If you use Conda

You can create an env yourself, and install Python3.5 and all dependencies required, then just run algorithm in your way.

TODO

  • More Implementations of Papers.
  • More High-Frequency Stocks Data.

personae's People

Contributors

ceruleanacg avatar

Watchers

 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.