From 17147329e006859b17120e789310c3c736de02e4 Mon Sep 17 00:00:00 2001 From: camelpac Date: Sat, 19 Jun 2021 20:32:08 +0300 Subject: [PATCH] allow fractional assets --- alpaca_backtrader_api/alpacabroker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpaca_backtrader_api/alpacabroker.py b/alpaca_backtrader_api/alpacabroker.py index 6efafc5d..2a3d781e 100644 --- a/alpaca_backtrader_api/alpacabroker.py +++ b/alpaca_backtrader_api/alpacabroker.py @@ -86,7 +86,7 @@ def update_positions(self): for name, data in iteritems(self.cerebro.datasbyname): if name in broker_positions_symbols: - size = int(broker_positions_mapped_by_symbol[name].qty) + size = float(broker_positions_mapped_by_symbol[name].qty) positions[data] = Position( size, float(broker_positions_mapped_by_symbol[