eliminados comentarios descnecessários
This commit is contained in:
@ -28,22 +28,15 @@ portfolio_headers = [
|
||||
"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:
|
||||
print(len(dados_ohlc))
|
||||
#print(data)
|
||||
|
||||
#print(len(dados_ohlc))
|
||||
for index in range(0, len(dados_ohlc)):
|
||||
data = time.gmtime(dados_ohlc[index][0]/1000)
|
||||
if data.tm_hour == 0 and data.tm_min == 0:
|
||||
date_as_string = time.strftime("%d/%m/%Y", data)
|
||||
price = dados_ohlc[index][4]
|
||||
print(f'{date_as_string} -> {price:.2f}')
|
||||
|
||||
# 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]}')
|
||||
|
||||
print(f'{date_as_string} -> {price}')
|
||||
else:
|
||||
print('failed to retrive data')
|
||||
|
||||
Reference in New Issue
Block a user