mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
- [Poloniex Fetch Order Books](./examples/py/)
|
||||
|
||||
|
||||
```python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
import ccxt # noqa: E402
|
||||
|
||||
id = 'poloniex'
|
||||
|
||||
# instantiate the exchange by id
|
||||
exchange = getattr(ccxt, id)({
|
||||
# 'proxy':'https://cors-anywhere.herokuapp.com/',
|
||||
})
|
||||
|
||||
# load all markets from the exchange
|
||||
markets = exchange.load_markets()
|
||||
|
||||
# this will work (a limited number of symbols)
|
||||
result = exchange.fetch_order_books(['ETH/BTC', 'LTC/BTC'])
|
||||
pprint(result)
|
||||
|
||||
# this will also work (a limited number of symbols)
|
||||
result = exchange.fetch_order_books(exchange.symbols[0:10])
|
||||
pprint(result)
|
||||
|
||||
# this will not work (too many symbols)
|
||||
result = exchange.fetch_order_books(exchange.symbols)
|
||||
pprint(result)
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user