From f7fb66c356009cd79ba5e0c70a7d908fe5356692 Mon Sep 17 00:00:00 2001 From: "[Luis Rodrigues]" Date: Sun, 23 Jun 2024 12:15:46 +0100 Subject: [PATCH] =?UTF-8?q?eliminados=20comentarios=20descnecess=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crypto_portfolio.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crypto_portfolio.py b/crypto_portfolio.py index 9dc32d7..4b875a2 100644 --- a/crypto_portfolio.py +++ b/crypto_portfolio.py @@ -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')