Multi-day backtesting now supported.

This commit is contained in:
Michael Halls-Moore
2015-06-03 09:23:40 +01:00
parent 17b36c5def
commit 458f263722
4 changed files with 113 additions and 36 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ def create_drawdowns(pnl):
# Loop over the index range
for t in range(1, len(idx)):
hwm.append(max(hwm[t-1], pnl[t]))
drawdown[t]= (hwm[t]-pnl[t])
duration[t]= (0 if drawdown[t] == 0 else duration[t-1]+1)
hwm.append(max(hwm[t-1], pnl.ix[t]))
drawdown.ix[t]= (hwm[t]-pnl.ix[t])
duration.ix[t]= (0 if drawdown.ix[t] == 0 else duration.ix[t-1]+1)
return drawdown, drawdown.max(), duration.max()