All Projects → AI4Finance-Foundation → FinRL_Podracer

AI4Finance-Foundation / FinRL_Podracer

Licence: Apache-2.0 license
Cloud-native Financial Reinforcement Learning

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to FinRL Podracer

Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-26.26%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
Tai
A composable, real time, market data and trade execution toolkit. Built with Elixir, runs on the Erlang virtual machine
Stars: ✭ 264 (+47.49%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (+1113.41%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+150.84%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
Quant Finance Resources
Courses, Articles and many more which can help beginners or professionals.
Stars: ✭ 36 (-79.89%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
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 (+4135.75%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
51bitquant
51bitquant Python数字货币量化交易视频 CCXT框架 爬取交易所数据 比特币量化交易 交易机器人51bitquant tradingbot cryptocurrency quantitative trading btc trading
Stars: ✭ 284 (+58.66%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
Zvt
modular quant framework.
Stars: ✭ 1,801 (+906.15%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
Quant Trading
Python quantitative trading strategies including VIX Calculator, Pattern Recognition, Commodity Trading Advisor, Monte Carlo, Options Straddle, Shooting Star, London Breakout, Heikin-Ashi, Pair Trading, RSI, Bollinger Bands, Parabolic SAR, Dual Thrust, Awesome, MACD
Stars: ✭ 2,407 (+1244.69%)
Mutual labels:  quant, quantitative-finance, algorithmic-trading
RL-2018
Reinforcement Learning at UCLA IPAM RIPS 2018
Stars: ✭ 15 (-91.62%)
Mutual labels:  machine-learning-algorithms, openai-gym
Machine Learning And Ai In Trading
Applying Machine Learning and AI Algorithms applied to Trading for better performance and low Std.
Stars: ✭ 258 (+44.13%)
Mutual labels:  machine-learning-algorithms, quantitative-finance
Watermark Remover
Remove watermark automatically(Just can use for fixed position watermark till now). 自动水印消除算法的实现(目前只支持固定水印位置)。
Stars: ✭ 236 (+31.84%)
Mutual labels:  machine-learning-algorithms, deep-reinforcement-learning
datascience-mashup
In this repo I will try to gather all of the projects related to data science with clean datasets and high accuracy models to solve real world problems.
Stars: ✭ 36 (-79.89%)
Mutual labels:  machine-learning-algorithms, deep-reinforcement-learning
Deep Reinforcement Learning Gym
Deep reinforcement learning model implementation in Tensorflow + OpenAI gym
Stars: ✭ 200 (+11.73%)
Mutual labels:  deep-reinforcement-learning, openai-gym
Options Trading Strategies In Python
Developing Options Trading Strategies using Technical Indicators and Quantitative Methods
Stars: ✭ 309 (+72.63%)
Mutual labels:  machine-learning-algorithms, quantitative-finance
Hands On Intelligent Agents With Openai Gym
Code for Hands On Intelligent Agents with OpenAI Gym book to get started and learn to build deep reinforcement learning agents using PyTorch
Stars: ✭ 189 (+5.59%)
Mutual labels:  deep-reinforcement-learning, openai-gym
yarll
Combining deep learning and reinforcement learning.
Stars: ✭ 84 (-53.07%)
Mutual labels:  deep-reinforcement-learning, openai-gym
Deep-Reinforcement-Learning-With-Python
Master classic RL, deep RL, distributional RL, inverse RL, and more using OpenAI Gym and TensorFlow with extensive Math
Stars: ✭ 222 (+24.02%)
Mutual labels:  deep-reinforcement-learning, openai-gym
Finrl Library
FinRL: Financial Reinforcement Learning Framework. Please star. 🔥
Stars: ✭ 3,037 (+1596.65%)
Mutual labels:  deep-reinforcement-learning, openai-gym
Learningx
Deep & Classical Reinforcement Learning + Machine Learning Examples in Python
Stars: ✭ 241 (+34.64%)
Mutual labels:  machine-learning-algorithms, deep-reinforcement-learning

Podracer

News: We are out of hands, please star it and let us know it is urgent to update this project. Thanks for your feedback.

This project can be regarded as FinRL 2.0: intermediate-level framework for full-stack developers and professionals. It is built on ElegantRL and FinRL

We maintain an elegant (lightweight, efficient and stable) FinRL lib, helping researchers and quant traders to develop algorithmic strategies easily.

  • Lightweight: The core codes are less than 800 lines and are based on PyTorch and NumPy.

  • Efficient: Its performance is comparable with Ray RLlib.

  • Stable: It is as stable as Stable Baseline 3.

Design Principles

  • Be Pythonic: Quant traders, data scientists and machine learning engineers are familiar with the open source Python ecosystem: its programming model, and its tools, e.g., NumPy.

  • Put researchers and algorithmic traders first: Based on PyTorch, we support researchers to mannually control the execution of the codes, empowering them to improve the performance over automatical libraries.

  • Lean development of algorithmic strategies: It is better to have an elegant (may be slightly incomplete) solution than a comprehensive but complex and hard to follow design, e.g., Ray RLlib link. It allows fast code iteration.

DRL Algorithms

Currently, most model-free deep reinforcement learning (DRL) algorithms are supported:

  • DDPG, TD3, SAC, A2C, PPO, PPO(GAE) for continuous actions
  • DQN, DoubleDQN, D3QN for discrete actions
  • MILP (learn to cut using natural evolutionay strategy) for portfolio optimization

For DRL algorithms, please check out the educational webpage OpenAI Spinning Up.

File Structure

An agent in agent.py uses networks in net.py and is trained in run.py by interacting with an environment in env.py.

  • net.py # Neural networks.
    • Q-Net,
    • Actor Network,
    • Critic Network,
  • agent.py # RL algorithms.
    • AgentBase
    • AgentDQN
    • AgentDDPG
    • AgentTD3
    • AgentSAC
    • AgentPPO
  • env.py # Stock Trading environment
  • run.py # Stock Trading application
    • Parameter initialization,
    • Training loop,
    • Evaluator.
  • StockTrading_Demo.ipynb # One stock trading demo using PPO algorithm

Formulation of the Stock Trading Problem

Formally, we model stock trading as a Markov Decision Process (MDP), and formulate the trading objective as maximization of expected return:

  • State s = [b, p, h]: a vector that includes the remaining balance b, stock prices p, and stock shares h. p and h are vectors with D dimension, where D denotes the number of stocks.
  • Action a: a vector of actions over D stocks. The allowed actions on each stock include selling, buying, or holding, which result in decreasing, increasing, or no change of the stock shares in h, respectively.
  • Reward r(s, a, s’): The asset value change of taking action a at state s and arriving at new state s’.
  • Policy π(s): The trading strategy at state s, which is a probability distribution over actions at state s.
  • Q-function Q(s, a): the expected return (reward) of taking action a at state s following policy π.
  • State-transition: After taking the actions a, the number of shares h is modified, as shown in Fig 3, and the new portfolio is the summation of the balance and the total value of the stocks.

Stock Trading Environment

Environment Design

The environment is designed in the OpenAI gym-style since it is considered as the standard implementation of reinforcement learning environments.

  • Initialization: the stock data from Yahoo Finance is pre-processed, and the variables related to the stock trading problem are initialized. Before the training, an initialization function is used to create a new environment for interacting with the agent.
  • Reset: the state and variables of the environment are reset to the initial condition. This function is used once the simulation stops and needs to restart.
  • Step: the state takes an action from the agent and then returns a list of three things — the next state, the reward, the indication of whether the current episode is done or not. The way the environment computes the next state and the reward is based on the state-action transition defined in the previous blog. The step function is used when the agent collects the transitions for training usage.

State Space and Action Space

  • State Space: We use a 181-dimensional vector consists of seven parts of information to represent the state space of multiple stocks trading environment: [b, p, h, M, R, C, X], where b is the balance, p is the stock prices, h is the number of shares, M is the Moving Average Convergence Divergence (MACD), R is the Relative Strength Index (RSI), C is the Commodity Channel Index (CCI), and X is the Average Directional Index (ADX).
  • Action Space: As a recap, we have three types of actions: selling, buying, and holding for a single stock. We use the negative value for selling, positive value for buying, and zero for holding. In this case, the action space is defined as {-k, …, -1, 0, 1, …, k}, where k is the maximum share to buy or sell in each transaction.

Easy-to-customize Features

  • Initial_capital: the initial capital that the user wants to invest.
  • Tickers: the stock pool that the user wants to trade with.
  • Initial_stocks: the initial amount of each stock and the default could be zero.
  • buy_cost_pct, sell_cost_pct: the transaction fee of each buying or selling transaction.
  • Max_stock: the user is able to define the maximum number of stocks that are allowed to trade per transaction.
  • tech_indicator_list: the list of financial indicators that are taken into account, which is used to define a state.
  • start_date, start_eval_date, end_eval_date: the training and backtesting time intervals. Thee time dates (or timestamps) are used, once the training period is specified, the rest is backtesting.
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].