From 3e8e8650a751a69c0c978223b8c0ed1b76ee5030 Mon Sep 17 00:00:00 2001 From: Kai Su Date: Fri, 23 Nov 2018 13:25:03 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20=20=20fix:=20TypeError:=20uns?= =?UTF-8?q?upported=20operand=20type(s)=20for=20*=3D:=20'Timestamp'=20and?= =?UTF-8?q?=20'float'=20#2371=20=09modify=EF=BC=9A=20=20=20=20=20zipline/d?= =?UTF-8?q?ata/data=5Fportal.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zipline/data/data_portal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zipline/data/data_portal.py b/zipline/data/data_portal.py index ae4bec05c9..a7c827c624 100644 --- a/zipline/data/data_portal.py +++ b/zipline/data/data_portal.py @@ -684,7 +684,8 @@ def get_adjusted_value(self, asset, field, dt, if isinstance(asset, Equity): ratio = self.get_adjustments(asset, field, dt, perspective_dt)[0] - spot_value *= ratio + if field != 'last_traded': + spot_value *= ratio return spot_value