Merge branch 'master' of github.com:wassname/rl-portfolio-management

This commit is contained in:
wassname
2018-02-18 11:57:58 +08:00
3 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
Attempting to replicate "A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem" by [Jiang et. al. 2017](https://arxiv.org/abs/1706.10059) [1].
**note the authors have put [the official code for the paper up](https://github.com/ZhengyaoJiang/PGPortfolio)**
**Note: the papers authors have put [the official code for the paper up and it works well](https://github.com/ZhengyaoJiang/PGPortfolio)**
tl;dr I managed to get 8% growth on training data, but it disapeared on test data. However, RL papers can be very difficult to replicate due to bugs, framework differences, and hyperparameter sensistivity.
tl;dr I managed to get 8% growth on training data, but it disapeared on test data. However, RL papers can be very difficult to replicate due to bugs, framework differences, and hyperparameter sensistivity.
# About
+1 -1
View File
@@ -3,7 +3,7 @@
gym==0.9.3
tensorflow-gpu==1.3.0
h5py==2.7.0
# tensorforce 0.3.5.2 a specific commit
# tensorforce 0.3.5.1 a specific commit
https://github.com/reinforceio/tensorforce/archive/4b5741d2088869e7f8f40c354bd63762c8d62833.zip
# numbers
tables==3.4.2
+11 -6
View File
@@ -6,12 +6,17 @@ def sharpe(returns, freq=30, rfr=0.0):
return (np.sqrt(freq) * np.mean(returns - rfr)) / (np.std(returns - rfr) + eps)
def MDD(returns):
"""Max drawdown."""
peak = returns.max()
i = returns.argmax()
trough = returns[i:].min()
return (trough - peak) / trough
def MDD(X):
"""By nicktids, see issue 15."""
mdd = 0
peak = X[0]
for x in X:
if x > peak:
peak = x
dd = (peak - x) / peak
if dd > mdd:
mdd = dd
return mdd
def softmax(w, t=1.0):