Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. if investimentos.get('DepositoPrazo', None):
  2. controleDia = primeirodia
  3. for investimento in investimentos['DepositoPrazo']:
  4. valor_informado = investimento['valor_informado']
  5. #totalinvestido += investimento['valor_informado']
  6. if (investimento['indicador'] == 'PRE'):
  7. if periodo == -1:
  8. #taxaLCA = (pow((1 + (float(investimento['taxa_informada']) / 100)), 1 / 365) - 1) * 100
  9. taxaDP = ((1 + (float(investimento['taxa_informada']/100))) ** (1/252)) - 1
  10. else:
  11. #taxaLCA = (pow((1 + (float(investimento['taxa_informada']) / 100)), 1 / 12) - 1) * 100
  12. # % ao ano -> mes
  13. taxaDP = ((1 + (float(investimento['taxa_informada'])/100)) ** (1/12)) - 1
  14. else:
  15. if periodo == -1:
  16. #taxaLCA = (pow((1 + ((tcdi * float(investimento['taxa_informada']) / 100) / 100)),
  17. # 1 / 252) - 1) * 100
  18. taxaDP = (tcdi/100) * float(investimento['taxa_informada'])
  19. taxaDP = ((1 + (taxaDP/100)) ** (1/252)) - 1
  20. else:
  21. #taxaLCA = (pow((1 + ((tcdi * float(investimento['taxa_informada']) / 100) / 100)),
  22. # 1 / 12) - 1) * 100
  23. # % CDI ao ano -> mes
  24. taxaDP = (tcdi/100) * float(investimento['taxa_informada'])
  25. taxaDP = (1 + (taxaDP/100)) ** (1/12) - 1
  26. if periodo == -1:
  27. periodom = datetime.now().day - primeirodia.day
  28. totalinvestido += investimento['valor_informado']
  29. for i in range(1, periodom + 1, 1):
  30. totalrentabilidade += (taxaDP * valor_informado)
  31. else:
  32. for i in range(1, periodo + 1, 1):
  33. totalrentabilidade += (taxaDP * valor_informado)
  34. controleDia = controleDia + relativedelta(months=1)
  35. totalinvestido += investimento['valor_informado']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement