forked from AI4Finance-Foundation/FinRL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add homegrown example Stock NeurIPS2018
- Loading branch information
Showing
4 changed files
with
3,471 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
We show a workflow of applying RL in algorithmic trading, which is a reproduction and improvement of the process in the [NeurIPS 2018 paper](https://arxiv.org/abs/1811.07522). | ||
|
||
# Usage | ||
|
||
## Step I. Data | ||
|
||
First, run the notebook: *Stock_NeurIPS2018_1_Data.ipynb*. | ||
|
||
It downloads and preprocesses stocks' OHLCV data. | ||
|
||
It generates two csv files: *train.csv*, *trade.csv*. You can check the provided two sample files. | ||
|
||
## Step II. Train a Trading Agent | ||
|
||
Second, run the notebook: *Stock_NeurIPS2018_2_Train.ipynb*. | ||
|
||
It shows how to process the data into an OpenAI gym-style envrionment, and then train a DRL agent. | ||
|
||
It will generate a trained RL model .zip file. Here, we also provided a training A2C model in .zip file. | ||
|
||
## Step III. Backtest | ||
|
||
Finally, run the notebook: *Stock_NeurIPS2018_3_Backtest.ipynb*. | ||
|
||
It backtests the trained agent and compares with two baselines: Mean-Variance Optimization and the market DJIA index, respectively. | ||
|
||
At the end, it will plot a figure of the portfolio value during the backtest process. |
Oops, something went wrong.