-
Notifications
You must be signed in to change notification settings - Fork 226
/
coinex_test.py
33 lines (21 loc) · 683 Bytes
/
coinex_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from Exchanges.CoinEx import CoinEx
import config
xchg = CoinEx(config.COINEX_API_KEY, config.COINEX_SECRET)
pair = ('DOGE', 'BTC')
base, alt = pair
# tradeable pairs
print(xchg.tradeable_pairs)
# get highest bid
print('Highest bid for %r', pair)
bid = xchg.get_highest_bid(base, alt)
print(bid)
print('Lowest ask:')
ask = xchg.get_lowest_ask(base, alt)
print(ask)
print('Highest bid for reverse: %f' % (xchg.get_highest_bid(alt, base)))
print('Lowest ask for reverse: %f' % (xchg.get_lowest_ask(alt, base)))
print('retrieving orderbook')
book = xchg.get_depth(base, alt)
print(book)
balance = xchg.get_balance('BTC')
print('You have %f BTC in your account' % (balance))