From e2708e5369c7eac6ccdc39755d29b1217626548b Mon Sep 17 00:00:00 2001 From: Liming Xie Date: Mon, 24 May 2021 01:26:46 +0800 Subject: [PATCH] bugfix AIExample, unfortunately, close of today has been used to calculate, so we cannot earn return of today --- examples/AIExample.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/AIExample.ipynb b/examples/AIExample.ipynb index 0797c82a..b21826cb 100644 --- a/examples/AIExample.ipynb +++ b/examples/AIExample.ipynb @@ -1077,7 +1077,7 @@ } ], "source": [ - "asset[\"ACTRET_1\"] = trendy.TS_Trends * asset.PCTRET_1\n", + "asset[\"ACTRET_1\"] = trendy.TS_Trends.shift(1) * asset.PCTRET_1\n", "asset[[\"PCTRET_1\", \"ACTRET_1\"]].plot(figsize=(16, 3), color=colors(\"GyOr\"), alpha=1, grid=True).axhline(0, color=\"black\")" ] },