fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market https://doc.xt.com/#market10ticker24h https://doc.xt.com/#futures_quotesgetAggTickers :param str [symbols]: unified symbols of th
(self, symbols: Strings = None, params={})
| 1671 | return self.parse_ticker(ticker, market) |
| 1672 | |
| 1673 | def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers: |
| 1674 | """ |
| 1675 | fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market |
| 1676 | |
| 1677 | https://doc.xt.com/#market10ticker24h |
| 1678 | https://doc.xt.com/#futures_quotesgetAggTickers |
| 1679 | |
| 1680 | :param str [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| 1681 | :param dict params: extra parameters specific to the xt api endpoint |
| 1682 | :returns dict: an array of `ticker structures <https://docs.ccxt.com/en/latest/manual.html#ticker-structure>` |
| 1683 | """ |
| 1684 | self.load_markets() |
| 1685 | market = None |
| 1686 | if symbols is not None: |
| 1687 | symbols = self.market_symbols(symbols) |
| 1688 | market = self.market(symbols[0]) |
| 1689 | request = {} |
| 1690 | type = None |
| 1691 | subType = None |
| 1692 | response = None |
| 1693 | type, params = self.handle_market_type_and_params('fetchTickers', market, params) |
| 1694 | subType, params = self.handle_sub_type_and_params('fetchTickers', market, params) |
| 1695 | if subType == 'inverse': |
| 1696 | response = self.publicInverseGetFutureMarketV1PublicQAggTickers(self.extend(request, params)) |
| 1697 | elif (subType == 'linear') or (type == 'swap') or (type == 'future'): |
| 1698 | response = self.publicLinearGetFutureMarketV1PublicQAggTickers(self.extend(request, params)) |
| 1699 | else: |
| 1700 | response = self.publicSpotGetTicker24h(self.extend(request, params)) |
| 1701 | # |
| 1702 | # spot |
| 1703 | # |
| 1704 | # { |
| 1705 | # "rc": 0, |
| 1706 | # "mc": "SUCCESS", |
| 1707 | # "ma": [], |
| 1708 | # "result": [ |
| 1709 | # { |
| 1710 | # "s": "btc_usdt", |
| 1711 | # "t": 1678172693931, |
| 1712 | # "cv": "34.00", |
| 1713 | # "cr": "0.0015", |
| 1714 | # "o": "22398.05", |
| 1715 | # "l": "22323.72", |
| 1716 | # "h": "22600.50", |
| 1717 | # "c": "22432.05", |
| 1718 | # "q": "7962.256931", |
| 1719 | # "v": "178675209.47416856" |
| 1720 | # } |
| 1721 | # ] |
| 1722 | # } |
| 1723 | # |
| 1724 | # swap and future |
| 1725 | # |
| 1726 | # { |
| 1727 | # "returnCode": 0, |
| 1728 | # "msgInfo": "success", |
| 1729 | # "error": null, |
| 1730 | # "result": [ |
no test coverage detected