-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1 Iniciando implementação do relatório de preço médio
- Loading branch information
Showing
5 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from rn import RN | ||
from collections import defaultdict | ||
|
||
class RelatorioPrecoMedio: | ||
|
||
rn = None | ||
|
||
def __init__(self, rn): | ||
self.rn = rn | ||
|
||
def txt(self): | ||
rn = self.rn | ||
ativos = rn.ativos() | ||
|
||
mapOperacoes = defaultdict(list) | ||
|
||
for ticker in ativos: | ||
operacoes = rn.listarOperacoesPorTicker(ticker) | ||
|
||
for o in operacoes: | ||
mapOperacoes[ticker.upper()].append(o) | ||
|
||
#print("mapOperacoes = " + str(mapOperacoes)) | ||
|
||
print("Preço médio:") | ||
for ticker in ativos: | ||
precoMedioCompra = rn.precoMedio(ticker, 'C') | ||
if precoMedioCompra > 0: | ||
print(f" C {ticker} {precoMedioCompra}") | ||
|
||
precoMedioVenda = rn.precoMedio(ticker, 'V') | ||
if precoMedioVenda > 0: | ||
print(f" V {ticker} {precoMedioVenda}") | ||
|
||
def pdf(self): | ||
pass | ||
|
||
def grafico(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters