MCPcopy Create free account
hub / github.com/ccxt/ccxt / parse_position

Method parse_position

python/ccxt/kucoin.py:9793–9960  ·  view source on GitHub ↗
(self, position: dict, market: Market = None)

Source from the content-addressed store, hash-verified

9791 return self.parse_positions(items, symbols)
9792
9793 def parse_position(self, position: dict, market: Market = None):
9794 #
9795 # {
9796 # "code": "200000",
9797 # "data": [
9798 # {
9799 # "id": "615ba79f83a3410001cde321", # Position ID
9800 # "symbol": "ETHUSDTM", # Symbol
9801 # "autoDeposit": False, # Auto deposit margin or not
9802 # "maintMarginReq": 0.005, # Maintenance margin requirement
9803 # "riskLimit": 1000000, # Risk limit
9804 # "realLeverage": 25.92, # Leverage of the order
9805 # "crossMode": False, # Cross mode or not
9806 # "delevPercentage": 0.76, # ADL ranking percentile
9807 # "openingTimestamp": 1638578546031, # Open time
9808 # "currentTimestamp": 1638578563580, # Current timestamp
9809 # "currentQty": 2, # Current postion quantity
9810 # "currentCost": 83.787, # Current postion value
9811 # "currentComm": 0.0167574, # Current commission
9812 # "unrealisedCost": 83.787, # Unrealised value
9813 # "realisedGrossCost": 0.0, # Accumulated realised gross profit value
9814 # "realisedCost": 0.0167574, # Current realised position value
9815 # "isOpen": True, # Opened position or not
9816 # "markPrice": 4183.38, # Mark price
9817 # "markValue": 83.6676, # Mark value
9818 # "posCost": 83.787, # Position value
9819 # "posCross": 0.0, # added margin
9820 # "posInit": 3.35148, # Leverage margin
9821 # "posComm": 0.05228309, # Bankruptcy cost
9822 # "posLoss": 0.0, # Funding fees paid out
9823 # "posMargin": 3.40376309, # Position margin
9824 # "posMaint": 0.50707892, # Maintenance margin
9825 # "maintMargin": 3.28436309, # Position margin
9826 # "realisedGrossPnl": 0.0, # Accumulated realised gross profit value
9827 # "realisedPnl": -0.0167574, # Realised profit and loss
9828 # "unrealisedPnl": -0.1194, # Unrealised profit and loss
9829 # "unrealisedPnlPcnt": -0.0014, # Profit-loss ratio of the position
9830 # "unrealisedRoePcnt": -0.0356, # Rate of return on investment
9831 # "avgEntryPrice": 4189.35, # Average entry price
9832 # "liquidationPrice": 4044.55, # Liquidation price
9833 # "bankruptPrice": 4021.75, # Bankruptcy price
9834 # "settleCurrency": "USDT", # Currency used to clear and settle the trades
9835 # "isInverse": False
9836 # }
9837 # ]
9838 # }
9839 # position history
9840 # {
9841 # "closeId": "300000000000000030",
9842 # "positionId": "300000000000000009",
9843 # "uid": 99996908309485,
9844 # "userId": "6527d4fc8c7f3d0001f40f5f",
9845 # "symbol": "XBTUSDM",
9846 # "settleCurrency": "XBT",
9847 # "leverage": "0.0",
9848 # "type": "LIQUID_LONG",
9849 # "side": null,
9850 # "closeSize": null,

Callers 1

fetch_positionMethod · 0.95

Calls 15

safe_stringMethod · 0.80
safe_integerMethod · 0.80
safe_integer_productMethod · 0.80
safe_string_nMethod · 0.80
safe_string_lowerMethod · 0.80
string_gtMethod · 0.80
string_ltMethod · 0.80
findMethod · 0.80
string_absMethod · 0.80
safe_string_2Method · 0.80
string_divMethod · 0.80
safe_valueMethod · 0.80

Tested by

no test coverage detected