Reinforcement Learning for Financial Trading

MATLAB example on how to use Reinforcement Learning for developing a financial trading model
ダウンロード: 1.7K
更新 2024/3/7

Reinforcement Learning For Financial Trading ?
How to use Reinforcement learning for financial trading using Simulated Stock Data using MATLAB.

To run:

Open RL_trading_demo.prj
Open workflow.mlx
Run workflow.mlx
Environment and Reward can be found in: myStepFunction.m


The goal of the Reinforcement Learning agent is simple. Learn how to trade the financial markets without ever losing money.
Note, this is different from learn how to trade the market and make the most money possible.

The aim of this example was to show:

1. What reinforcement learning is
2. How it can be applied to trading the financial markets
3. Leave a starting point for financial professionals to use and enhance using their own domain expertise.

The example use an environment consisting of 3 stocks, $20000 cash & 15 years of historical data.

Stocks are:
Simulated via Geometric Brownian Motion or
Historical Market data (source: AlphaVantage:

Copyright 2020 The MathWorks, Inc.


David Willingham (2024). Reinforcement Learning for Financial Trading (, GitHub. 取得済み .

MATLAB リリースの互換性
作成: R2019b
Windows macOS Linux
Help Center および MATLAB AnswersFinancial Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!


GitHub の既定のブランチを使用するバージョンはダウンロードできません

バージョン 公開済み リリース ノート

Updated Description


Added MATLAB Live script version


この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。
この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。