eliminados comentarios descnecessários
This commit is contained in:
@ -28,22 +28,15 @@ portfolio_headers = [
|
|||||||
"movimento"
|
"movimento"
|
||||||
]
|
]
|
||||||
|
|
||||||
url, codigo, dados_ohlc = cgapi.coin_ohlc_chart_by_id(criptomoeda, vs_currency, dias)
|
url, codigo, dados_ohlc = cgapi.coin_ohlc_chart_by_id(criptomoeda, vs_currency, dias, precision=3)
|
||||||
|
|
||||||
if codigo == 200:
|
if codigo == 200:
|
||||||
print(len(dados_ohlc))
|
#print(len(dados_ohlc))
|
||||||
#print(data)
|
|
||||||
|
|
||||||
for index in range(0, len(dados_ohlc)):
|
for index in range(0, len(dados_ohlc)):
|
||||||
data = time.gmtime(dados_ohlc[index][0]/1000)
|
data = time.gmtime(dados_ohlc[index][0]/1000)
|
||||||
if data.tm_hour == 0 and data.tm_min == 0:
|
if data.tm_hour == 0 and data.tm_min == 0:
|
||||||
date_as_string = time.strftime("%d/%m/%Y", data)
|
date_as_string = time.strftime("%d/%m/%Y", data)
|
||||||
price = dados_ohlc[index][4]
|
price = dados_ohlc[index][4]
|
||||||
print(f'{date_as_string} -> {price:.2f}')
|
print(f'{date_as_string} -> {price}')
|
||||||
|
|
||||||
# ohlc = [ data[0][1], data[0][2], data[0][3], data[0][4] ]
|
|
||||||
|
|
||||||
# print(f'price of bitcoin in {date_as_string}:\nopen: {ohlc[0]}\nhigh: {ohlc[1]}\nlow: {ohlc[2]}\nclose: {ohlc[3]}')
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print('failed to retrive data')
|
print('failed to retrive data')
|
||||||
|
|||||||
Reference in New Issue
Block a user