FinRL: The indispensable commence-provide mission for monetary reinforcement finding out

Our Mission: to efficiently automate trading. We continuously develop and share codes for finance. Our Vision: AI community has accumulated an open-source code ocean over the past decade. Applying these intellectual and engineering properties to finance will initiate a paradigm shift from the conventional trading routine to an automated machine learning approach, even RLOps in…

FinRL: The indispensable commence-provide mission for monetary reinforcement finding out

Python 3.6
Documentation Status

Our Mission: to effectively automate trading. We continuously have and fragment codes for finance.

Our Vision: AI neighborhood has gathered an commence-provide code ocean over the final decade. Making exercise of these intellectual and engineering properties to finance will provoke a paradigm shift from the dilapidated trading routine to an automated machine finding out skill, even RLOps in finance.

FinRL (web inform) is the principle commence-provide mission to search out the immense seemingly of deep reinforcement finding out in finance. We relieve practitioners pipeline a trading approach the exercise of deep reinforcement finding out (DRL).

The FinRL ecosystem is a unified framework, including a lot of markets, inform-of-the-art work algorithms, monetary duties (portfolio administration, cryptocurrency trading, excessive-frequency trading), live trading, etc.

0.0 (Preparation)preparationpractitioners of enterprise immense knowledgeFinRL-Metaa universe of market environments
1.0 (Proof-of-Opinion)entry-levelbeginnersthis repodemonstration, education
2.0 (Knowledgeable)intermediate-levelfat-stack builders, mavensElegantRLfinancially optimized DRL algorithms
3.0 (Production)come-levelinvestment banks, hedge fundsPodracercloud-native solution



FinRL has three layers: purposes, drl agents, and market environments.

For a trading project (on the head), an agent (in the heart) interacts with an surroundings (on the bottom), making sequential choices.

Bustle FinRL_StockTrading_NeurIPS_2018.ipynb miniature by miniature for a swiftly commence up.

A video about FinRL library on the AI4Finance Youtube Channel.

File Structure

Correspondingly, the principle folder finrl has three subfolders apps, drl_agents, finrl_meta.

We use a put collectively-take a look at-exchange pipeline by three files: put, take a look, and

├── finrl (most indispensable folder)
│   ├── purposes
│   	├── cryptocurrency_trading
│   	├── high_frequency_trading
│   	├── portfolio_allocation
│   	├── stock_trading
│   	└── 
│   ├── agents
│   	├── elegantrl
│   	├── rllib
│   	└── stablebaseline3
│   ├── finrl_meta
│   	├── data_processors
│   	├── env_cryptocurrency_trading
│   	├── env_portfolio_allocation
│   	├── env_stock_trading
│   	├── preprocessor
│   	├──
│   	└──
│   ├──
│   ├──
│   ├── most
│   ├──
│   ├── put
│   ├── take a look
│   └──
├── tutorial (tutorial notebooks and instructional files)
├── unit_testing (be definite that verified codes engaged on env & knowledge)
│   ├── test_env
│   	└──
│   └── test_marketdata
│   	└──
├── requirements.txt

Supported Recordsdata Sources

Recordsdata SupplyFormDiffer and FrequencySeek files from LimitsRaw RecordsdataPreprocessed Recordsdata
AlpacaUS Stocks, ETFs2015-now, 1minFable-particularOHLCVPrices&Indicators
BaostockCN Securities1990-12-19-now, 5minFable-particularOHLCVPrices&Indicators
BinanceCryptocurrencyAPI-particular, 1s, 1minAPI-particularTick-level each day aggegrated trades, OHLCVPrices&Indicators
CCXTCryptocurrencyAPI-particular, 1minAPI-particularOHLCVPrices&Indicators
IEXCloudNMS US securities1970-now, 1 day100 per 2nd per IPOHLCVPrices&Indicators
JoinQuantCN Securities2005-now, 1min3 requests each timeOHLCVPrices&Indicators
QuantConnectUS Securities1998-now, 1sNAOHLCVPrices&Indicators
RiceQuantCN Securities2005-now, 1msFable-particularOHLCVPrices&Indicators
tushareproCN Securities, A fragment-now, 1 minFable-particularOHLCVPrices&Indicators
WRDSUS Securities2003-now, 1ms5 requests each timeIntraday TradesPrices&Indicators
YahooFinanceUS SecuritiesFrequency-particular, 1min2,000/hourOHLCVPrices&Indicators

