mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-10 12:00:15 +08:00
BUG: for issue #237, checking considering open orders when verifying the exchange balance for each positions
This commit is contained in:
@@ -631,8 +631,6 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
|
||||
if base_currency is None:
|
||||
base_currency = exchange.base_currency
|
||||
|
||||
# Don't check the cash if there are open orders. This could
|
||||
# results in false positives.
|
||||
orders = []
|
||||
for asset in self.blotter.open_orders:
|
||||
asset_orders = self.blotter.open_orders[asset]
|
||||
@@ -642,6 +640,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
|
||||
required_cash = self.portfolio.cash if not orders else None
|
||||
cash, positions_value = exchange.sync_positions(
|
||||
positions=exchange_positions,
|
||||
open_orders=orders,
|
||||
check_balances=check_balances,
|
||||
cash=required_cash,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user