{"id":10268,"date":"2025-03-17T19:45:57","date_gmt":"2025-03-17T22:45:57","guid":{"rendered":"https:\/\/site.ocasteloforte.com\/?page_id=10268"},"modified":"2025-03-17T20:01:51","modified_gmt":"2025-03-17T23:01:51","slug":"calculadora-de-investimentos-renda-fixa","status":"publish","type":"page","link":"https:\/\/site.ocasteloforte.com\/en\/calculadora\/calculadora-de-investimentos-renda-fixa\/","title":{"rendered":"Calculadora de investimentos Renda Fixa"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"10268\" class=\"elementor elementor-10268\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-f768e0f e-flex e-con-boxed e-con e-parent\" data-id=\"f768e0f\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d59b716 exad-sticky-section-no exad-glass-effect-no elementor-widget elementor-widget-html\" data-id=\"d59b716\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div id=\"calculator\">\r\n    <h2>Calculadora de Compara\u00e7\u00e3o de Investimentos<\/h2>\r\n\r\n    <label for=\"investment-type\">Qual \u00e9 o tipo de investimento?<\/label>\r\n    <select id=\"investment-type\">\r\n        <option value=\"tesouro-direto\">TESOURO DIRETO<\/option>\r\n        <option value=\"debenture-incentivada\">DEB\u00caNTURE INCENTIVADA<\/option>\r\n        <option value=\"debenture\">DEB\u00caNTURE<\/option>\r\n        <option value=\"cra\">CRA<\/option>\r\n        <option value=\"cri\">CRI<\/option>\r\n        <option value=\"lca\">LCA<\/option>\r\n        <option value=\"lci\">LCI<\/option>\r\n        <option value=\"cdb\">CDB<\/option>\r\n    <\/select>\r\n\r\n    <label for=\"comparison-investment\">Voc\u00ea quer comparar com:<\/label>\r\n    <select id=\"comparison-investment\">\r\n        <option value=\"cdb\">CDB<\/option>\r\n        <option value=\"tesouro-direto\">TESOURO DIRETO<\/option>\r\n        <option value=\"debenture-incentivada\">DEB\u00caNTURE INCENTIVADA<\/option>\r\n        <option value=\"debenture\">DEB\u00caNTURE<\/option>\r\n        <option value=\"cra\">CRA<\/option>\r\n        <option value=\"cri\">CRI<\/option>\r\n        <option value=\"lca\">LCA<\/option>\r\n        <option value=\"lci\">LCI<\/option>\r\n    <\/select>\r\n\r\n    <label for=\"investment-rate-type\">Rentabilidade do investimento<\/label>\r\n    <select id=\"investment-rate-type\">\r\n        <option value=\"pre-fixado\">Pr\u00e9-fixado<\/option>\r\n        <option value=\"cdi\">% do CDI<\/option>\r\n        <option value=\"taxa-fixada-ipca\">Taxa fixada + IPCA<\/option>\r\n    <\/select>\r\n    \r\n    <label for=\"investment-rate\">Rentabilidade (%)<\/label>\r\n    <input type=\"number\" id=\"investment-rate\" value=\"10.00\" step=\"0.01\">\r\n\r\n    <label for=\"investment-time\">Tempo de investimento (meses)<\/label>\r\n    <input type=\"number\" id=\"investment-time\" value=\"12\">\r\n\r\n    <div class=\"button-container\">\r\n        <button onclick=\"calculateComparison()\">Calcular<\/button>\r\n        <button onclick=\"resetCalculator()\">Limpar<\/button>\r\n    <\/div>\r\n\r\n    <div id=\"result\"><\/div>\r\n<\/div>\r\n\r\n<script>\r\nfunction calculateComparison() {\r\n    const investmentType = document.getElementById('investment-type').value;\r\n    const comparisonType = document.getElementById('comparison-investment').value;\r\n    const rateType = document.getElementById('investment-rate-type').value;\r\n    const rate = parseFloat(document.getElementById('investment-rate').value);\r\n    const time = parseInt(document.getElementById('investment-time').value);\r\n\r\n    \/\/ Valores base\r\n    const CDI = 10.4; \/\/ CDI anual\r\n    const IPCA = 4.5; \/\/ IPCA anual\r\n\r\n    \/\/ Rentabilidade l\u00edquida (a.a.) e al\u00edquota do IR\r\n    let tesouroRentability = 0;\r\n    let cdbRentability = 0;\r\n\r\n    \/\/ Considerando a rentabilidade l\u00edquida anual\r\n    if (rateType === \"pre-fixado\") {\r\n        tesouroRentability = rate \/ 100;\r\n        cdbRentability = rate \/ 100;\r\n    } else if (rateType === \"cdi\") {\r\n        tesouroRentability = (rate * CDI) \/ 100;\r\n        cdbRentability = (rate * CDI) \/ 100;\r\n    } else if (rateType === \"taxa-fixada-ipca\") {\r\n        tesouroRentability = (rate + IPCA) \/ 100;\r\n        cdbRentability = (rate + IPCA) \/ 100;\r\n    }\r\n\r\n    \/\/ Considerando o Imposto de Renda (IR)\r\n    const IR = 0.2; \/\/ Al\u00edquota de 20% para m\u00e9dio prazo (181 a 360 dias)\r\n\r\n    \/\/ Calculando o retorno bruto e aplicando o IR\r\n    const tesouroFinal = tesouroRentability * time * (1 - IR); \r\n    const cdbFinal = cdbRentability * time * (1 - IR);\r\n\r\n    let betterInvestment = '';\r\n    if (tesouroFinal > cdbFinal) {\r\n        betterInvestment = 'TESOURO DIRETO';\r\n    } else {\r\n        betterInvestment = 'CDB';\r\n    }\r\n\r\n    document.getElementById('result').innerHTML = `\r\n        <h3>Resultado<\/h3>\r\n        <p>O investimento TESOURO DIRETO vai render ${tesouroRentability * 100}%, considerando uma rentabilidade l\u00edquida anual de ${tesouroRentability * 100}% ao longo de ${time} meses.<\/p>\r\n        <p>O investimento CDB vai render ${cdbRentability * 100}%, considerando uma rentabilidade l\u00edquida anual de ${cdbRentability * 100}% ao longo de ${time} meses.<\/p>\r\n        <p>Atualmente: o investimento ${betterInvestment} \u00e9 melhor.<\/p>\r\n\r\n        <h4>Tesouro Direto<\/h4>\r\n        <table>\r\n            <tr><td>Rentabilidade L\u00edquida (a.a):<\/td><td>${tesouroRentability * 100}%<\/td><\/tr>\r\n            <tr><td>Per\u00edodo:<\/td><td>${time} meses<\/td><\/tr>\r\n            <tr><td>% Al\u00edquota do IR:<\/td><td>20.0%<\/td><\/tr>\r\n        <\/table>\r\n\r\n        <h4>CDB<\/h4>\r\n        <table>\r\n            <tr><td>Rentabilidade L\u00edquida (a.a):<\/td><td>${cdbRentability * 100}%<\/td><\/tr>\r\n            <tr><td>Per\u00edodo:<\/td><td>${time} meses<\/td><\/tr>\r\n            <tr><td>% Al\u00edquota do IR:<\/td><td>20.0%<\/td><\/tr>\r\n        <\/table>\r\n        \r\n        <h4>Fonte<\/h4>\r\n        <table>\r\n            <tr><td>Site:<\/td><td><a href=\"https:\/\/www.example.com\">Exemplo de site<\/a><\/td><\/tr>\r\n        <\/table>\r\n    `;\r\n}\r\n\r\nfunction resetCalculator() {\r\n    document.getElementById('investment-rate').value = \"10.00\";\r\n    document.getElementById('investment-time').value = \"12\";\r\n    document.getElementById('result').innerHTML = '';\r\n}\r\n<\/script>\r\n\r\n<style>\r\n#calculator {\r\n    width: 1200px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    border: 1px solid #ccc;\r\n    border-radius: 10px;\r\n    background-color: #f9f9f9;\r\n}\r\n\r\n#calculator h2 {\r\n    text-align: center;\r\n}\r\n\r\n#calculator label {\r\n    display: block;\r\n    margin: 10px 0 5px;\r\n}\r\n\r\n#calculator input, #calculator select {\r\n    width: 100%;\r\n    padding: 8px;\r\n    margin-bottom: 10px;\r\n    border: 1px solid #ccc;\r\n    border-radius: 4px;\r\n}\r\n\r\n.button-container {\r\n    display: flex;\r\n    justify-content: space-between;\r\n}\r\n\r\n#calculator button {\r\n    width: 48%;\r\n    padding: 10px;\r\n    background-color: #0C163E;\r\n    color: white;\r\n    border: none;\r\n    border-radius: 5px;\r\n    cursor: pointer;\r\n}\r\n\r\n#calculator button:hover {\r\n    background-color: #2872FA;\r\n}\r\n\r\n#calculator button:nth-child(2) {\r\n    background-color: #808080;\r\n    color: black;\r\n}\r\n\r\n#calculator button:nth-child(2):hover {\r\n    background-color: #ffffff;\r\n}\r\n\r\ntable {\r\n    width: 100%;\r\n    border-collapse: collapse;\r\n    margin-top: 20px;\r\n}\r\n\r\ntable, th, td {\r\n    border: 1px solid #ccc;\r\n}\r\n\r\nth, td {\r\n    padding: 8px;\r\n    text-align: left;\r\n}\r\n\r\nh4 {\r\n    margin-top: 20px;\r\n}\r\n<\/style>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Calculadora de Compara\u00e7\u00e3o de Investimentos Qual \u00e9 o tipo de investimento? TESOURO DIRETODEB\u00caNTURE INCENTIVADADEB\u00caNTURECRACRILCALCICDB Voc\u00ea quer comparar com: CDBTESOURO DIRETODEB\u00caNTURE INCENTIVADADEB\u00caNTURECRACRILCALCI Rentabilidade do investimento Pr\u00e9-fixado% do CDITaxa fixada + IPCA Rentabilidade (%) Tempo de investimento (meses) Calcular Limpar<\/p>","protected":false},"author":1,"featured_media":0,"parent":6749,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10268","page","type-page","status-publish","hentry"],"blocksy_meta":{"has_hero_section":"disabled","styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"acf":[],"_links":{"self":[{"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/pages\/10268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/comments?post=10268"}],"version-history":[{"count":0,"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/pages\/10268\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/pages\/6749"}],"wp:attachment":[{"href":"https:\/\/site.ocasteloforte.com\/en\/wp-json\/wp\/v2\/media?parent=10268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}