All Projects β†’ Ceruleanacg β†’ Personae

Ceruleanacg / Personae

Licence: mit
πŸ“ˆ Personae is a repo of implements and environment of Deep Reinforcement Learning & Supervised Learning for Quantitative Trading.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Personae

Deep Learning Machine Learning Stock
Stock for Deep Learning and Machine Learning
Stars: ✭ 240 (-78.95%)
Mutual labels:  trading, stock-data, stock-price-prediction
Kupi Terminal
Ccxt based, open source, customized, extendable trading platform that supports 130+ crypto exchanges.
Stars: ✭ 104 (-90.88%)
Mutual labels:  trading, stock, stock-data
Gekko Strategies
Strategies to Gekko trading bot with backtests results and some useful tools.
Stars: ✭ 1,022 (-10.35%)
Mutual labels:  trading, stock, stock-price-prediction
Deep Rl Trading
playing idealized trading games with deep reinforcement learning
Stars: ✭ 228 (-80%)
Mutual labels:  trading, stock, reinforcement-learning
dukascopy-tools
✨ Download historical price tick data for Crypto, Stocks, ETFs, CFDs, Forex via CLI and Node.js ✨
Stars: ✭ 128 (-88.77%)
Mutual labels:  trading, stock, stock-data
TerminalStocks
Pure terminal stock ticker for Windows.
Stars: ✭ 88 (-92.28%)
Mutual labels:  trading, stock, stock-data
stocktwits-sentiment
Stocktwits market sentiment analysis in Python with Keras and TensorFlow.
Stars: ✭ 23 (-97.98%)
Mutual labels:  stock, stock-price-prediction, stock-data
Introneuralnetworks
Introducing neural networks to predict stock prices
Stars: ✭ 486 (-57.37%)
Mutual labels:  trading, stock-price-prediction
Ystockquote
Fetch stock quote data from Yahoo Finance
Stars: ✭ 502 (-55.96%)
Mutual labels:  stock, stock-data
Gym Anytrading
The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
Stars: ✭ 627 (-45%)
Mutual labels:  trading, reinforcement-learning
Machinelearningstocks
Using python and scikit-learn to make stock predictions
Stars: ✭ 897 (-21.32%)
Mutual labels:  trading, stock
Algotrader
Simple algorithmic stock and option trading for Node.js.
Stars: ✭ 468 (-58.95%)
Mutual labels:  trading, stock
Rqalpha
A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
Stars: ✭ 4,425 (+288.16%)
Mutual labels:  trading, stock
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (+565.09%)
Mutual labels:  stock-data, paper
Grs
πŸ“ˆ ε°η£δΈŠεΈ‚δΈŠζ«ƒθ‚‘η₯¨εƒΉζ Όζ“·ε–οΌˆFetch Taiwan Stock Exchange dataοΌ‰ε«ε³ζ™‚η›€γ€ε°η£ζ™‚ι–“θ½‰ζ›γ€ι–‹δΌ‘εΈ‚εˆ€ζ–·γ€‚
Stars: ✭ 405 (-64.47%)
Mutual labels:  stock, stock-data
Tradinggym
Trading and Backtesting environment for training reinforcement learning agent or simple rule base algo.
Stars: ✭ 813 (-28.68%)
Mutual labels:  trading, reinforcement-learning
Learning Deep Learning
Paper reading notes on Deep Learning and Machine Learning
Stars: ✭ 388 (-65.96%)
Mutual labels:  paper, reinforcement-learning
Dl Nlp Readings
My Reading Lists of Deep Learning and Natural Language Processing
Stars: ✭ 656 (-42.46%)
Mutual labels:  paper, reinforcement-learning
Axistradecult
Assist tool for trading on stock market, automatic download historical stock data, technical research, chart and analysis.
Stars: ✭ 26 (-97.72%)
Mutual labels:  trading, stock
Stock Price Trade Analyzer
This is a Python 3.0 project for analyzing stock prices and methods of stock trading. It uses native Python tools and Google TensorFlow machine learning.
Stars: ✭ 35 (-96.93%)
Mutual labels:  stock-data, reinforcement-learning

License Platform Python Docker

Personae - RL & SL Methods and Envs For Quantitative Trading

Personae is a repo that implements papers proposed methods in Deep Reinforcement Learning & Supervised Learning and applies them to Financial Market.

Now Personae includes 4 RL & 3 SL implements and a simulate Financial Market supporting Stock and Future. (Short Sale is still implementing)

More RL & SL methods are updating!

WARNING

This repo is being reconstructing,

It will start from 2018-08-24 to 2018-09-01 a timestamp that I successfully found a job.

Attentions

  • The features as inputs are naive.
  • Day frequency is clearly not enough.
  • It's recommended that you could replace the features here to your own.

Contents

Environment

A basic simulate environment of Financial Market is implemented.

  • Market
    Implement of 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.
    For now, Market support Stock Data and Future Data.

Also, more functions are updating.

Experiments

Total Profits and Baseline Profits. (Test Set)

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

Requirements

Before you start testing, following requirements are needed.

  • Python3.5
  • TensorFlow1.4
  • numpy
  • scipy
  • pandas
  • rqalpha
  • sklearn
  • tushare
  • matplotlib
  • mongoengine
  • CUDA (option)
  • ta-lib (option)
  • Docker (option)
  • PyTorch (option)

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

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/personae, and personae is inherited from ceruleanwang/quant-base.

The image ceruleanwang/quant-base 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 stock or future data, but before you start, you should make sure a mongodb service is running.

If you don't have mongodb service running, you can also use a mongodb container (option) by following code:

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

Then, you can use spiders to crawl stock data by following code:

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

Also, you can crawl future data by following code:

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

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

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

And the default future codes are:

future_codes = ["AU88", "RB88", "CU88", "AL88"]

And they can be modified in:

Then you can just run a model by:

docker run -t -v local_project_dir:docker_project_dir --network=yuor_network ceruleanwang/personae 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.

One thing should be noticed is that the hostname in mongoengine config should be your own.

About training & testing

For now, all models implemented with TensorFlow support persistence. You can edit many parameters when you are training or testing a model.
For example, following codes show some parameters that could be edited.

env = Market(codes, start_date="2008-01-01", end_date="2018-01-01", **{
    "market": market,
    "mix_index_state": True,
    "training_data_ratio": training_data_ratio,
})

algorithm = Algorithm(tf.Session(config=config), env, env.trader.action_space, env.data_dim, **{
    "mode": mode,
    "episodes": episode,
    "enable_saver": True,
    "enable_summary_writer": True,
    "save_path": os.path.join(CHECKPOINTS_DIR, "RL", model_name, market, "model"),
    "summary_path": os.path.join(CHECKPOINTS_DIR, "RL", model_name, market, "summary"),
})

TODO

  • More Implementations of Papers.
  • More High-Frequency Stocks Data.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].