From 57bcbcbd8568a6e1ddb5b6e08b0e08714ce230c6 Mon Sep 17 00:00:00 2001 From: Andrew Campbell Date: Sat, 21 Nov 2015 17:15:30 -0500 Subject: [PATCH] int division bug in roundtrips --- pyfolio/round_trips.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfolio/round_trips.py b/pyfolio/round_trips.py index 9bc3e043..63154b80 100644 --- a/pyfolio/round_trips.py +++ b/pyfolio/round_trips.py @@ -87,7 +87,7 @@ def extract_round_trips(transactions): if invested == 0: round_trips['returns'].append(0) else: - round_trips['returns'].append(pnl / invested) + round_trips['returns'].append(1. * pnl / invested) if len(round_trips) == 0: return pd.DataFrame([])