GitPedia

TradeMaster

TradeMaster is an open-source platform for quantitative trading empowered by reinforcement learning :fire: :zap: :rainbow:

From TradeMaster-NTU·Updated June 17, 2026·View on GitHub·

*** TradeMaster is a first-of-its kind, best-in-class __open-source platform__ for __quantitative trading (QT)__ empowered by __reinforcement learning (RL)__, which covers the __full pipeline__ for the design, implementation, evaluation and deployment of RL-based algorithms. The project is written primarily in Jupyter Notebook, distributed under the Apache License 2.0 license, first published in 2022. It has gained significant community traction with 2,781 stars and 526 forks on GitHub. Key topics include: finance, fintech, investment-strategies, jupyter-notebook, machine-learning.

Latest release: v1.0.0
March 5, 2023View Changelog →

TradeMaster: An RL Platform for Trading

<div align="center"> <img align="center" src=https://github.com/TradeMaster-NTU/TradeMaster/blob/main/figure/Logo.png width="25%"/> <div>&nbsp;</div>

Python 3.9
Platform
License
Document
GitHub stars

</div>

TradeMaster is a first-of-its kind, best-in-class open-source platform for quantitative trading (QT) empowered by reinforcement learning (RL), which covers the full pipeline for the design, implementation, evaluation and deployment of RL-based algorithms.

:octocat: Hiring: multiple fully-funded PhD and RA positions are available under the supervision of Dr. Sun Shuo (first author of TradeMaster paper) at HKUST(GZ). Please send him an email if you are interested!

:star: What's NEW! :alarm_clock:

UpdateStatus
Add EarnHFT, Market-GAN and MacroHFT:hammer: Updated on 25 Feb 2025
Add FinAgent and EarnMore:hammer: Updated on 29 Oct 2024
Update TradeMaster Website (Market Simualtor):hammer: Updated on 21 Sep 2023
Update TradeMaster Website (Market Dynamics Modeling Tool):wrench: Updated on 7 July 2023
Support automatic feature generation and selection:hammer: Update tutorial on 11 May 2023
Release TradeMaster Python package:whale: Updated on 11 May 2023
Build TradeMaster website:whale: Available at here on 23 April
Write TradeMaster software documentation:speech_balloon: Updated on 11 April 2023
Release Colab version:speech_balloon: Updated on 29 March 2023
Incldue HK Stock and Future datasets:compass: Updated #131 #132 on 27 March 2023
Support Alpha158:hammer: Updated #123 #124 on 20 March 2023
Release TradeMaster 1.0.0:octocat: Released v1.0.0 on 5 March 2023

Outline

Overview

<div align="center"> <img align="center" src=https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/architecture.jpg width="97%"/> </div> <br>

TradeMaster is composed of 6 key modules: 1) multi-modality market data of different financial assets at multiple granularity; 2) whole data preprocessing pipeline; 3) a series of high-fidelity data-driven market simulators for mainstream QT tasks; 4) efficient implementations of over 13 novel RL-based trading algorithms; 5) systematic evaluation toolkits with 6 axes and 17 measures; 6) different interfaces for interdisciplinary users.

Installation

Here are the installation tutorials for different operating systems and docker:

Tutorial

We provide tutorials covering core features of TradeMaster for users to get start with.

AlgorithmDatasetMarketTaskCode Link
EIIEDJ 30US StockPortfolio Managementtutorial
DeepScalperBTCCryptoIntraday Tradingtutorial
SARLDJ 30US StockPortfolio Managementtutorial
PPOSSE 50China StockPortfolio Managementtutorial
ETEOBitcoinCryptoOrder Executiontutorial
Double DQNBitcoinCryptoHigh Frequency Tradingtutorial

We also provide a colab version of these tutorials that can be run directly. (colab tutorial)

Useful Script

TradeMaster Sandbox

Dataset

DatasetData SourceTypeRange and FrequencyRaw DataDatasheet
S&P500YahooUS Stock2000/01/01-2022/01/01, 1dayOHLCVSP500
DJ30YahooUS Stock2012/01/01-2021/12/31, 1dayOHLCVDJ30
BTCKaggleForeign Exchange2000/01/01-2019/12/31, 1dayOHLCVFX
CryptoKaggleCrypto2013/04/29-2021/07/06, 1dayOHLCVCrypto
SSE50YahooChina Stock2009/01/02-2021/01/01, 1dayOHLCVSSE50
BitcoinBinanceCrypto2021/04/07-2021/04/19, 1minLOBBinance
FutureAKshareFuture2023/03/07-2023/03/28, 5minOHLCVFuture
HS30AKShareHK Stock1988/12/30-2023/03/27, 1dayOHLCVHS30

Dates are in YY/MM/DD format.

OHLCV: open, high, low, and close prices; volume: corresponding trading volume; LOB: Limit order book.

Users can download data of the above datasets from Google Drive or Baidu Cloud (extraction code:x24b)