OHLCV: commence, excessive, low, and shut costs; volume. adjusted_close: adjusted shut assign

Technical indicators: ‘macd’, ‘boll_ub’, ‘boll_lb’, ‘rsi_30’, ‘dx_30’, ‘close_30_sma’, ‘close_60_sma’. Customers moreover can add contemporary aspects.


Jam Update

Version Historic past [click to expand]
  • 2021-08-25
    0.3.1: pytorch version with a 3-layer architecture, apps (monetary duties), drl_agents (drl algorithms), neo_finrl (gym env)
  • 2020-12-14
    Upgraded to Pytorch with receive-baselines3; Plan shut tensorflow 1.0 at this 2nd, beneath pattern to augment tensorflow 2.0
  • 2020-11-27
    0.1: Beta version with tensorflow 1.5


  • FinRL is the principle commence-provide framework to make clear the immense seemingly of applying DRL algorithms in quantitative finance. We have an ecosystem all by the FinRL framework, which seeds the impulsively rising AI4Finance neighborhood.
  • The utility layer offers interfaces for users to customize FinRL to their include trading duties. Automated backtesting tool and efficiency metrics are supplied to relieve quantitative merchants iterate trading systems at a excessive turnover charge. Winning trading systems are reproducible and hands-on tutorials are supplied in a newbie-obliging kind. Adjusting the trained devices to the impulsively altering markets is moreover that you might per chance per chance per chance accept as true with.
  • The agent layer offers inform-of-the-art work DRL algorithms which can per chance be tailored to finance with swish-tuned hyperparameters. Customers can add contemporary DRL algorithms.
  • The environment layer consists of not entirely a sequence of historic knowledge APIs, but moreover live trading APIs. They are reconfigured into traditional OpenAI gym-style environments. Furthermore, it contains market frictions and lets in users to customize the trading time granularity.



Citing FinRL

    creator ={Liu, Xiao-Yang and Yang, Hongyang and Chen, Qian and Zhang, Runjia and Yang, Liuqing and Xiao, Bowen and Wang, Christina Dan},
    title  ={{FinRL}: A deep reinforcement finding out library for automated inventory trading in quantitative finance},
    journal={Deep RL Workshop, NeurIPS 2020},
    Three hundred and sixty five days   ={2020}

    creator ={Liu, Xiao-Yang and Yang, Hongyang and Gao, Jiechao and Wang, Christina Dan},
    title  ={{FinRL}: Deep reinforcement finding out framework to automate trading in quantitative finance},
    journal={ACM Global Convention on AI in Finance (ICAIF)},
    Three hundred and sixty five days   ={2021}

We printed FinTech papers, overview Google Pupil, ensuing on this mission. Carefully linked papers are given in the list.

Join and Make contributions

Welcome to the AI4Finance Basis neighborhood!

Join to communicate about FinRL: AI4Finance mailing list, AI4Finance Slack channel:

Apply us on WeChat:

Please overview Contributing Guidances.




Welcome gift money to augment AI4Finance, a non-profit tutorial neighborhood. Consume the links in the staunch, or scan the following vemo QR code:

Detailed sponsorship files might per chance per chance moreover be found at Field #425


MIT License

Disclaimer: Nothing herein is monetary advice, and NOT a advice to interchange true money. Please exercise general sense and continuously first seek the advice of a legit earlier than trading or investing.

Read More



“Simplicity, patience, compassion.
These three are your greatest treasures.
Simple in actions and thoughts, you return to the source of being.
Patient with both friends and enemies,
you accord with the way things are.
Compassionate toward yourself,
you reconcile all beings in the world.”
― Lao Tzu, Tao Te ChingBio: About: