Skip to content

Commit 8ffc2f8

Browse files
committed
Fixed integer division error for Python2 in Yahoo returns calculation.
1 parent b3665e4 commit 8ffc2f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qstrader/price_handler/yahoo_daily_csv_bar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ def _store_event(self, event):
142142
if self.calc_adj_returns:
143143
prev_adj_close = self.tickers[ticker][
144144
"adj_close"
145-
] / PriceParser.PRICE_MULTIPLIER
146-
cur_adj_close = event.adj_close_price / PriceParser.PRICE_MULTIPLIER
145+
] / float(PriceParser.PRICE_MULTIPLIER)
146+
cur_adj_close = event.adj_close_price / float(
147+
PriceParser.PRICE_MULTIPLIER
148+
)
147149
self.tickers[ticker][
148150
"adj_close_ret"
149151
] = cur_adj_close / prev_adj_close - 1.0

0 commit comments

Comments
 (0)