Skip to content

Commit

Permalink
DEV: refact dos comentários
Browse files Browse the repository at this point in the history
  • Loading branch information
vmeazevedo committed Jan 17, 2023
1 parent 1556429 commit 81f2137
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions myTicker_Monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,29 @@
print(Panel.fit("Desenvolvido por: Vinícius Azevedo"))

while True:
##############################################
# FUNDOS IMOB
##############################################
# Ticker de FII e Ações
tickers = ["MXRF11.SA", "MCCI11.SA", "HGRU11.SA", "DEVA11.SA", "PETR4.SA", "TAEE11.SA", "BBAS3.SA"]
current_price = web.get_quote_yahoo(tickers)

##############################################
# FUNDOS IMOB
##############################################
table_fii = Table(title="Fundos Imobiliários + Ações")
table_fii.add_column(" ", justify="right", style="blue")
table_fii.add_column("MXRF11", justify="center", style="cyan")
table_fii.add_column("MCCI11", justify="center", style="magenta")
table_fii.add_column("HGRU11", justify="center", style="green")
table_fii.add_column("DEVA11", justify="center", style="yellow")

##############################################
# AÇÕES
##############################################
table_fii.add_column("PETR4", justify="center", style="white")
table_fii.add_column("TAEE11", justify="center", style="white")
table_fii.add_column("BBAS3", justify="center", style="white")


# Funções para monitoramento dos valores
def current_price(tickers):
current_price = web.get_quote_yahoo(tickers)["price"]
return current_price
Expand All @@ -48,11 +54,13 @@ def regular_market_low(tickers):
market_low = web.get_quote_yahoo(tickers)["regularMarketDayLow"]
return market_low

# Chamando as funções
preços = current_price(tickers)
mud_reg_merc = regular_market_change(tickers)
high = regular_market_high(tickers)
low = regular_market_low(tickers)

# Input de dados na linha da tabela
table_fii.add_row("Preço Atual (R$)", str(preços[0]), str(preços[1]), str(preços[2]), str(preços[3]), str(preços[4]), str(preços[5]), str(preços[6]))
table_fii.add_row("Variação +-", str(round(mud_reg_merc[0],2)), str(round(mud_reg_merc[1],2)), str(round(mud_reg_merc[2],2)), str(round(mud_reg_merc[3],2)), str(round(mud_reg_merc[4],2)), str(round(mud_reg_merc[5],2)), str(round(mud_reg_merc[6],2)))
table_fii.add_row("Maior Preço ⬆", str(high[0]), str(high[1]), str(high[2]), str(high[3]), str(high[4]), str(high[5]), str(high[6]))
Expand All @@ -72,12 +80,14 @@ def regular_market_low(tickers):
table_div.add_column("TAEE11", justify="center", style="white")
table_div.add_column("BBAS3", justify="center", style="white")

# Iteração dos valores dos dividendos referente ao último mes
dividends =[]
for i in tickers:
div_data = get_dividends(i, "2022/12/28")
data = div_data.values
dividends.append(data)

# Input de dados na linha da tabela
table_div.add_row(
"Último Div. (R$)",
str(dividends[0][0][0]),
Expand Down

0 comments on commit 81f2137

Please sign in to comment.