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

Method parse_long_short_ratio

python/ccxt/bybit.py:9060–9080  ·  view source on GitHub ↗
(self, info: dict, market: Market = None)

Source from the content-addressed store, hash-verified

9058 return self.parse_long_short_ratio_history(data, market)
9059
9060 def parse_long_short_ratio(self, info: dict, market: Market = None) -> LongShortRatio:
9061 #
9062 # {
9063 # "symbol": "BTCUSDT",
9064 # "buyRatio": "0.5707",
9065 # "sellRatio": "0.4293",
9066 # "timestamp": "1729123200000"
9067 # }
9068 #
9069 marketId = self.safe_string(info, 'symbol')
9070 timestamp = self.safe_integer_omit_zero(info, 'timestamp')
9071 longString = self.safe_string(info, 'buyRatio')
9072 shortString = self.safe_string(info, 'sellRatio')
9073 return {
9074 'info': info,
9075 'symbol': self.safe_symbol(marketId, market, None, 'contract'),
9076 'timestamp': timestamp,
9077 'datetime': self.iso8601(timestamp),
9078 'timeframe': None,
9079 'longShortRatio': self.parse_to_numeric(Precise.string_div(longString, shortString)),
9080 }
9081
9082 def fetch_positions_adl_rank(self, symbols: Strings = None, params={}) -> List[ADL]:
9083 """

Callers

nothing calls this directly

Calls 6

safe_stringMethod · 0.80
safe_symbolMethod · 0.80
parse_to_numericMethod · 0.80
string_divMethod · 0.80
iso8601Method · 0.45

Tested by

no test coverage detected