Skip to content

Commit 01f7d47

Browse files
ran SKIP=flake8 pre-commit run --all-files three times
1 parent b017239 commit 01f7d47

File tree

81 files changed

+1214
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1214
-928
lines changed

β€Ž.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
run: bash docker/bin/build_container.sh
1717

1818
- name: Run Tests
19-
run: bash docker/bin/test.sh
19+
run: bash docker/bin/test.sh

β€Ž.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ repos:
2727
- repo: https://github.com/PyCQA/flake8
2828
rev: 4.0.1
2929
hooks:
30-
- id: flake8
30+
- id: flake8

β€Ž.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"makefile.extensionOutputFolder": "./.vscode"
3-
}
3+
}

β€ŽREADME.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# FinRL: Financial Reinforcement Learning [![twitter][1.1]][1] [![facebook][1.2]][2] [![google+][1.3]][3] [![linkedin][1.4]][4]
2-
2+
33
[1.1]: http://www.tensorlet.org/wp-content/uploads/2021/01/button_twitter_22x22.png
44
[1.2]: http://www.tensorlet.org/wp-content/uploads/2021/01/facebook-button_22x22.png
55
[1.3]: http://www.tensorlet.org/wp-content/uploads/2021/01/button_google_22.xx_.png
@@ -20,15 +20,15 @@
2020
![License](https://img.shields.io/github/license/AI4Finance-Foundation/finrl.svg?color=brightgreen)
2121

2222
<div align="center">
23-
<img align="center" src=figs/logo_transparent_background.png width="45%"/>
23+
<img align="center" src=figs/logo_transparent_background.png width="45%"/>
2424
</div>
25-
25+
2626

2727
**FinRL** ([website](https://finrl.readthedocs.io/en/latest/index.html)) is **the first open-source project** to show the great potential of deep reinforcement learning in finance.
2828

29-
The FinRL ecosystem is a unified framework, including various financial markets, state-of-the-art algorithms, financial tasks (portfolio allocation, cryptocurrency trading, high-frequency trading), live trading, etc.
29+
The FinRL ecosystem is a unified framework, including various financial markets, state-of-the-art algorithms, financial tasks (portfolio allocation, cryptocurrency trading, high-frequency trading), live trading, etc.
3030

31-
| Roadmap | Level | Users | Example | Desription |
31+
| Roadmap | Level | Users | Example | Desription |
3232
|----|----|----|----|----|
3333
| 0.0 (Preparation) | preparation | practitioners of financial big data | [FinRL-Meta](https://github.com/AI4Finance-Foundation/FinRL-Metaverse)| a universe of market environments|
3434
| 1.0 (Proof-of-Concept)| entry-level | beginners | [this repo](https://github.com/AI4Finance-Foundation/FinRL) | demonstration, education |
@@ -76,7 +76,7 @@ A video about [FinRL library](http://www.youtube.com/watch?v=ZSGJjtM-5jA) at the
7676

7777
## File Structure
7878

79-
The main folder **finrl** has three subfolders **applications, agents, finrl_meta**.
79+
The main folder **finrl** has three subfolders **applications, agents, finrl_meta**.
8080

8181
We employ a **train-test-trade** pipeline with three files: train.py, test.py, and trade.py.
8282

@@ -107,7 +107,7 @@ FinRL
107107
β”‚ β”œβ”€β”€ train.py
108108
β”‚ β”œβ”€β”€ test.py
109109
β”‚ └── trade.py
110-
β”‚
110+
β”‚
111111
β”œβ”€β”€ tutorial (tutorial notebooks and educational files)
112112
β”œβ”€β”€ unit_testing (make sure verified codes working on env & data)
113113
β”‚ β”œβ”€β”€ test_env
@@ -119,7 +119,7 @@ FinRL
119119
└── README.md
120120
```
121121

122-
## Supported Data Sources
122+
## Supported Data Sources
123123

124124
|Data Source |Type |Range and Frequency |Request Limits|Raw Data|Preprocessed Data|
125125
| ---- | ---- | ---- | ---- | ---- | ---- |
@@ -173,7 +173,7 @@ FinRL
173173

174174
OHLCV: open, high, low, and close prices; volume. adjusted_close: adjusted close price
175175

176-
Technical indicators: 'macd', 'boll_ub', 'boll_lb', 'rsi_30', 'dx_30', 'close_30_sma', 'close_60_sma'. Users also can add new features.
176+
Technical indicators: 'macd', 'boll_ub', 'boll_lb', 'rsi_30', 'dx_30', 'close_30_sma', 'close_60_sma'. Users also can add new features.
177177

178178

179179
## Installation
@@ -187,18 +187,18 @@ Technical indicators: 'macd', 'boll_ub', 'boll_lb', 'rsi_30', 'dx_30', 'close_30
187187
* 2021-08-25
188188
0.3.1: pytorch version with a three-layer architecture, apps (financial tasks), drl_agents (drl algorithms), neo_finrl (gym env)
189189
* 2020-12-14
190-
Upgraded to **Pytorch** with stable-baselines3; Remove tensorflow 1.0 at this moment, under development to support tensorflow 2.0
190+
Upgraded to **Pytorch** with stable-baselines3; Remove tensorflow 1.0 at this moment, under development to support tensorflow 2.0
191191
* 2020-11-27
192192
0.1: Beta version with tensorflow 1.5
193193
</div>
194194
</details>
195195

196196
## Contributions
197197

198-
- FinRL is the first open-source framework to demonstrate the great potential of applying DRL algorithms in quantitative finance. We build an ecosystem around the FinRL framework.
199-
- The application layer provides interfaces for users to customize FinRL to their own trading tasks. Automated backtesting tool and performance metrics are provided to help quantitative traders iterate trading strategies at a high turnover rate. Profitable trading strategies are reproducible and hands-on tutorials are provided in a beginner-friendly fashion. Adjusting the trained models to the rapidly changing markets is also possible.
200-
- The agent layer provides state-of-the-art DRL algorithms that are adapted to finance with fine-tuned hyperparameters. Users can add new DRL algorithms.
201-
- The environment layer includes not only a collection of historical data APIs, but also live trading APIs. They are reconfigured into standard OpenAI gym-style environments. Moreover, it incorporates market frictions and allows users to customize the trading time granularity.
198+
- FinRL is the first open-source framework to demonstrate the great potential of applying DRL algorithms in quantitative finance. We build an ecosystem around the FinRL framework.
199+
- The application layer provides interfaces for users to customize FinRL to their own trading tasks. Automated backtesting tool and performance metrics are provided to help quantitative traders iterate trading strategies at a high turnover rate. Profitable trading strategies are reproducible and hands-on tutorials are provided in a beginner-friendly fashion. Adjusting the trained models to the rapidly changing markets is also possible.
200+
- The agent layer provides state-of-the-art DRL algorithms that are adapted to finance with fine-tuned hyperparameters. Users can add new DRL algorithms.
201+
- The environment layer includes not only a collection of historical data APIs, but also live trading APIs. They are reconfigured into standard OpenAI gym-style environments. Moreover, it incorporates market frictions and allows users to customize the trading time granularity.
202202

203203

204204
## Tutorials
@@ -226,15 +226,15 @@ Technical indicators: 'macd', 'boll_ub', 'boll_lb', 'rsi_30', 'dx_30', 'close_30
226226
## Publications
227227

228228
|Title |Conference |Link|Citations|Year|
229-
| ---- | ---- | ---- | ---- | ---- |
230-
|**FinRL-Meta**: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance| NeurIPS 2021 Data-Centric AI Workshop| paper: https://arxiv.org/abs/2112.06753 ;<br />code: https://github.com/AI4Finance-Foundation/FinRL-Meta| 2| 2021|
231-
|Explainable deep reinforcement learning for portfolio management: An empirical approach| ICAIF 2021 : ACM International Conference on AI in Finance | paper: https://arxiv.org/abs/2111.03995;<br />code: [https://github.com/AI4Finance-Foundation/FinRL](https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_PortfolioAllocation_Explainable_DRL/FinRL_PortfolioAllocation_Explainable_DRL.py)| 1| 2021|
232-
|**FinRL-Podracer**: High performance and scalable deep reinforcement learning for quantitative finance| ICAIF 2021 : ACM International Conference on AI in Finance | paper: https://arxiv.org/abs/2111.05188;<br />code: https://github.com/AI4Finance-Foundation/FinRL_Podracer| 2 | 2021|
233-
|**FinRL**: Deep reinforcement learning framework to automate trading in quantitative finance| ICAIF 2021 : ACM International Conference on AI in Finance | paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3955949;<br />code: https://github.com/AI4Finance-Foundation/FinRL| 7 | 2021|
234-
|**FinRL**: A deep reinforcement learning library for automated stock trading in quantitative finance| NeurIPS 2020 Deep RL Workshop | paper: https://arxiv.org/abs/2011.09607;<br />code: https://github.com/AI4Finance-Foundation/FinRL| 25 | 2020|
235-
|Deep reinforcement learning for automated stock trading: An ensemble strategy| ICAIF 2020 : ACM International Conference on AI in Finance | paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996;<br />repo: https://github.com/AI4Finance-Foundation/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020; <br />code: https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_Ensemble_StockTrading_ICAIF_2020/FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb| 46 | 2020|
236-
|Multi-agent reinforcement learning for liquidation strategy analysis| ICML 2019 Workshop on AI in Finance: Applications and Infrastructure for Multi-Agent Learning| paper: https://arxiv.org/abs/1906.11046; <br />repo: https://github.com/AI4Finance-Foundation/Liquidation-Analysis-using-Multi-Agent-Reinforcement-Learning-ICML-2019; <br />code: https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/execution_optimizing/execution_optimizing.ipynb| 19 | 2019|
237-
|Practical deep reinforcement learning approach for stock trading| NeurIPS 2018 Workshop on Challenges and Opportunities for AI in Financial Services| paper: https://arxiv.org/abs/1811.07522; <br />code: https://github.com/AI4Finance-Foundation/DQN-DDPG_Stock_Trading| 87 | 2018 |
229+
| ---- | ---- | ---- | ---- | ---- |
230+
|**FinRL-Meta**: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance| NeurIPS 2021 Data-Centric AI Workshop| paper: https://arxiv.org/abs/2112.06753 ;<br />code: https://github.com/AI4Finance-Foundation/FinRL-Meta| 2| 2021|
231+
|Explainable deep reinforcement learning for portfolio management: An empirical approach| ICAIF 2021 : ACM International Conference on AI in Finance | paper: https://arxiv.org/abs/2111.03995;<br />code: [https://github.com/AI4Finance-Foundation/FinRL](https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_PortfolioAllocation_Explainable_DRL/FinRL_PortfolioAllocation_Explainable_DRL.py)| 1| 2021|
232+
|**FinRL-Podracer**: High performance and scalable deep reinforcement learning for quantitative finance| ICAIF 2021 : ACM International Conference on AI in Finance | paper: https://arxiv.org/abs/2111.05188;<br />code: https://github.com/AI4Finance-Foundation/FinRL_Podracer| 2 | 2021|
233+
|**FinRL**: Deep reinforcement learning framework to automate trading in quantitative finance| ICAIF 2021 : ACM International Conference on AI in Finance | paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3955949;<br />code: https://github.com/AI4Finance-Foundation/FinRL| 7 | 2021|
234+
|**FinRL**: A deep reinforcement learning library for automated stock trading in quantitative finance| NeurIPS 2020 Deep RL Workshop | paper: https://arxiv.org/abs/2011.09607;<br />code: https://github.com/AI4Finance-Foundation/FinRL| 25 | 2020|
235+
|Deep reinforcement learning for automated stock trading: An ensemble strategy| ICAIF 2020 : ACM International Conference on AI in Finance | paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996;<br />repo: https://github.com/AI4Finance-Foundation/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020; <br />code: https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_Ensemble_StockTrading_ICAIF_2020/FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb| 46 | 2020|
236+
|Multi-agent reinforcement learning for liquidation strategy analysis| ICML 2019 Workshop on AI in Finance: Applications and Infrastructure for Multi-Agent Learning| paper: https://arxiv.org/abs/1906.11046; <br />repo: https://github.com/AI4Finance-Foundation/Liquidation-Analysis-using-Multi-Agent-Reinforcement-Learning-ICML-2019; <br />code: https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/execution_optimizing/execution_optimizing.ipynb| 19 | 2019|
237+
|Practical deep reinforcement learning approach for stock trading| NeurIPS 2018 Workshop on Challenges and Opportunities for AI in Financial Services| paper: https://arxiv.org/abs/1811.07522; <br />code: https://github.com/AI4Finance-Foundation/DQN-DDPG_Stock_Trading| 87 | 2018 |
238238

239239

240240
## News
@@ -273,7 +273,7 @@ Technical indicators: 'macd', 'boll_ub', 'boll_lb', 'rsi_30', 'dx_30', 'close_30
273273
274274
```
275275

276-
We published [FinTech papers](http://tensorlet.org/projects/ai-in-finance/), check [Google Scholar](https://scholar.google.com/citations?view_op=list_works&hl=en&hl=en&user=XsdPXocAAAAJ), resulting in this project. Closely related papers are given in the [list](https://github.com/AI4Finance-Foundation/FinRL/blob/master/tutorials/FinRL_papers.md).
276+
We published [FinTech papers](http://tensorlet.org/projects/ai-in-finance/), check [Google Scholar](https://scholar.google.com/citations?view_op=list_works&hl=en&hl=en&user=XsdPXocAAAAJ), resulting in this project. Closely related papers are given in the [list](https://github.com/AI4Finance-Foundation/FinRL/blob/master/tutorials/FinRL_papers.md).
277277

278278

279279
## Join and Contribute
@@ -298,7 +298,7 @@ Please check [Contributing Guidances](https://github.com/AI4Finance-Foundation/F
298298

299299
### Contributors
300300

301-
Thanks!
301+
Thanks!
302302

303303
<a href="https://github.com/AI4Finance-LLC/FinRL-Library/graphs/contributors">
304304
<img src="https://contrib.rocks/image?repo=AI4Finance-LLC/FinRL-Library" />
@@ -333,4 +333,3 @@ Network: USDT-TRC20
333333
MIT License
334334

335335
**Disclaimer: Nothing herein is financial advice, and NOT a recommendation to trade real money. Please use common sense and always first consult a professional before trading or investing.**
336-

β€Ždocs/.readthdocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
python:
2-
setup_py_install: true
2+
setup_py_install: true

β€Ždocs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ help:
1616
# Catch-all target: route all unknown targets to Sphinx using the new
1717
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1818
%: Makefile
19-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

β€Ždocs/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ goto end
3232
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
3333

3434
:end
35-
popd
35+
popd

β€Ždocs/source/conf.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Configuration file for the Sphinx documentation builder.
43
#
54
# This file does only contain a selection of the most common options. For a
65
# full list see the documentation:
76
# http://www.sphinx-doc.org/en/master/config
8-
97
# -- Path setup --------------------------------------------------------------
10-
118
# If extensions (or modules to document with autodoc) are in another directory,
129
# add these directories to sys.path here. If the directory is relative to the
1310
# documentation root, use os.path.abspath to make it absolute, like shown here.
1411
#
12+
from __future__ import annotations
13+
1514
import os
1615
import sys
1716

@@ -23,14 +22,14 @@
2322

2423
# -- Project information -----------------------------------------------------
2524

26-
project = u"FinRL"
27-
copyright = u"2021, FinRL"
28-
author = u"FinRL"
25+
project = "FinRL"
26+
copyright = "2021, FinRL"
27+
author = "FinRL"
2928

3029
# The short X.Y version
31-
version = u""
30+
version = ""
3231
# The full version, including alpha/beta/rc tags
33-
release = u"0.3.1"
32+
release = "0.3.1"
3433

3534

3635
# -- General configuration ---------------------------------------------------
@@ -48,8 +47,8 @@
4847
"sphinx.ext.viewcode",
4948
"sphinx.ext.githubpages",
5049
"sphinx.ext.autosectionlabel",
51-
'recommonmark', # for including markdown
52-
# 'sphinx_markdown_tables' # Support rendering tables in markdown
50+
"recommonmark", # for including markdown
51+
# 'sphinx_markdown_tables' # Support rendering tables in markdown
5352
]
5453

5554
autodoc_mock_imports = [
@@ -102,8 +101,8 @@
102101
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
103102
html_logo = "./image/logo_transparent_background.png"
104103
html_theme_options = {
105-
'logo_only': True,
106-
'display_version': False,
104+
"logo_only": True,
105+
"display_version": False,
107106
}
108107

109108

@@ -156,15 +155,15 @@
156155
# (source start file, target name, title,
157156
# author, documentclass [howto, manual, or own class]).
158157
latex_documents = [
159-
(master_doc, "FinRL.tex", u"FinRL Documentation", u"FinRL", "manual"),
158+
(master_doc, "FinRL.tex", "FinRL Documentation", "FinRL", "manual"),
160159
]
161160

162161

163162
# -- Options for manual page output ------------------------------------------
164163

165164
# One entry per manual page. List of tuples
166165
# (source start file, name, description, authors, manual section).
167-
man_pages = [(master_doc, "finrl", u"FinRL Documentation", [author], 1)]
166+
man_pages = [(master_doc, "finrl", "FinRL Documentation", [author], 1)]
168167

169168

170169
# -- Options for Texinfo output ----------------------------------------------
@@ -176,7 +175,7 @@
176175
(
177176
master_doc,
178177
"FinRL",
179-
u"FinRL Documentation",
178+
"FinRL Documentation",
180179
author,
181180
"FinRL",
182181
"One line description of project.",

β€Ždocs/source/developer_guide/development_setup.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ For example, we revise FinRL.
7878
cd ./FinRL
7979
git checkout -b branch_xxx
8080
81-
where branch_xxx is a new branch name. In this branch, we revise config.py.
81+
where branch_xxx is a new branch name. In this branch, we revise config.py.
8282

8383

8484
Step 5: Creating Commits and PRs/MRs
@@ -90,8 +90,7 @@ Step 5: Creating Commits and PRs/MRs
9090

9191
.. image:: ../image/pycharm_push_PR.png
9292

93-
-When you do a Git Push, PyCharm will ask you to which of the 3 repos you want to push. Just like the above figure, we select the repo "FinRL".
93+
-When you do a Git Push, PyCharm will ask you to which of the 3 repos you want to push. Just like the above figure, we select the repo "FinRL".
9494

9595

9696
With respect to creating a pull request (PR) or merge quest (MR), please refer to `Create a PR <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`_ or `Opensource Create a PR <https://opensource.com/article/19/7/create-pull-request-github>`_.
97-

β€Ždocs/source/developer_guide/file_architecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ FinRL's file architecture strictly follow the :ref:`three-layer architecture`.
3333
β”‚ β”œβ”€β”€ train.py
3434
β”‚ β”œβ”€β”€ test.py
3535
β”‚ β”œβ”€β”€ trade.py
36-
└───└── plot.py
36+
└───└── plot.py

0 commit comments

Comments
Β (0)