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

Method parse_ohlcv

python/ccxt/async_support/bitmex.py:1617–1645  ·  view source on GitHub ↗
(self, ohlcv, market: Market = None)

Source from the content-addressed store, hash-verified

1615 }, market)
1616
1617 def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
1618 #
1619 # {
1620 # "timestamp":"2015-09-25T13:38:00.000Z",
1621 # "symbol":"XBTUSD",
1622 # "open":237.45,
1623 # "high":237.45,
1624 # "low":237.45,
1625 # "close":237.45,
1626 # "trades":0,
1627 # "volume":0,
1628 # "vwap":null,
1629 # "lastSize":null,
1630 # "turnover":0,
1631 # "homeNotional":0,
1632 # "foreignNotional":0
1633 # }
1634 #
1635 marketId = self.safe_string(ohlcv, 'symbol')
1636 market = self.safe_market(marketId, market)
1637 volume = self.convert_from_raw_quantity(market['symbol'], self.safe_string(ohlcv, 'volume'))
1638 return [
1639 self.parse8601(self.safe_string(ohlcv, 'timestamp')),
1640 self.safe_number(ohlcv, 'open'),
1641 self.safe_number(ohlcv, 'high'),
1642 self.safe_number(ohlcv, 'low'),
1643 self.safe_number(ohlcv, 'close'),
1644 volume,
1645 ]
1646
1647 async def fetch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
1648 """

Callers

nothing calls this directly

Calls 5

safe_stringMethod · 0.80
safe_numberMethod · 0.80
safe_marketMethod · 0.45
parse8601Method · 0.45

Tested by

no test coverage detected