Model Zoo

TradeMaster provides efficient implementations of the following algorithms:

DeepScalper based on Pytorch (Shuo Sun et al, CIKM 22)

OPD based on Pytorch (Fang et al, AAAI 21)

DeepTrader based on Pytorch (Wang et al, AAAI 21)

SARL based on Pytorch (Yunan Ye et al, AAAI 20)

ETEO based on Pytorch (Lin et al, 20)

Investor-Imitator based on Pytorch (Yi Ding et al, KDD 18)

EIIE based on Pytorch (Jiang et al, 17)

Classic RL based on Pytorch and Ray:
PPO A2C Rainbow SAC DDPG DQN PG TD3

Visualization Toolkit

TradeMaster provides many visualization toolkits for a systematic evaluation of RL-based quantitative trading methods. Please check this paper and repository for details. Some examples are as follows:

PRIDE-Star is a star plot containing normalized score of 8 key financial measures such total return (TR) and Sharpe ratio (SR) to evaluate profitability,risk-control and diversity:

<table align="center"> <tr> <td ><center><img src="https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/visualization/A2C.jpg" width="95%" /> </center></td> <td ><center><img src="https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/visualization/DeepTrader.jpg" width="95%" /> </center></td> <td ><center><img src="https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/visualization/PPO.jpg" width="95%" /> </center></td> <td ><center><img src="https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/visualization/EIIE.jpg" width="95%" /> </center></td> </tr> </table> <div align="left"> <img align="center" src=https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/visualization/plot1.jpg width="100%"/> </div> <br> <div align="left"> <img align="center" src=https://github.com/TradeMaster-NTU/TradeMaster/blob/1.0.0/figure/visualization/plot2.jpg width="100%"/> </div> <br>

File Structure

| TradeMaster
| ├── configs
| ├── data
| │   ├── algorithmic_trading 
| │   ├── high_frequency_trading  
| │   ├── order_excution          
| │   └── porfolio_management
| ├── deploy
| │   ├── backend_client.py
| │   ├── backend_client_test.py 
| │   └── backend_service.py        
| │   ├── backend_service_test.py  
| ├── docs
| ├── figure
| ├── installation
| │   ├── docker.md
| │   ├── requirements.md
| ├── tools
| │   ├── algorithmic_trading          
| │   ├── data_preprocessor
| │   ├── high_frequency_trading
| │   ├── market_dynamics_labeling
| │   ├── missing_value_imputation  
| │   ├── order_excution  
| │   ├── porfolio_management  
| │   ├── __init__.py      
| ├── tradmaster       
| │   ├── agents   
| │   ├── datasets 
| │   ├── enviornments 
| │   ├── evaluation 
| │   ├── imputation 
| │   ├── losses
| │   ├── nets
| │   ├── preprocessor
| │   ├── optimizers
| │   ├── pretrained
| │   ├── trainers
| │   ├── transition
| │   ├── utils
| │   └── __init__.py     
| ├── unit_testing
| ├── Dockerfile
| ├── LICENSE
| ├── README.md
| ├── pyproject.toml
| └── requirements.txt

Publications

A multimodal foundation agent for financial trading: Tool-augmented, diversified, and generalist (KDD 2024)

MacroHFT: Memory augmented context-aware reinforcement learning on high frequency trading (KDD 2024)

Reinforcement learning with maskable stock representation for portfolio management in customizable stock pools (WWW 2024)

EarnHFT: Efficient hierarchical reinforcement learning for high frequency trading (AAAI 2024)

Market-GAN: Adding control to financial market data generation with semantic context (AAAI 2024)

TradeMaster: A holistic quantitative trading platform empowered by reinforcement learning (NeurIPS 2023)

Mastering stock markets with efficient mixture of diversified trading experts (KDD 2023)

PRUDEX-Compass: Towards Systematic Evaluation of Reinforcement Learning in Financial Markets (Transactions on Machine learning Research 2023)

Reinforcement Learning for Quantitative Trading (Survey) (ACM Transactions on Intelligent Systems and Technology 2023)

Deep Reinforcement Learning for Quantitative Trading: Challenges and Opportunities (IEEE Intelligent Systems 2022)

DeepScalper: A Risk-Aware Reinforcement Learning Framework to Capture Fleeting Intraday Trading Opportunities (CIKM 2022)

Commission Fee is not Enough: A Hierarchical Reinforced Framework for Portfolio Management (AAAI 21)

News

Team

  • This repository is developed and maintained by AMI group at Nanyang Technological University.
  • We have positions for software engineer, research associate and postdoc. If you are interested in working at the intersection of RL and quantitative trading, feel free to send us an email with your CV.

Competition

TradeMaster Cup 2022

Contact Us

If you have any further questions of this project, please contact TradeMaster.NTU@gmail.com

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from TradeMaster-NTU/TradeMaster via the GitHub API.Last fetched: 6/17/2026