Spaces:
Running
Running
Upload 14 files
Browse files- app.py +16 -7
- interface/about_interface.py +424 -229
- interface/retirement_planning_interface.py +26 -6
- modules/retirement_planning.py +18 -1
app.py
CHANGED
@@ -2,8 +2,11 @@ import gradio as gr
|
|
2 |
from interface.rebalancing_interface import examples, rebalancing_inputs, output as rebalancing_output, update_output as rebalancing_update_output
|
3 |
from interface.share_price_trend_interface import share_price_trend_inputs, output as share_price_trend_output, update_output as share_price_trend_update_output
|
4 |
from interface.dollar_cost_averaging_interface import dollar_cost_averaging_inputs, output as dollar_cost_averaging_output, update_output as dollar_cost_averaging_update_output, markdown1 as dollar_cost_averaging_markdown1, old_price, old_quantity, markdown2 as dollar_cost_averaging_markdown2, new_price, new_quantity
|
5 |
-
from interface.retirement_planning_interface import
|
6 |
-
|
|
|
|
|
|
|
7 |
from interface.about_interface import render as render_about_tab
|
8 |
|
9 |
with gr.Blocks(css='style.css') as demo:
|
@@ -98,21 +101,25 @@ with gr.Blocks(css='style.css') as demo:
|
|
98 |
inflation_rate.render()
|
99 |
current_investment.render()
|
100 |
monthly_investment.render()
|
|
|
101 |
pre_retirement_roi.render()
|
102 |
pre_retirement_dividend_yield.render()
|
103 |
reinvest_dividends.render()
|
104 |
-
retirement_markdown.render()
|
105 |
post_retirement_roi.render()
|
106 |
post_retirement_dividend_yield.render()
|
107 |
# Add the ClearButton below the inputs
|
108 |
clear_button = gr.ClearButton(value="Clear")
|
109 |
clear_button.click(
|
110 |
fn=lambda: [None] * len([
|
111 |
-
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
|
|
|
|
112 |
]),
|
113 |
inputs=[],
|
114 |
outputs=[
|
115 |
-
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
|
|
|
|
116 |
]
|
117 |
)
|
118 |
with gr.Column(): # Column for output
|
@@ -120,12 +127,14 @@ with gr.Blocks(css='style.css') as demo:
|
|
120 |
|
121 |
# Add change event handlers for retirement planning inputs
|
122 |
for input_component in [
|
123 |
-
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment,
|
|
|
124 |
]:
|
125 |
input_component.change(
|
126 |
fn=retirement_update_output,
|
127 |
inputs=[
|
128 |
-
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment,
|
|
|
129 |
],
|
130 |
outputs=retirement_output
|
131 |
)
|
|
|
2 |
from interface.rebalancing_interface import examples, rebalancing_inputs, output as rebalancing_output, update_output as rebalancing_update_output
|
3 |
from interface.share_price_trend_interface import share_price_trend_inputs, output as share_price_trend_output, update_output as share_price_trend_update_output
|
4 |
from interface.dollar_cost_averaging_interface import dollar_cost_averaging_inputs, output as dollar_cost_averaging_output, update_output as dollar_cost_averaging_update_output, markdown1 as dollar_cost_averaging_markdown1, old_price, old_quantity, markdown2 as dollar_cost_averaging_markdown2, new_price, new_quantity
|
5 |
+
from interface.retirement_planning_interface import (
|
6 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
7 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์
๋ ฅ ๋ณ์
|
8 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield, output as retirement_output, update_output as retirement_update_output
|
9 |
+
)
|
10 |
from interface.about_interface import render as render_about_tab
|
11 |
|
12 |
with gr.Blocks(css='style.css') as demo:
|
|
|
101 |
inflation_rate.render()
|
102 |
current_investment.render()
|
103 |
monthly_investment.render()
|
104 |
+
monthly_increase_in_investment.render() # ์ถ๊ฐ๋ ์
๋ ฅ
|
105 |
pre_retirement_roi.render()
|
106 |
pre_retirement_dividend_yield.render()
|
107 |
reinvest_dividends.render()
|
|
|
108 |
post_retirement_roi.render()
|
109 |
post_retirement_dividend_yield.render()
|
110 |
# Add the ClearButton below the inputs
|
111 |
clear_button = gr.ClearButton(value="Clear")
|
112 |
clear_button.click(
|
113 |
fn=lambda: [None] * len([
|
114 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
115 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์
๋ ฅ
|
116 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
|
117 |
]),
|
118 |
inputs=[],
|
119 |
outputs=[
|
120 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
121 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์
๋ ฅ
|
122 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
|
123 |
]
|
124 |
)
|
125 |
with gr.Column(): # Column for output
|
|
|
127 |
|
128 |
# Add change event handlers for retirement planning inputs
|
129 |
for input_component in [
|
130 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์
๋ ฅ
|
131 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
|
132 |
]:
|
133 |
input_component.change(
|
134 |
fn=retirement_update_output,
|
135 |
inputs=[
|
136 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์
๋ ฅ
|
137 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
|
138 |
],
|
139 |
outputs=retirement_output
|
140 |
)
|
interface/about_interface.py
CHANGED
@@ -12,294 +12,489 @@ def render():
|
|
12 |
|
13 |
# Portfolio Rebalancing Tool Section
|
14 |
create_tool_section(
|
15 |
-
"
|
16 |
"""
|
17 |
-
|
18 |
|
19 |
-
์ด ๋๊ตฌ๋
|
20 |
|
21 |
-
|
22 |
-
- **๋ค์ค ํตํ ์ง์**: ๋ชจ๋ ๊ธ์ก์ ๋ฉ์ธ ํตํ๋ก ๋ณํ๋ฉ๋๋ค.
|
23 |
-
- **์์ธ ๋ถ์**: ํ์ฌ ํฌํธํด๋ฆฌ์ค, ํตํ ๋ฐฐ๋ถ ๋ฐ ๋ฆฌ๋ฐธ๋ฐ์ฑ ๊ถ์ฅ ์ฌํญ์ ํ์ํฉ๋๋ค. ๋ฆฌ๋ฐธ๋ฐ์ฑ ๊ณ์ฐ์ 1์ฃผ๋จ์๋ก ๊ณ์ฐ๋ฉ๋๋ค.
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
```
|
31 |
-
AAPL USD 100 2,
|
32 |
-
TSLA USD 50 1,
|
33 |
-
005930 KRW 200 3
|
34 |
-
```
|
35 |
-
- `AAPL USD 100 2`: USD๋ก ๋ Apple (AAPL) ์ฃผ์ 100์ฃผ, ๋ชฉํ ๋น์ค 2.
|
36 |
-
- `TSLA USD 50 1`: USD๋ก ๋ Tesla (TSLA) ์ฃผ์ 50์ฃผ, ๋ชฉํ ๋น์ค 1.
|
37 |
-
- `005930 KRW 200 3`: KRW๋ก ๋ ์ผ์ฑ์ ์ (005930) ์ฃผ์ 200์ฃผ, ๋ชฉํ ๋น์ค 3.
|
38 |
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
- ์ฃผ์ ์ฝ๋์ ํตํ ์ฝ๋๊ฐ ์ ํจํ์ง ํ์ธํ์ธ์.
|
41 |
- ์ด ๋๊ตฌ๋ ์ฃผ๊ฐ์ ํ์จ์ ์ค์๊ฐ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ์ธํฐ๋ท ์ฐ๊ฒฐ์ด ํ์ํฉ๋๋ค.
|
42 |
- Yahoo Finance ๋ฐ FinanceDataReader์ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
|
43 |
|
44 |
-
|
45 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๋ณด๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
46 |
""",
|
47 |
"""
|
48 |
-
|
|
|
|
|
49 |
|
50 |
-
|
51 |
|
52 |
-
|
53 |
-
- **
|
54 |
-
- **
|
55 |
|
56 |
-
|
57 |
-
1. **Enter Portfolio Details**: Enter `stock code currency quantity target ratio` in the specified format. Separate items within a stock with spaces. Separate multiple stock items with commas.
|
58 |
-
2. **Set Cash Amount and Ratio**: Specify the cash amount and ratio (%) you want to maintain.
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
-
|
67 |
-
- `TSLA USD 50 1`: 50 shares of Tesla (TSLA) in USD, target ratio 1.
|
68 |
-
- `005930 KRW 200 3`: 200 shares of Samsung Electronics (005930) in KRW, target ratio 3.
|
69 |
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
- Ensure stock codes and currency codes are valid.
|
72 |
- This tool requires an internet connection as it uses real-time stock prices and exchange rates.
|
73 |
- Data is sourced from Yahoo Finance and FinanceDataReader.
|
74 |
|
75 |
-
|
76 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
77 |
"""
|
78 |
)
|
79 |
|
80 |
# Stock Comparison Tool Section
|
81 |
create_tool_section(
|
82 |
-
"
|
83 |
"""
|
84 |
-
|
85 |
-
|
86 |
-
์ด
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
-
|
99 |
-
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๋ณด๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
113 |
""",
|
114 |
"""
|
115 |
-
|
|
|
|
|
|
|
|
|
116 |
|
117 |
-
|
|
|
118 |
|
119 |
-
|
120 |
-
- **Stock Comparison**: Compare the performance of multiple stocks over a user-defined period.
|
121 |
-
- **Relative Price Comparison**: Shows relative changes starting from the same baseline.
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
|
|
127 |
|
128 |
-
|
129 |
-
- `Stock Codes`: AAPL, GOOGL, TSLA
|
130 |
-
- `Number of Days`: 30
|
131 |
|
132 |
-
|
133 |
-
-
|
134 |
|
135 |
-
|
136 |
-
- Ensure all stock codes are valid and supported by the data source.
|
137 |
-
- The tool fetches data based on trading days, excluding weekends and holidays.
|
138 |
-
- An internet connection is required as the tool uses stock price data.
|
139 |
-
- Data is sourced from FinanceDataReader.
|
140 |
-
- Developed using matplotlib for graphical visualization.
|
141 |
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
144 |
"""
|
145 |
)
|
146 |
|
147 |
# Cost Averaging Tool Section
|
148 |
create_tool_section(
|
149 |
-
"
|
150 |
"""
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
-
|
162 |
-
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๋ณด๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
181 |
""",
|
182 |
"""
|
183 |
-
|
184 |
-
|
185 |
-
This tool helps
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
-
|
194 |
-
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
213 |
"""
|
214 |
)
|
215 |
|
216 |
# Retirement Planning Tool Section
|
217 |
create_tool_section(
|
218 |
-
"
|
219 |
"""
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
-
|
238 |
-
-
|
239 |
-
-
|
240 |
-
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๏ฟฝ๏ฟฝ๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
261 |
""",
|
262 |
"""
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
-
|
281 |
-
-
|
282 |
-
-
|
283 |
-
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
304 |
"""
|
305 |
)
|
|
|
12 |
|
13 |
# Portfolio Rebalancing Tool Section
|
14 |
create_tool_section(
|
15 |
+
"RE-BALANCING CALCULATOR",
|
16 |
"""
|
17 |
+
## ๐ ๋ฆฌ๋ฐธ๋ฐ์ฑ ๊ณ์ฐ๊ธฐ
|
18 |
|
19 |
+
์ด ๋๊ตฌ๋ ์ฃผ์ด์ง ์ฃผ์ ๋ณด์ ๋, ํ๊ธ ๊ธ์ก ๋ฐ ํ๊ธ ๋น์จ์ ๋ฐํ์ผ๋ก ํฌํธํด๋ฆฌ์ค๋ฅผ ๋ถ์ํ๊ณ ์ฌ์กฐ์ ํฉ๋๋ค.
|
20 |
|
21 |
+
### ์
๋ ฅ๊ฐ
|
|
|
|
|
22 |
|
23 |
+
- **์ฃผ์ ๋ณด์ ๋ (holdings)**: ๊ฐ ์ฃผ์์ ์ฝ๋, ํตํ ์ฝ๋, ์๋, ๋ชฉํ ๋น์จ์ ์
๋ ฅํฉ๋๋ค. ์ฌ๋ฌ ์ฃผ์ ์ข
๋ชฉ์ ์ผํ๋ก ๊ตฌ๋ถํ์ฌ ์
๋ ฅํฉ๋๋ค. ์: `AAPL USD 10 0.30,TSLA USD 5 0.20`
|
24 |
+
- **ํ๊ธ ๊ธ์ก (cash_amount)**: ํฌํธํด๋ฆฌ์ค์ ํฌํจ๋ ํ๊ธ์ ๊ธ์ก์
๋๋ค. ์: `1000`
|
25 |
+
- **ํ๊ธ ๋น์จ (cash_ratio)**: ํฌํธํด๋ฆฌ์ค์์ ํ๊ธ์ด ์ฐจ์งํ๋ ๋น์จ์
๋๋ค. ์: `10` (10%)
|
26 |
|
27 |
+
### ๊ธฐ๋ฅ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
1. **์
๋ ฅ ํ์ฑ**: ์ฃผ์ ๋ณด์ ๋, ํ๊ธ ๊ธ์ก ๋ฐ ๋น์จ์ ๋ถ์ํ์ฌ ๊ฐ ์ฃผ์์ ๋ชฉํ ๋น์จ์ ๊ณ์ฐํฉ๋๋ค.
|
30 |
+
2. **ํ์จ ์กฐํ**: ๊ฐ ์ฃผ์์ ํตํ ์ฝ๋์ ๋ฉ์ธ ํตํ ๊ฐ์ ํ์จ์ ์กฐํํ์ฌ ์ฃผ์ ๊ฐ๊ฒฉ์ ๋ณํํฉ๋๋ค.
|
31 |
+
3. **ํฌํธํด๋ฆฌ์ค ๊ตฌ์ถ**: ์ฃผ์๊ณผ ํ๊ธ ์ ๋ณด๋ฅผ ๋ฐํ์ผ๋ก ํฌํธํด๋ฆฌ์ค๋ฅผ ๊ตฌ์ถํฉ๋๋ค.
|
32 |
+
4. **ํฌํธํด๋ฆฌ์ค ์ฌ์กฐ์ ์ ๋ณด ์ ๊ณต**: ํ์ฌ ํฌํธํด๋ฆฌ์ค์ ๊ฐ์น์ ๋ชฉํ ๋น์จ์ ๋น๊ตํ์ฌ ์ฌ์กฐ์ ํ์์ฑ์ ๋ถ์ํฉ๋๋ค.
|
33 |
+
- **ํ์ฌ ๋ณด์ ๋ ๋ฐ ๊ฐ์น**: ๊ฐ ์ฃผ์ ๋ฐ ํ๊ธ์ ํ์ฌ ๋ณด์ ๋๊ณผ ๊ฐ์น๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
34 |
+
- **์ฌ์กฐ์ ํญ๋ชฉ**: ๋ชฉํ ๋น์จ์ ๋ง์ถ๊ธฐ ์ํด ๋งค์ ๋๋ ๋งค๋ํด์ผ ํ ์ฃผ์ ์๋๊ณผ ๊ธ์ก์ ๊ณ์ฐํฉ๋๋ค.
|
35 |
+
- **ํตํ๋ณ ์์ฝ**: ํฌํธํด๋ฆฌ์ค์ ํตํ๋ณ ๋ถํฌ๋ฅผ ์์ฝํฉ๋๋ค.
|
36 |
+
|
37 |
+
### ๊ฒฐ๊ณผ
|
38 |
+
|
39 |
+
- **ํฌํธํด๋ฆฌ์ค ์ ๋ณด**: ํ์ฌ ํฌํธํด๋ฆฌ์ค์ ์ด ๊ฐ์น ๋ฐ ํ๊ธ ์ ๋ณด๋ฅผ ํฌํจํ HTML ์ฝ๋์
๋๋ค.
|
40 |
+
- **ํ์ฌ ๋ณด์ ๋ ๋ฐ ๊ฐ์น**: ๊ฐ ์ฃผ์์ ํ์ฌ ๋น์จ ๋ฐ ๊ฐ์น์ ๋ํ ์ ๋ณด์
๋๋ค.
|
41 |
+
- **์ฌ์กฐ์ ๋ถ์**: ์ฃผ์์ ๋งค์/๋งค๋ ์กฐ์ ์ด ํ์ํ ํญ๋ชฉ ๋ฐ ๊ธ์ก์ ๋ํ ์์ธ ๋ถ์์
๋๋ค.
|
42 |
+
- **ํตํ๋ณ ์์ฝ**: ํฌํธํด๋ฆฌ์ค์ ํตํ๋ณ ๋น์จ ๋ฐ ์ด ๊ฐ์น๋ฅผ ์์ฝํ ์ ๋ณด์
๋๋ค.
|
43 |
+
|
44 |
+
์ด ๋๊ตฌ๋ฅผ ํตํด ํฌํธํด๋ฆฌ์ค๋ฅผ ํจ์จ์ ์ผ๋ก ์ฌ์กฐ์ ํ๊ณ , ์ฃผ์ ๋ฐ ํ๊ธ์ ๋น์จ์ ์ต์ ํํ ์ ์์ต๋๋ค! ๐๐ผ
|
45 |
+
|
46 |
+
### ์ค์ ์ฌํญ
|
47 |
- ์ฃผ์ ์ฝ๋์ ํตํ ์ฝ๋๊ฐ ์ ํจํ์ง ํ์ธํ์ธ์.
|
48 |
- ์ด ๋๊ตฌ๋ ์ฃผ๊ฐ์ ํ์จ์ ์ค์๊ฐ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ์ธํฐ๋ท ์ฐ๊ฒฐ์ด ํ์ํฉ๋๋ค.
|
49 |
- Yahoo Finance ๋ฐ FinanceDataReader์ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
|
50 |
|
51 |
+
### ๋ฉด์ฑ
์กฐํญ
|
52 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๋ณด๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
53 |
""",
|
54 |
"""
|
55 |
+
## ๐ RE-BALANCING CALCULATOR
|
56 |
+
|
57 |
+
This tool analyzes and rebalances a portfolio based on given stock holdings, cash amount, and cash ratio.
|
58 |
|
59 |
+
### Input Values
|
60 |
|
61 |
+
- **Stock Holdings (holdings)**: Enter the stock code, currency code, quantity, and target weight for each stock. Separate multiple stocks with commas. Example: `AAPL USD 10 0.30,TSLA USD 5 0.20`
|
62 |
+
- **Cash Amount (cash_amount)**: The amount of cash in the portfolio. Example: `1000`
|
63 |
+
- **Cash Ratio (cash_ratio)**: The proportion of cash in the portfolio. Example: `10` (10%)
|
64 |
|
65 |
+
### Functionality
|
|
|
|
|
66 |
|
67 |
+
1. **Parse Input**: Analyzes stock holdings, cash amount, and ratio to calculate the target weights for each stock.
|
68 |
+
2. **Exchange Rate Lookup**: Retrieves exchange rates between each stock's currency code and the main currency to convert stock prices.
|
69 |
+
3. **Build Portfolio**: Constructs the portfolio based on stock and cash information.
|
70 |
+
4. **Get Portfolio Rebalancing Information**: Compares the current portfolio value and target weights to analyze rebalancing needs.
|
71 |
+
- **Current Holdings and Value**: Calculates the current holdings and value of each stock and cash.
|
72 |
+
- **Rebalancing Items**: Calculates the quantities and amounts of stocks to buy or sell to meet target weights.
|
73 |
+
- **Currency Summary**: Summarizes the portfolio's distribution by currency.
|
|
|
|
|
74 |
|
75 |
+
### Results
|
76 |
+
|
77 |
+
- **Portfolio Information**: HTML code containing the total value of the current portfolio and cash information.
|
78 |
+
- **Current Holdings and Value**: Information on the current weights and values of each stock.
|
79 |
+
- **Rebalancing Analysis**: Detailed analysis of the adjustments needed to buy/sell stocks to meet target weights.
|
80 |
+
- **Currency Summary**: Summary of portfolio distribution by currency, including total value.
|
81 |
+
|
82 |
+
Use this tool to efficiently rebalance your portfolio and optimize the ratio of stocks and cash! ๐๐ผ
|
83 |
+
|
84 |
+
### Important Notes
|
85 |
- Ensure stock codes and currency codes are valid.
|
86 |
- This tool requires an internet connection as it uses real-time stock prices and exchange rates.
|
87 |
- Data is sourced from Yahoo Finance and FinanceDataReader.
|
88 |
|
89 |
+
### Disclaimer
|
90 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
91 |
"""
|
92 |
)
|
93 |
|
94 |
# Stock Comparison Tool Section
|
95 |
create_tool_section(
|
96 |
+
"STOCK PRICE TREND VISUALIZATION",
|
97 |
"""
|
98 |
+
## ๐ ์ฃผ์ ๊ฐ๊ฒฉ ์ถ์ธ ์๊ฐํ
|
99 |
+
|
100 |
+
์ด ์ฝ๋๋ ์ฃผ์ด์ง ์ฃผ์ ์ฝ๋๋ค์ ๊ฐ๊ฒฉ ์ถ์ธ๋ฅผ ์๊ฐํํฉ๋๋ค. ์ฌ๋ฌ ์ฃผ์์ ๊ฐ๊ฒฉ์ ์ถ์ ํ๊ณ ๋น๊ตํ๊ธฐ ์ํด ์ฌ์ฉ๋ฉ๋๋ค. ๐
|
101 |
+
|
102 |
+
### ์
๋ ฅ๊ฐ
|
103 |
+
|
104 |
+
- **์ฃผ์ ์ฝ๋ (stock_codes)**: ๊ฐ๊ฒฉ์ ์ถ์ ํ ์ฃผ์์ ์ฝ๋๋ค์
๋๋ค. ์ผํ๋ก ๊ตฌ๋ถ๋ ๋ฌธ์์ด ํ์์ผ๋ก ์
๋ ฅํฉ๋๋ค. ์: `AAPL,GOOGL,MSFT`
|
105 |
+
- **์ผ์ (days)**: ๊ฐ๊ฒฉ์ ์กฐํํ ๊ธฐ๊ฐ์
๋๋ค. ์: `30` (์ต๊ทผ 30์ผ)
|
106 |
+
|
107 |
+
### ๊ธฐ๋ฅ
|
108 |
+
|
109 |
+
1. **์ฃผ์ ๊ฐ๊ฒฉ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ**: ์ฃผ์ด์ง ์ฃผ์ ์ฝ๋์ ๊ธฐ๊ฐ์ ๋ํด ์ฃผ์ ๊ฐ๊ฒฉ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
|
110 |
+
2. **๊ฐ๊ฒฉ ๋ณ๋ ์๊ฐํ**: ๊ฐ ์ฃผ์์ ๊ฐ๊ฒฉ ๋ณ๋์ ์๊ฐํํ์ฌ ๋น๊ตํ ์ ์๋ ๊ทธ๋ํ๋ฅผ ์์ฑํฉ๋๋ค.
|
111 |
+
- **์๋ ๊ฐ๊ฒฉ**: ๊ฐ ์ฃผ์์ ๊ฐ๊ฒฉ์ ์ฒ์ ๊ฐ๊ฒฉ์ ๋ํด ์๋์ ์ผ๋ก ๋ณ๋์ ๋ณด์ฌ์ค๋๋ค.
|
112 |
+
- **์คํ์ผ**: ๊ทธ๋ํ์๋ ์์ ๊ทธ๋ผ๋์ธํธ์ ๊ทธ๋ฆผ์ ํจ๊ณผ๊ฐ ์ ์ฉ๋ฉ๋๋ค.
|
113 |
+
- **์ ๋๋ฉ์ด์
**: ์ ์ ์ ๋๋ฉ์ด์
ํจ๊ณผ๊ฐ ์ถ๊ฐ๋์ด ์๊ฐ์ ์ผ๋ก ๋์ฑ ๋งค๋ ฅ์ ์
๋๋ค.
|
114 |
+
3. **๋ฐ์ดํฐ ํ
์ด๋ธ ์์ฑ**: ๊ฐ ๋ ์ง์ ์ฃผ์์ ๊ฐ๊ฒฉ์ ํฌํจํ HTML ํ
์ด๋ธ์ ์์ฑํฉ๋๋ค.
|
115 |
+
|
116 |
+
### ๊ฒฐ๊ณผ
|
117 |
+
|
118 |
+
- **๊ทธ๋ํ**: ์ต๊ทผ `days` ์ผ ๋์์ ์๋ ์ฃผ์ ๊ฐ๊ฒฉ ์ถ์ธ๋ฅผ ๋ณด์ฌ์ฃผ๋ ๊ทธ๋ํ์
๋๋ค.
|
119 |
+
- **๋ฐ์ดํฐ ํ
์ด๋ธ**: ๋ ์ง๋ณ๋ก ๊ฐ ์ฃผ์์ ๊ฐ๊ฒฉ์ ํฌํจํ๋ HTML ํ
์ด๋ธ์
๋๋ค.
|
120 |
+
|
121 |
+
### ์ฌ์ฉ ์์
|
122 |
+
|
123 |
+
์ฃผ์ ์ฝ๋์ ๊ธฐ๊ฐ์ ์
๋ ฅํ๋ฉด, ๋ค์๊ณผ ๊ฐ์ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ต๋๋ค:
|
124 |
+
|
125 |
+
- **์ฃผ์ ์ฝ๋**: `AAPL,GOOGL,MSFT`
|
126 |
+
- **์ผ์**: `30`
|
127 |
+
|
128 |
+
๊ฒฐ๊ณผ๋ ์ต๊ทผ 30์ผ ๋์์ ์ฃผ์ ๊ฐ๊ฒฉ ๋ณ๋์ ๋ณด์ฌ์ฃผ๋ ๊ทธ๋ํ์ ๋ฐ์ดํฐ ํ
์ด๋ธ์ด ํฌํจ๋ฉ๋๋ค.
|
129 |
+
|
130 |
+
์ด ๋๊ตฌ๋ฅผ ํตํด ์ฃผ์ ๊ฐ๊ฒฉ์ ๋ณ๋ ์ถ์ธ๋ฅผ ํ๋์ ํ์ธํ๊ณ ๋ถ์ํ ์ ์์ต๋๋ค! ๐๐ก
|
131 |
+
|
132 |
+
### ์ค์ ์ฌํญ
|
133 |
+
- ์ฃผ์ ์ฝ๋๊ฐ ์ ํจํ์ง ํ์ธํ์ธ์.
|
134 |
+
- ์ด ๋๊ตฌ๋ ์ฃผ๊ฐ์ ์ค์๊ฐ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ์ธํฐ๋ท ์ฐ๊ฒฐ์ด ํ์ํฉ๋๋ค.
|
135 |
+
- Yahoo Finance ๋ฐ FinanceDataReader์ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
|
136 |
+
|
137 |
+
### ๋ฉด์ฑ
์กฐํญ
|
138 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๋ณด๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
139 |
""",
|
140 |
"""
|
141 |
+
## ๐ Stock Price Trend Visualization
|
142 |
+
|
143 |
+
This script visualizes the price trends of given stock codes over a specified period. It allows you to track and compare the price movements of multiple stocks. ๐
|
144 |
+
|
145 |
+
### Input Values
|
146 |
|
147 |
+
- **Stock Codes (stock_codes)**: The codes of the stocks you want to track. Enter them as a comma-separated string. Example: `AAPL,GOOGL,MSFT`
|
148 |
+
- **Days (days)**: The period for which you want to fetch the price data. Example: `30` (last 30 days)
|
149 |
|
150 |
+
### Functionality
|
|
|
|
|
151 |
|
152 |
+
1. **Fetch Stock Price Data**: Retrieves stock price data for the given stock codes and period.
|
153 |
+
2. **Visualize Price Trends**: Creates a graph to visualize and compare the price trends of each stock.
|
154 |
+
- **Relative Price**: Shows each stock's price relative to its initial price.
|
155 |
+
- **Style**: The graph includes color gradients and shadow effects.
|
156 |
+
- **Animation**: Line animation effects are added for visual appeal.
|
157 |
+
3. **Generate Data Table**: Creates an HTML table with the price data for each stock and date.
|
158 |
|
159 |
+
### Results
|
|
|
|
|
160 |
|
161 |
+
- **Graph**: A graph showing the relative stock price trends over the last `days` days.
|
162 |
+
- **Data Table**: An HTML table displaying the prices of each stock by date.
|
163 |
|
164 |
+
### Example Usage
|
|
|
|
|
|
|
|
|
|
|
165 |
|
166 |
+
Given stock codes and days, you can obtain results such as:
|
167 |
+
|
168 |
+
- **Stock Codes**: `AAPL,GOOGL,MSFT`
|
169 |
+
- **Days**: `30`
|
170 |
+
|
171 |
+
The result will include a graph showing the price trends over the last 30 days and an HTML table with the price data.
|
172 |
+
|
173 |
+
Use this tool to easily analyze and visualize stock price movements! ๐๐ก
|
174 |
+
|
175 |
+
### Important Notes
|
176 |
+
- Ensure stock codes are valid.
|
177 |
+
- This tool requires an internet connection as it uses real-time stock prices.
|
178 |
+
- Data is sourced from Yahoo Finance and FinanceDataReader.
|
179 |
+
|
180 |
+
### Disclaimer
|
181 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
182 |
"""
|
183 |
)
|
184 |
|
185 |
# Cost Averaging Tool Section
|
186 |
create_tool_section(
|
187 |
+
"DOLLAR-COST AVERAGING CALCULATOR",
|
188 |
"""
|
189 |
+
## ๐ธ ๋ฌผํ๊ธฐ ๊ณ์ฐ๊ธฐ
|
190 |
+
|
191 |
+
๋ฌผํ๊ธฐ(Dollar-Cost Averaging, DCA) ๊ณ์ฐ๊ธฐ๋ฅผ ์ด์ฉํด ๋ณด์ธ์! ์ด ๊ณ์ฐ๊ธฐ๋ ํน์ ์ฃผ์์ ๋ํ ์ถ๊ฐ ํฌ์๋ฅผ ํ ๋ ํ๊ท ๊ตฌ๋งค ๊ฐ๊ฒฉ์ ๊ณ์ฐํด์ค๋๋ค. ๐
|
192 |
+
|
193 |
+
### ์
๋ ฅ๊ฐ ์ค์ ๐
|
194 |
+
|
195 |
+
๋ค์์ ๊ฐ์ ์
๋ ฅํด ์ฃผ์ธ์:
|
196 |
+
|
197 |
+
- **์ด์ ํ๊ท ๊ฐ๊ฒฉ (old_avg_price)**: ๊ธฐ์กด ์ฃผ์์ ํ๊ท ๊ฐ๊ฒฉ ๐ต
|
198 |
+
- **์ด์ ์๋ (old_quantity)**: ๊ธฐ์กด ์ฃผ์์ ์๋ ๐ฆ
|
199 |
+
- **์ ๊ฐ๊ฒฉ (new_price)**: ์๋ก ๊ตฌ๋งคํ ์ฃผ์์ ๊ฐ๊ฒฉ ๐ฒ
|
200 |
+
- **์ ์๋ (new_quantity)**: ์๋ก ๊ตฌ๋งคํ ์ฃผ์์ ์๋ ๐
|
201 |
+
|
202 |
+
### ๊ณ์ฐ ๋ฐฉ๋ฒ ๐ข
|
203 |
+
|
204 |
+
1. **ํ์ฌ ํฌ์ ๊ธ์ก ๊ณ์ฐ**: ์ด์ ํ๊ท ๊ฐ๊ฒฉ๊ณผ ์ด์ ์๋์ ๊ณฑํ์ฌ ํ์ฌ ํฌ์ ๊ธ์ก์ ๊ณ์ฐํฉ๋๋ค.
|
205 |
+
2. **์ถ๊ฐ ํฌ์ ๊ธ์ก ๊ณ์ฐ**: ์ ๊ฐ๊ฒฉ๊ณผ ์ ์๋์ ๊ณฑํ์ฌ ์ถ๊ฐ ํฌ์ ๊ธ์ก์ ๊ณ์ฐํฉ๋๋ค.
|
206 |
+
3. **์ด ํฌ์ ๊ธ์ก ๋ฐ ์ด ์ฃผ์ ์ ๊ณ์ฐ**: ํ์ฌ ํฌ์ ๊ธ์ก๊ณผ ์ถ๊ฐ ํฌ์ ๊ธ์ก์ ํฉ์ณ์ ์ด ํฌ์ ๊ธ์ก์ ๊ณ์ฐํ๊ณ , ์ด์ ์๋๊ณผ ์ ์๋์ ๋ํ์ฌ ์ด ์ฃผ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
207 |
+
4. **์ ํ๊ท ๊ฐ๊ฒฉ ๊ณ์ฐ**: ์ด ํฌ์ ๊ธ์ก์ ์ด ์ฃผ์ ์๋ก ๋๋์ด ์๋ก์ด ํ๊ท ๊ฐ๊ฒฉ์ ๊ณ์ฐํฉ๋๋ค.
|
208 |
+
5. **์์ต๋ฅ ๊ณ์ฐ**: ์ด์ ๊ณผ ์๋ก์ด ์์ต๋ฅ ์ ๊ณ์ฐํ์ฌ ํฌ์ ๊ฒฐ๊ณผ๋ฅผ ๋ถ์ํฉ๋๋ค.
|
209 |
+
|
210 |
+
### ๊ฒฐ๊ณผ ๐ฏ
|
211 |
+
|
212 |
+
**1) ์ด์ ์์ต๋ฅ (Old Return)**
|
213 |
+
|
214 |
+
์ด์ ํ๊ท ๊ฐ๊ฒฉ์ ๊ธฐ์ค์ผ๋ก ํ ์์ต๋ฅ ์ ํ์ํฉ๋๋ค.
|
215 |
+
|
216 |
+
**2) ์๋ก์ด ์์ต๋ฅ (New Return)**
|
217 |
+
|
218 |
+
์๋ก์ด ํ๊ท ๊ฐ๊ฒฉ์ ๊ธฐ์ค์ผ๋ก ํ ์์ต๋ฅ ์ ํ์ํฉ๋๋ค.
|
219 |
+
|
220 |
+
**3) ์ถ๊ฐ ํฌ์ ๊ธ์ก (Additional Investment)**
|
221 |
+
|
222 |
+
์ถ๊ฐ๋ก ํฌ์ํ ๊ธ์ก์ ํ์ํฉ๋๋ค.
|
223 |
+
|
224 |
+
**4) ์๋ก์ด ํ๊ท ๊ฐ๊ฒฉ (Average Price)**
|
225 |
+
|
226 |
+
์๋กญ๊ฒ ๊ณ์ฐ๋ ํ๊ท ๊ฐ๊ฒฉ์ ํ์ํฉ๋๋ค.
|
227 |
+
|
228 |
+
**5) ์ด ์๋ (Total Quantity)**
|
229 |
+
|
230 |
+
์ด ์ฃผ์ ์๋์ ํ์ํฉ๋๋ค.
|
231 |
+
|
232 |
+
**6) ์ด ํฌ์ ๊ธ์ก (Total Investment)**
|
233 |
+
|
234 |
+
์ด ํฌ์ ๊ธ์ก์ ํ์ํฉ๋๋ค.
|
235 |
+
|
236 |
+
### ์์ ๐
|
237 |
+
|
238 |
+
- **์ด์ ํ๊ท ๊ฐ๊ฒฉ**: 100
|
239 |
+
- **์ด์ ์๋**: 10
|
240 |
+
- **์ ๊ฐ๊ฒฉ**: 120
|
241 |
+
- **์ ์๋**: 5
|
242 |
+
|
243 |
+
๊ฒฐ๊ณผ:
|
244 |
+
- ์๋ก์ด ํ๊ท ๊ฐ๊ฒฉ: 105
|
245 |
+
- ์ด ์๋: 15
|
246 |
+
- ์ด ํฌ์ ๊ธ์ก: 1,575
|
247 |
+
- ์ด์ ์์ต๋ฅ : 20.00%
|
248 |
+
- ์๋ก์ด ์์ต๋ฅ : 14.29%
|
249 |
+
- ์ถ๊ฐ ํฌ์ ๊ธ์ก: 600
|
250 |
+
|
251 |
+
๋ฌผํ๊ธฐ ๊ณ์ฐ๊ธฐ๋ฅผ ํตํด ํฌ์์ ํ๊ท ๊ตฌ๋งค ๊ฐ๊ฒฉ์ ์ฝ๊ฒ ๊ณ์ฐํด ๋ณด์ธ์! ๐๐ฐ
|
252 |
+
|
253 |
+
### ๋ฉด์ฑ
์กฐํญ
|
254 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๋ณด๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
255 |
""",
|
256 |
"""
|
257 |
+
## ๐ธ Dollar-Cost Averaging Calculator
|
258 |
+
|
259 |
+
Try out the Dollar-Cost Averaging (DCA) calculator! This tool helps you calculate the average purchase price of stocks when making additional investments. ๐
|
260 |
+
|
261 |
+
### Input Values ๐
|
262 |
+
|
263 |
+
Please enter the following details:
|
264 |
+
|
265 |
+
- **Old Average Price (old_avg_price)**: The average price of the existing stocks ๐ต
|
266 |
+
- **Old Quantity (old_quantity)**: The quantity of the existing stocks ๐ฆ
|
267 |
+
- **New Price (new_price)**: The price of the newly purchased stocks ๐ฒ
|
268 |
+
- **New Quantity (new_quantity)**: The quantity of the newly purchased stocks ๐
|
269 |
+
|
270 |
+
### Calculation Process ๐ข
|
271 |
+
|
272 |
+
1. **Current Investment**: Calculate the current investment amount by multiplying the old average price by the old quantity.
|
273 |
+
2. **Additional Investment**: Calculate the additional investment amount by multiplying the new price by the new quantity.
|
274 |
+
3. **Total Investment and Total Quantity**: Add the current investment amount and additional investment amount to get the total investment. Sum the old quantity and new quantity to get the total quantity of stocks.
|
275 |
+
4. **New Average Price**: Calculate the new average price by dividing the total investment by the total quantity of stocks.
|
276 |
+
5. **Return Calculation**: Calculate the old and new returns to analyze the investment results.
|
277 |
+
|
278 |
+
### Results ๐ฏ
|
279 |
+
|
280 |
+
**1) Old Return**
|
281 |
+
|
282 |
+
Displays the return based on the old average price.
|
283 |
+
|
284 |
+
**2) New Return**
|
285 |
+
|
286 |
+
Displays the return based on the new average price.
|
287 |
+
|
288 |
+
**3) Additional Investment**
|
289 |
+
|
290 |
+
Shows the amount of additional investment made.
|
291 |
+
|
292 |
+
**4) Average Price**
|
293 |
+
|
294 |
+
Displays the newly calculated average price.
|
295 |
+
|
296 |
+
**5) Total Quantity**
|
297 |
+
|
298 |
+
Shows the total quantity of stocks.
|
299 |
+
|
300 |
+
**6) Total Investment**
|
301 |
+
|
302 |
+
Displays the total investment amount.
|
303 |
+
|
304 |
+
### Example ๐
|
305 |
+
|
306 |
+
- **Old Average Price**: 100
|
307 |
+
- **Old Quantity**: 10
|
308 |
+
- **New Price**: 120
|
309 |
+
- **New Quantity**: 5
|
310 |
+
|
311 |
+
Results:
|
312 |
+
- New Average Price: 105
|
313 |
+
- Total Quantity: 15
|
314 |
+
- Total Investment: 1,575
|
315 |
+
- Old Return: 20.00%
|
316 |
+
- New Return: 14.29%
|
317 |
+
- Additional Investment: 600
|
318 |
+
|
319 |
+
Use the Dollar-Cost Averaging Calculator to easily compute the average purchase price of your investments! ๐๐ฐ
|
320 |
+
|
321 |
+
### Disclaimer
|
322 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
323 |
"""
|
324 |
)
|
325 |
|
326 |
# Retirement Planning Tool Section
|
327 |
create_tool_section(
|
328 |
+
"RETIREMENT PLANNING CALCULATOR",
|
329 |
"""
|
330 |
+
## ๐๏ธ ์ํด ๊ณํ ๊ณ์ฐ๊ธฐ ์ฌ์ฉ๋ฒ
|
331 |
+
|
332 |
+
์๋
ํ์ธ์! ๐ ์ํด ๊ณํ ๊ณ์ฐ๊ธฐ์ ์ค์ ๊ฒ์ ํ์ํฉ๋๋ค. ์ด ๋๊ตฌ๋ ์ฌ๋ฌ๋ถ์ ์ํด ํ ์ฌ์ ์ํฉ์ ์์ธกํ๊ณ ์ค๋นํ๋ ๋ฐ ๋์์ ์ค ๊ฑฐ์์. ์๋๋ ์ด ๊ณ์ฐ๊ธฐ์ ์๋ ๋ฐฉ์๊ณผ ํ์ํ ์ ๋ณด์
๋๋ค.
|
333 |
+
|
334 |
+
### 1. ์
๋ ฅ ๊ฐ ๐
|
335 |
+
|
336 |
+
๊ณ์ฐ๊ธฐ์์ ๋ค์ ์ ๋ณด๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์:
|
337 |
+
|
338 |
+
- **ํ์ฌ ๋์ด (current_age)**: ํ์ฌ ๋์ด ๐
|
339 |
+
- **์ํด ๋์ด (retirement_age)**: ์ํดํ๊ณ ์ถ์ ๋์ด ๐
|
340 |
+
- **ํ์ ๊ธฐ๋ ์๋ช
(life_expectancy)**: ์์๋๋ ํ์ ์๋ช
๐
|
341 |
+
- **์๋ณ ํ์ํ ์ํ๋น (monthly_income_required)**: ๋งค์ ํ์ํ ์ํ๋น ๐ต
|
342 |
+
- **์ธํ๋ ์ด์
์จ (inflation_rate)**: ๋ฌผ๊ฐ ์์น๋ฅ ๐
|
343 |
+
- **ํ์ฌ ํฌ์์ก (current_investment)**: ํ์ฌ ๋ณด์ ํ ํฌ์์ก ๐ฐ
|
344 |
+
- **์๋ณ ์ถ๊ฐ ํฌ์์ก (monthly_investment)**: ๋งค์ ์ถ๊ฐ๋ก ํฌ์ํ ๊ธ์ก ๐ธ
|
345 |
+
- **์๋ณ ํฌ์ ์ฆ๊ฐ์ก (monthly_increase_in_investment)**: ๋งค์ ์ฆ๊ฐํ ํฌ์์ก ๐
|
346 |
+
- **์ํด ์ ์์ต๋ฅ (pre_retirement_roi)**: ์ํด ์ ์์ ์ฐ ์์ต๋ฅ ๐
|
347 |
+
- **์ํด ์ ๋ฐฐ๋น ์์ต๋ฅ (pre_retirement_dividend_yield)**: ์ํด ์ ๋ฐฐ๋น๊ธ ์์ต๋ฅ ๐
|
348 |
+
- **๋ฐฐ๋น๊ธ ์ฌํฌ์ ์ฌ๋ถ (reinvest_dividends)**: ๋ฐฐ๋น๊ธ์ ์ฌํฌ์ํ ์ง ์ฌ๋ถ ๐
|
349 |
+
- **์ํด ํ ์์ต๋ฅ (post_retirement_roi)**: ์ํด ํ ์์ ์ฐ ์์ต๋ฅ ๐ฟ
|
350 |
+
- **์ํด ํ ๋ฐฐ๋น ์์ต๋ฅ (post_retirement_dividend_yield)**: ์ํด ํ ๋ฐฐ๋น๊ธ ์์ต๋ฅ ๐ต
|
351 |
+
|
352 |
+
### 2. ๊ณ์ฐ ๊ณผ์ ๐ข
|
353 |
+
|
354 |
+
**1) ์ํด ์ ์์ฐ ๊ณ์ฐ**
|
355 |
+
|
356 |
+
ํ์ฌ ์์ฐ๊ณผ ๋งค์ ์ถ๊ฐ ํฌ์์ก์ ๊ณ ๋ คํด ์ํด ์ ์์ฐ์ ๊ณ์ฐํด์. ์๋ณ ์์ต๋ฅ ์ ์ ์ฉํ์ฌ ์์ฐ์ด ์ด๋ป๊ฒ ์ฑ์ฅํ ์ง ์์ธกํฉ๋๋ค.
|
357 |
+
|
358 |
+
**๊ณต์:**
|
359 |
+
\[ \text{์๊ฐ ์์ต๋ฅ } = \left(1 + \frac{\text{์ฐ ์์ต๋ฅ }}{100}\right)^{\frac{1}{12}} - 1 \]
|
360 |
+
|
361 |
+
**2) ์ํด ํ ์์ฐ ๋ฐ ๋ฐฐ๋น ์์ต ๊ณ์ฐ**
|
362 |
+
|
363 |
+
์ํด ์์ ์ ์์ฐ๊ณผ ๋ฐฐ๋น ์์ต์ ๊ธฐ๋กํ๊ณ , ์ํด ํ ๋งค๋
์์ฐ๊ณผ ๋ฐฐ๋น ์์ต์ ์
๋ฐ์ดํธํฉ๋๋ค. ๋งค๋
ํ์ํ ์ํ๋น๋ ๋ฌผ๊ฐ ์์น๋ฅ ์ ๋ง์ถฐ ์กฐ์ ํฉ๋๋ค.
|
364 |
+
|
365 |
+
**3) ์ถ๊ฐ ํ๊ธ ํ์๋ ๊ณ์ฐ**
|
366 |
+
|
367 |
+
๋ฐฐ๋น ์์ต๊ณผ ํ์ํ ์ํ๋น๋ฅผ ๋น๊ตํ์ฌ ์ถ๊ฐ๋ก ํ์ํ ํ๊ธ์ ๊ณ์ฐํด์.
|
368 |
+
|
369 |
+
**๊ณต์:**
|
370 |
+
\[ \text{์ฐ๊ฐ ํ์ํ ์ํ๋น} = \text{์๋ณ ํ์ํ ์ํ๋น} \times 12 \]
|
371 |
+
\[ \text{์ถ๊ฐ ํ๊ธ ํ์๋} = \text{์ฐ๊ฐ ํ์ํ ์ํ๋น} - \text{์ฐ๊ฐ ๋ฐฐ๋น ์์ต} \]
|
372 |
+
|
373 |
+
### 3. ๊ฒฐ๊ณผ ์ถ๋ ฅ ๐
|
374 |
+
|
375 |
+
๊ณ์ฐ๋ ๊ฒฐ๊ณผ๋ ๋ค์๊ณผ ๊ฐ์ ํ์์ผ๋ก ์ ๊ณต๋ฉ๋๋ค:
|
376 |
+
|
377 |
+
- **์ํด ์งํ ํ์ํ ์ํ๋น**์ **๋ฐฐ๋น ์์ต**์ ํ๋์ ๋ณผ ์ ์์ด์.
|
378 |
+
- ์ํด ํ ๋งค๋
์์ฐ, ํ์ํ ์ํ๋น, ๋ฐฐ๋น ์์ต ๋ฑ์ ํ๋ก ํ์ธํ ์ ์์ต๋๋ค.
|
379 |
+
- ์ถ๊ฐ๋ก ํ์ํ ํ๊ธ์ ๊ณ์ฐํ์ฌ ์ด ํ์ ํ๊ธ์ ๋ณด์ฌ์ค๋๋ค.
|
380 |
+
|
381 |
+
### ์์ ๐
|
382 |
+
|
383 |
+
**์
๋ ฅ ๊ฐ ์์:**
|
384 |
+
|
385 |
+
- ํ์ฌ ๋์ด: 40์ธ
|
386 |
+
- ์ํด ๋์ด: 65์ธ
|
387 |
+
- ํ์ ๊ธฐ๋ ์๋ช
: 85์ธ
|
388 |
+
- ์๋ณ ํ์ํ ์ํ๋น: 2,000,000 ์
|
389 |
+
- ์ธํ๋ ์ด์
์จ: 2%
|
390 |
+
- ํ์ฌ ํฌ์์ก: 50,000,000 ์
|
391 |
+
- ์๋ณ ์ถ๊ฐ ํฌ์์ก: 500,000 ์
|
392 |
+
- ์๋ณ ํฌ์ ์ฆ๊ฐ์ก: 50,000 ์
|
393 |
+
- ์ํด ์ ์์ต๋ฅ : 5%
|
394 |
+
- ์ํด ์ ๋ฐฐ๋น ์์ต๋ฅ : 2%
|
395 |
+
- ๋ฐฐ๋น๊ธ ์ฌํฌ์ ์ฌ๋ถ: ์
|
396 |
+
- ์ํด ํ ์์ต๋ฅ : 4%
|
397 |
+
- ์ํด ํ ๋ฐฐ๋น ์์ต๋ฅ : 2%
|
398 |
+
|
399 |
+
**์ถ๋ ฅ ๊ฒฐ๊ณผ:**
|
400 |
+
|
401 |
+
- ์ํด ์งํ ์๋ณ ํ์ํ ์ํ๋น: 2,000,000 ์
|
402 |
+
- ์ํด ์งํ ์๋ณ ๋ฐฐ๋น ์์ต: 500,000 ์
|
403 |
+
- ์ด ์ถ๊ฐ ํ๊ธ ํ์๋: ๋งค๋
์ถ๊ฐ๋ก ํ์ํ ๊ธ์ก
|
404 |
+
|
405 |
+
**๊ทธ๋ํ์ CSV ํ์ผ ๐:**
|
406 |
+
|
407 |
+
- ์ํด ๊ณํ์ ์๊ฐ์ ์ผ๋ก ๋ณด์ฌ์ฃผ๋ ๊ทธ๋ํ์ ๊ณ์ฐ ๊ฒฐ๊ณผ๋ฅผ ํฌํจํ CSV ํ์ผ ๋ค์ด๋ก๋ ๋งํฌ๋ ์ ๊ณต๋ฉ๋๋ค.
|
408 |
+
|
409 |
+
์ํด ๊ณํ ๊ณ์ฐ๊ธฐ๋ฅผ ํตํด ์ฌ๋ฌ๋ถ์ ์ฌ์ ๊ณํ์ ๋ฏธ๋ฆฌ ์ค๋นํ๊ณ , ์์ ์ ์ธ ๋ฏธ๋๋ฅผ ๊ณํํด๋ณด์ธ์! ๐๐ผ
|
410 |
+
|
411 |
+
|
412 |
+
### ๋ฉด์ฑ
์กฐํญ
|
413 |
์ด ๋๊ตฌ์์ ์ ๊ณตํ๋ ์ ๏ฟฝ๏ฟฝ๋ ์ผ๋ฐ์ ์ธ ์ ๋ณด ์ ๊ณต ๋ชฉ์ ๋ง์ ์ํด ์ ๊ณต๋ฉ๋๋ค. ์ฌ์ดํธ์ ๋ชจ๋ ์ ๋ณด๋ ์ ์๋ก ์ ๊ณต๋์ง๋ง, ์ฌ์ดํธ์ ์ ๋ณด์ ์ ํ์ฑ, ์ ์ ์ฑ, ์ ํจ์ฑ, ์ ๋ขฐ์ฑ, ๊ฐ์ฉ์ฑ ๋๋ ์์ ์ฑ์ ๋ํด ๋ช
์์ ์ด๋ ๋ฌต์์ ์ด๋ ์ด๋ ํ ์ข
๋ฅ์ ์ง์ ์ด๋ ๋ณด์ฆ์ ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ฌ์ฉ๊ณผ ์ฌ์ดํธ์ ์ ๋ณด๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์ ์ ์ผ๋ก ์ฌ์ฉ์์ ์ฑ
์์
๋๋ค.
|
414 |
""",
|
415 |
"""
|
416 |
+
## ๐๏ธ Retirement Planning Calculator Guide
|
417 |
+
|
418 |
+
Welcome to the Retirement Planning Calculator! ๐ This tool helps you forecast and prepare for your financial situation after retirement. Hereโs how it works and what information you need to provide:
|
419 |
+
|
420 |
+
### 1. Input Values ๐
|
421 |
+
|
422 |
+
Please provide the following details:
|
423 |
+
|
424 |
+
- **Current Age (current_age)**: Your current age ๐
|
425 |
+
- **Retirement Age (retirement_age)**: Age at which you plan to retire ๐
|
426 |
+
- **Life Expectancy (life_expectancy)**: Expected lifespan ๐
|
427 |
+
- **Monthly Income Required (monthly_income_required)**: Monthly expenses needed ๐ต
|
428 |
+
- **Inflation Rate (inflation_rate)**: Rate of inflation ๐
|
429 |
+
- **Current Investment (current_investment)**: Amount currently invested ๐ฐ
|
430 |
+
- **Monthly Investment (monthly_investment)**: Additional monthly investment ๐ธ
|
431 |
+
- **Monthly Increase in Investment (monthly_increase_in_investment)**: Increase in monthly investment ๐
|
432 |
+
- **Pre-Retirement ROI (pre_retirement_roi)**: Expected annual return before retirement ๐
|
433 |
+
- **Pre-Retirement Dividend Yield (pre_retirement_dividend_yield)**: Dividend yield before retirement ๐
|
434 |
+
- **Reinvest Dividends (reinvest_dividends)**: Whether to reinvest dividends ๐
|
435 |
+
- **Post-Retirement ROI (post_retirement_roi)**: Expected annual return after retirement ๐ฟ
|
436 |
+
- **Post-Retirement Dividend Yield (post_retirement_dividend_yield)**: Dividend yield after retirement ๐ต
|
437 |
+
|
438 |
+
### 2. Calculation Process ๐ข
|
439 |
+
|
440 |
+
**1) Pre-Retirement Asset Calculation**
|
441 |
+
|
442 |
+
The calculator uses your current assets and monthly contributions to forecast your asset growth before retirement. Monthly returns are applied to estimate how your assets will grow.
|
443 |
+
|
444 |
+
**Formula:**
|
445 |
+
\[ \text{Monthly Return} = \left(1 + \frac{\text{Annual ROI}}{100}\right)^{\frac{1}{12}} - 1 \]
|
446 |
+
|
447 |
+
**2) Post-Retirement Asset and Dividend Income Calculation**
|
448 |
+
|
449 |
+
The calculator tracks your assets and dividend income at retirement, then updates these figures annually. It also adjusts monthly income needs for inflation.
|
450 |
+
|
451 |
+
**3) Additional Cash Needed Calculation**
|
452 |
+
|
453 |
+
It compares dividend income with required income to determine if additional cash is needed.
|
454 |
+
|
455 |
+
**Formula:**
|
456 |
+
\[ \text{Annual Income Required} = \text{Monthly Income Required} \times 12 \]
|
457 |
+
\[ \text{Additional Cash Required} = \text{Annual Income Required} - \text{Annual Dividend Income} \]
|
458 |
+
|
459 |
+
### 3. Results ๐
|
460 |
+
|
461 |
+
The results are displayed as follows:
|
462 |
+
|
463 |
+
- **Immediate Post-Retirement Income Needs** and **Dividend Income** for easy comparison.
|
464 |
+
- Annual asset, required income, and dividend income details in a table.
|
465 |
+
- Total additional cash required to cover any shortfall.
|
466 |
+
|
467 |
+
### Example ๐
|
468 |
+
|
469 |
+
**Example Input Values:**
|
470 |
+
|
471 |
+
- Current Age: 40 years
|
472 |
+
- Retirement Age: 65 years
|
473 |
+
- Life Expectancy: 85 years
|
474 |
+
- Monthly Income Required: $2,000
|
475 |
+
- Inflation Rate: 2%
|
476 |
+
- Current Investment: $50,000
|
477 |
+
- Monthly Investment: $500
|
478 |
+
- Monthly Increase in Investment: $50
|
479 |
+
- Pre-Retirement ROI: 5%
|
480 |
+
- Pre-Retirement Dividend Yield: 2%
|
481 |
+
- Reinvest Dividends: Yes
|
482 |
+
- Post-Retirement ROI: 4%
|
483 |
+
- Post-Retirement Dividend Yield: 2%
|
484 |
+
|
485 |
+
**Output Results:**
|
486 |
+
|
487 |
+
- Monthly Income Required Immediately After Retirement: $2,000
|
488 |
+
- Monthly Dividend Income Immediately After Retirement: $500
|
489 |
+
- Total Additional Cash Required: Amount needed annually
|
490 |
+
|
491 |
+
**Graph and CSV File ๐:**
|
492 |
+
|
493 |
+
- Visual graphs of the retirement plan and a CSV file with detailed calculations are available for download.
|
494 |
+
|
495 |
+
Use the Retirement Planning Calculator to prepare for your future and ensure a secure retirement! ๐๐ผ
|
496 |
+
|
497 |
+
### Disclaimer
|
498 |
The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
|
499 |
"""
|
500 |
)
|
interface/retirement_planning_interface.py
CHANGED
@@ -2,11 +2,22 @@ import gradio as gr
|
|
2 |
from modules.utils import load_css
|
3 |
from modules.retirement_planning import retirement_planning
|
4 |
|
5 |
-
def retirement_planning_interface_fn(
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
css = load_css()
|
8 |
return css + result
|
9 |
|
|
|
10 |
current_age = gr.Slider(label="Current Age (15-60 Years)", value=15, minimum=15, maximum=60, step=1)
|
11 |
retirement_age = gr.Slider(label="Retirement Age (Upto 70 Years)", value=55, minimum=15, maximum=70, step=1)
|
12 |
life_expectancy = gr.Slider(label="Life Expectancy (Upto 100 Years)", value=80, minimum=30, maximum=100, step=1)
|
@@ -14,19 +25,28 @@ monthly_income_required = gr.Number(label="Monthly Income Required In Retirement
|
|
14 |
inflation_rate = gr.Number(label="Expected Inflation Rate (%)", value=3)
|
15 |
current_investment = gr.Number(label="Current Investment", value=10000000)
|
16 |
monthly_investment = gr.Number(label="Monthly Investment", value=500000)
|
|
|
17 |
pre_retirement_roi = gr.Number(label="Expected Return On Investment (Pre-retirement) (%)", value=8)
|
18 |
pre_retirement_dividend_yield = gr.Number(label="Expected Dividend Yield (Pre-retirement) (%)", value=3.3)
|
19 |
reinvest_dividends = gr.Checkbox(label="Reinvest Dividends", value=True)
|
20 |
|
21 |
-
|
22 |
# ์ํด ํ ์
๋ ฅ
|
23 |
markdown = gr.Markdown("### Post-retirement")
|
24 |
post_retirement_roi = gr.Number(label="Expected Return On Investment (Post-retirement) (%)", value=8)
|
25 |
post_retirement_dividend_yield = gr.Number(label="Expected Dividend Yield (Post-retirement) (%)", value=3.3)
|
26 |
|
27 |
-
|
28 |
output = gr.HTML()
|
29 |
|
30 |
# Define the update function
|
31 |
-
def update_output(
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from modules.utils import load_css
|
3 |
from modules.retirement_planning import retirement_planning
|
4 |
|
5 |
+
def retirement_planning_interface_fn(
|
6 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
7 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์ธ์
|
8 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends,
|
9 |
+
post_retirement_roi, post_retirement_dividend_yield
|
10 |
+
):
|
11 |
+
result = retirement_planning(
|
12 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
13 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์ธ์
|
14 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends,
|
15 |
+
post_retirement_roi, post_retirement_dividend_yield
|
16 |
+
)
|
17 |
css = load_css()
|
18 |
return css + result
|
19 |
|
20 |
+
# Define the input components
|
21 |
current_age = gr.Slider(label="Current Age (15-60 Years)", value=15, minimum=15, maximum=60, step=1)
|
22 |
retirement_age = gr.Slider(label="Retirement Age (Upto 70 Years)", value=55, minimum=15, maximum=70, step=1)
|
23 |
life_expectancy = gr.Slider(label="Life Expectancy (Upto 100 Years)", value=80, minimum=30, maximum=100, step=1)
|
|
|
25 |
inflation_rate = gr.Number(label="Expected Inflation Rate (%)", value=3)
|
26 |
current_investment = gr.Number(label="Current Investment", value=10000000)
|
27 |
monthly_investment = gr.Number(label="Monthly Investment", value=500000)
|
28 |
+
monthly_increase_in_investment = gr.Number(label="Monthly Increase in Investment", value=0) # ์ถ๊ฐ๋ ์
๋ ฅ
|
29 |
pre_retirement_roi = gr.Number(label="Expected Return On Investment (Pre-retirement) (%)", value=8)
|
30 |
pre_retirement_dividend_yield = gr.Number(label="Expected Dividend Yield (Pre-retirement) (%)", value=3.3)
|
31 |
reinvest_dividends = gr.Checkbox(label="Reinvest Dividends", value=True)
|
32 |
|
|
|
33 |
# ์ํด ํ ์
๋ ฅ
|
34 |
markdown = gr.Markdown("### Post-retirement")
|
35 |
post_retirement_roi = gr.Number(label="Expected Return On Investment (Post-retirement) (%)", value=8)
|
36 |
post_retirement_dividend_yield = gr.Number(label="Expected Dividend Yield (Post-retirement) (%)", value=3.3)
|
37 |
|
|
|
38 |
output = gr.HTML()
|
39 |
|
40 |
# Define the update function
|
41 |
+
def update_output(
|
42 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
43 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์ธ์
|
44 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends,
|
45 |
+
post_retirement_roi, post_retirement_dividend_yield
|
46 |
+
):
|
47 |
+
return retirement_planning_interface_fn(
|
48 |
+
current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate,
|
49 |
+
current_investment, monthly_investment, monthly_increase_in_investment, # ์ถ๊ฐ๋ ์ธ์
|
50 |
+
pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends,
|
51 |
+
post_retirement_roi, post_retirement_dividend_yield
|
52 |
+
)
|
modules/retirement_planning.py
CHANGED
@@ -6,12 +6,27 @@ import io
|
|
6 |
|
7 |
from modules.utils import load_css
|
8 |
|
9 |
-
def retirement_planning(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# NoneType์ผ ๋ 0์ผ๋ก ์ฒ๋ฆฌ
|
11 |
current_age = current_age if current_age is not None else 0
|
12 |
retirement_age = retirement_age if retirement_age is not None else 0
|
13 |
current_investment = current_investment if current_investment is not None else 0
|
14 |
monthly_investment = monthly_investment if monthly_investment is not None else 0
|
|
|
15 |
pre_retirement_roi = pre_retirement_roi if pre_retirement_roi is not None else 0
|
16 |
post_retirement_roi = post_retirement_roi if post_retirement_roi is not None else 0
|
17 |
pre_retirement_dividend_yield = pre_retirement_dividend_yield if pre_retirement_dividend_yield is not None else 0
|
@@ -44,6 +59,8 @@ def retirement_planning(current_age=None, retirement_age=None, life_expectancy=N
|
|
44 |
# ๋ฐฐ๋น๊ธ์ ์ฌํฌ์ํ ๊ฒฝ์ฐ ๋ฐฐ๋น๊ธ ์ถ๊ฐ
|
45 |
if reinvest_dividends:
|
46 |
total_investment += total_investment * (pre_retirement_dividend_yield / 100 / 12)
|
|
|
|
|
47 |
|
48 |
# ์ํด ์์ ์์ ์ ์ด ํฌ์์ก๊ณผ ์ฐ๊ฐ ๋ฐฐ๋น ์์ต ์ ์ฅ
|
49 |
investment_at_retirement = total_investment
|
|
|
6 |
|
7 |
from modules.utils import load_css
|
8 |
|
9 |
+
def retirement_planning(
|
10 |
+
current_age=None,
|
11 |
+
retirement_age=None,
|
12 |
+
life_expectancy=None,
|
13 |
+
monthly_income_required=None,
|
14 |
+
inflation_rate=None,
|
15 |
+
current_investment=None,
|
16 |
+
monthly_investment=None,
|
17 |
+
monthly_increase_in_investment=None, # ์ถ๊ฐ๋ ์
๋ ฅ
|
18 |
+
pre_retirement_roi=None,
|
19 |
+
pre_retirement_dividend_yield=None,
|
20 |
+
reinvest_dividends=None,
|
21 |
+
post_retirement_roi=None,
|
22 |
+
post_retirement_dividend_yield=None
|
23 |
+
):
|
24 |
# NoneType์ผ ๋ 0์ผ๋ก ์ฒ๋ฆฌ
|
25 |
current_age = current_age if current_age is not None else 0
|
26 |
retirement_age = retirement_age if retirement_age is not None else 0
|
27 |
current_investment = current_investment if current_investment is not None else 0
|
28 |
monthly_investment = monthly_investment if monthly_investment is not None else 0
|
29 |
+
monthly_increase_in_investment = monthly_increase_in_investment if monthly_increase_in_investment is not None else 0
|
30 |
pre_retirement_roi = pre_retirement_roi if pre_retirement_roi is not None else 0
|
31 |
post_retirement_roi = post_retirement_roi if post_retirement_roi is not None else 0
|
32 |
pre_retirement_dividend_yield = pre_retirement_dividend_yield if pre_retirement_dividend_yield is not None else 0
|
|
|
59 |
# ๋ฐฐ๋น๊ธ์ ์ฌํฌ์ํ ๊ฒฝ์ฐ ๋ฐฐ๋น๊ธ ์ถ๊ฐ
|
60 |
if reinvest_dividends:
|
61 |
total_investment += total_investment * (pre_retirement_dividend_yield / 100 / 12)
|
62 |
+
# ์ฐ๊ฐ ์ฆ๊ฐ์ก์ ์ ํฌ์์ก์ ์ถ๊ฐ
|
63 |
+
monthly_investment += monthly_increase_in_investment
|
64 |
|
65 |
# ์ํด ์์ ์์ ์ ์ด ํฌ์์ก๊ณผ ์ฐ๊ฐ ๋ฐฐ๋น ์์ต ์ ์ฅ
|
66 |
investment_at_retirement = total_investment
|