Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if investimentos.get('DepositoPrazo', None):
- controleDia = primeirodia
- for investimento in investimentos['DepositoPrazo']:
- valor_informado = investimento['valor_informado']
- #totalinvestido += investimento['valor_informado']
- if (investimento['indicador'] == 'PRE'):
- if periodo == -1:
- #taxaLCA = (pow((1 + (float(investimento['taxa_informada']) / 100)), 1 / 365) - 1) * 100
- taxaDP = ((1 + (float(investimento['taxa_informada']/100))) ** (1/252)) - 1
- else:
- #taxaLCA = (pow((1 + (float(investimento['taxa_informada']) / 100)), 1 / 12) - 1) * 100
- # % ao ano -> mes
- taxaDP = ((1 + (float(investimento['taxa_informada'])/100)) ** (1/12)) - 1
- else:
- if periodo == -1:
- #taxaLCA = (pow((1 + ((tcdi * float(investimento['taxa_informada']) / 100) / 100)),
- # 1 / 252) - 1) * 100
- taxaDP = (tcdi/100) * float(investimento['taxa_informada'])
- taxaDP = ((1 + (taxaDP/100)) ** (1/252)) - 1
- else:
- #taxaLCA = (pow((1 + ((tcdi * float(investimento['taxa_informada']) / 100) / 100)),
- # 1 / 12) - 1) * 100
- # % CDI ao ano -> mes
- taxaDP = (tcdi/100) * float(investimento['taxa_informada'])
- taxaDP = (1 + (taxaDP/100)) ** (1/12) - 1
- if periodo == -1:
- periodom = datetime.now().day - primeirodia.day
- totalinvestido += investimento['valor_informado']
- for i in range(1, periodom + 1, 1):
- totalrentabilidade += (taxaDP * valor_informado)
- else:
- for i in range(1, periodo + 1, 1):
- totalrentabilidade += (taxaDP * valor_informado)
- controleDia = controleDia + relativedelta(months=1)
- totalinvestido += investimento['valor_informado']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement