-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathticker.py
52 lines (38 loc) · 2 KB
/
ticker.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from bitcoinaverage import RestfulClient
if __name__ == '__main__':
secret_key = '' or input('Enter your secret key: ')
public_key = '' or input('Enter your public key: ')
restful_client = RestfulClient(public_key, secret_key)
ticker_all_local = restful_client.ticker_all_local(crypto='LTC', fiat='GBP')
print('ticker all local')
print(ticker_all_local)
ticker_all_global = restful_client.ticker_all_global(crypto='BTC', fiat='USD,EUR')
print('ticker all global')
print(ticker_all_global)
ticker_local_per_symbol = restful_client.ticker_local_per_symbol('BTCUSD')
print('Local Ticker for BTCUSD')
print(ticker_local_per_symbol)
ticker_global_per_symbol = restful_client.ticker_global_per_symbol('BTCUSD')
print('Global Ticker for BTCUSD')
print(ticker_global_per_symbol)
ticker_short_local = restful_client.ticker_short_local()
print('Local Ticker Short')
print(ticker_short_local)
ticker_short_global = restful_client.ticker_short_global()
print('Global Ticker Short')
print(ticker_short_global)
print('Generate price index for BTCUSD based only on the data from Bitstamp and Kraken')
ticker_custom_include = restful_client.ticker_custom_include('BTCUSD', 'bitstamp,kraken')
print(ticker_custom_include)
print('Generate price index for BTCUSD based on the data from all exchanges except Bitstamp and Kraken')
ticker_custom_exclude = restful_client.ticker_custom_exclude('BTCUSD', 'bitstamp,kraken')
print(ticker_custom_exclude)
ticker_changes_all_local = restful_client.ticker_changes_all_local()
print('Local Ticker values with changes')
print(ticker_changes_all_local)
ticker_changes_local_btcusd = restful_client.ticker_changes_local('BTCUSD')
print('Ticker including changes (for BTCUSD):')
print(ticker_changes_local_btcusd)
ticker_changes_global_btceur = restful_client.ticker_changes_global('BTCEUR')
print('Ticker including changes (for BTCEUR):')
print(ticker_changes_global_btceur)