1+ from datetime import datetime , timezone
12from python_bitvavo_api .bitvavo import Bitvavo
2- import sys
3- import signal
43import time
54import json
65
@@ -48,10 +47,12 @@ def testREST(bitvavo):
4847 # print(json.dumps(trade, indent=2))
4948
5049 # Timestamp: candle[0], open: candle[1], high: candle[2], low: candle[3], close: candle[4], volume: candle[5]
51- # response = bitvavo.candles('BTC-EUR', '1h', {})
52- # for candle in response:
53- # print(json.dumps(candle, indent=2))
54-
50+ # candles = bitvavo.candles('BTC-EUR', '15m')
51+ # candles = bitvavo.candles('BTC-EUR', '15m', limit=10)
52+ # candles = bitvavo.candles('BTC-EUR', '15m', start=datetime(year=2024, month=1, day=1, hour=0, tzinfo=timezone.utc), end=datetime(year=2024, month=1, day=1, hour=1, tzinfo=timezone.utc))
53+ # for candle in candles:
54+ # print('Timestamp', candle[0], ' open', candle[1], ' high', candle[2], ' low', candle[3], ' close', candle[4], ' volume', candle[5])
55+
5556 # response = bitvavo.tickerPrice({})
5657 # print(json.dumps(response, indent=2))
5758
@@ -115,7 +116,7 @@ def testREST(bitvavo):
115116 # for item in response:
116117 # print(json.dumps(item, indent=2))
117118
118- # Normally you would define a seperate callback for every function.
119+ # Normally you would define a separate callback for every function.
119120def callback (response ):
120121 print ("Callback:" , json .dumps (response , indent = 2 ))
121122
@@ -172,4 +173,4 @@ def testWebsockets(bitvavo):
172173 websocket .closeSocket ()
173174
174175if __name__ == '__main__' :
175- main ()
176+ main ()
0 commit comments