Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bczhang committed Sep 25, 2023
1 parent 1b94d08 commit 5aef16e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ async def _update_positions(self):
data = position
ex_trading_pair = data.get("symbol")
hb_trading_pair = await self.trading_pair_associated_to_exchange_symbol(ex_trading_pair)
amount = self.get_value_of_contracts(hb_trading_pair, int(Decimal(data["currentQty"])))
amount = self.get_value_of_contracts(hb_trading_pair, int(data["currentQty"]))
position_side = PositionSide.SHORT if amount < 0 else PositionSide.LONG
unrealized_pnl = Decimal(str(data["unrealisedPnl"]))
entry_price = Decimal(str(data["avgEntryPrice"]))
Expand Down Expand Up @@ -615,7 +615,7 @@ async def _process_account_position_event(self, position_msg: Dict[str, Any]):
if "changeReason" in position_msg and position_msg["changeReason"] != "markPriceChange":
ex_trading_pair = position_msg["symbol"]
trading_pair = await self.trading_pair_associated_to_exchange_symbol(symbol=ex_trading_pair)
amount = self.get_value_of_contracts(trading_pair, int(Decimal(position_msg["currentQty"])))
amount = self.get_value_of_contracts(trading_pair, int(position_msg["currentQty"]))
position_side = PositionSide.SHORT if amount < 0 else PositionSide.LONG
entry_price = Decimal(str(position_msg["avgEntryPrice"]))
leverage = Decimal(str(position_msg["realLeverage"]))
Expand Down

0 comments on commit 5aef16e

Please sign in to comment.