You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function use pickle format to save the OHLCV data. You will need to import the dataset with ```pd.read_pickle('... .pkl', ...)```. The function supports exchange_names ```binance```, ```biftfinex2``` (API v2) and ```huobi```.
66
+
67
+
51
68
**2 - Create your feature**. Your RL-agent will need some good, preprocessed features. It is your job to make sure it has everything it needs.
52
69
**The feature column names need to contain the keyword 'feature'. The environment will automatically detect them !**
53
70
@@ -72,16 +89,16 @@ The history object is similar to a DataFrame. It uses timestep and/or columns to
72
89
73
90
74
91
Accessible columns of history object :
75
-
-```step```: ...,# Step = t
76
-
-```date```: ...,# Date at step t, datetime
77
-
-```reward```: ..., # Reward at step t
78
-
-```position_index```: ..., # Index of the position at step t amoung your position argument
79
-
-```position``` : ..., # Portfolio position at step t
92
+
-```step``` : Step = t
93
+
-```date``` : Date at step t, datetime
94
+
-```reward``` : Reward at step t
95
+
-```position_index``` : Index of the position at step t amoung your position argument
96
+
-```position``` : Portfolio position at step t
80
97
81
98
*It gathers every data (not used as features) from your DataFrame and labels them with 'data_{column}'. For example :*
82
-
-```data_close```: Close price,
83
-
-```data_open```: Open price,
84
-
-```data_high```:Hight price,
99
+
-```data_close```: Close price,
100
+
-```data_open```: Open price,
101
+
-```data_high``` : High price,
85
102
86
103
*......*
87
104
@@ -91,13 +108,13 @@ Accessible columns of history object :
91
108
*It stores the distribution of the portfolio :*
92
109
-```portfolio_distribution_asset``` : The amount of owned asset (stock),
93
110
-```portfolio_distribution_fiat``` : The amount of owned fiat currency,
94
-
-```portfolio_distribution_borrowed_asset```: The amount of borrowed asset,
95
-
-```portfolio_distribution_borrowed_fiat```: The amount of borrowed fiat currency,
96
-
-```portfolio_distribution_interest_asset```: The total of cumalated interest generated by the borrowed asset.
97
-
-```portfolio_distribution_interest_fiat```: The total of cumalated interest generated by the borrowed fiat currency.
111
+
-```portfolio_distribution_borrowed_asset```: The amount of borrowed asset,
112
+
-```portfolio_distribution_borrowed_fiat```: The amount of borrowed fiat currency,
113
+
-```portfolio_distribution_interest_asset```: The total of cumalated interest generated by the borrowed asset.
114
+
-```portfolio_distribution_interest_fiat```: The total of cumalated interest generated by the borrowed fiat currency.
98
115
99
116
100
-
**4 - Create the environment**
117
+
**4 - Initiate the environment**
101
118
102
119
```python
103
120
env = TradingEnv(...)
@@ -140,60 +157,52 @@ First, you need to save your results at the end of every episode you want to ren
140
157
141
158
```python
142
159
...
143
-
# At the end of episode you want to render
160
+
# At the end of the episode you want to render
144
161
env.save_for_render(dir="render_logs")
145
162
```
146
163
147
164
Then in the separated render script. You can import and initiate a render object, and run the render in a localhost web app :
-```function``` : The function used to compute the line. The function must take an argument ```df``` which is a DateFrame and return a Series, 1D-Array or list.
191
-
-```scatter_args``` : Paramaters added to the go.Scatter object during the process. It can be used to customize your plots. The [documentation of the go.Scatter object](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Scatter.html) might help you.
197
+
```.add_line``` takes arguments :
198
+
-```name```(*required*): The name of the scatter
199
+
-```function```(*required*): The function used to compute the line. The function must take an argument ```df``` which is a DateFrame and return a Series, 1D-Array or list.
200
+
-```line_options``` : Can contain a dict with keys ```color``` and ```width```
192
201
193
202
194
203
```.add_metric``` takes arguments :
195
204
-```name``` : The name of the metric
196
-
-```function``` : The function used to compute the line. The function must take an argument ```df``` which is a DateFrame and return a scalar.
205
+
-```function``` : The function used to compute the line. The function must take an argument ```df``` which is a DateFrame and return a **string** !
0 commit comments