cryman38 commited on
Commit
5b6f62b
ยท
verified ยท
1 Parent(s): e222b17

Upload 14 files

Browse files
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 current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, markdown as retirement_markdown, post_retirement_roi, post_retirement_dividend_yield, output as retirement_output, update_output as retirement_update_output
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, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
 
 
112
  ]),
113
  inputs=[],
114
  outputs=[
115
- current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
 
 
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, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
 
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, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield
 
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
- "1๏ธโƒฃ RE-BALANCING CALCULATOR",
16
  """
17
- # ํฌํŠธํด๋ฆฌ์˜ค ๋ฆฌ๋ฐธ๋Ÿฐ์‹ฑ ๋„๊ตฌ
18
 
19
- ์ด ๋„๊ตฌ๋Š” ํˆฌ์ž์ž๋“ค์ด ํ˜„์žฌ ๋ณด์œ  ์ž์‚ฐ์„ ๋ถ„์„ํ•˜๊ณ  ๋ชฉํ‘œ ๋ฐฐ๋ถ„์„ ๋‹ฌ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ๋งค์ˆ˜/๋งค๋„ ์กฐ์น˜๋ฅผ ์ œ์•ˆํ•˜์—ฌ ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ์žฌ์กฐ์ •ํ•˜๋Š” ๋ฐ ๋„์›€์„ ์ค๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ์ฃผ์‹ ์ฝ”๋“œ, ํ†ตํ™” ๋ฐ ์›ํ•˜๋Š” ๋ชฉํ‘œ ๋น„์œจ์„ ๊ณ ๋ คํ•˜์—ฌ ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ์กฐ์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
20
 
21
- ## ์ฃผ์š” ๊ธฐ๋Šฅ
22
- - **๋‹ค์ค‘ ํ†ตํ™” ์ง€์›**: ๋ชจ๋“  ๊ธˆ์•ก์€ ๋ฉ”์ธ ํ†ตํ™”๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค.
23
- - **์ƒ์„ธ ๋ถ„์„**: ํ˜„์žฌ ํฌํŠธํด๋ฆฌ์˜ค, ํ†ตํ™” ๋ฐฐ๋ถ„ ๋ฐ ๋ฆฌ๋ฐธ๋Ÿฐ์‹ฑ ๊ถŒ์žฅ ์‚ฌํ•ญ์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ๋ฆฌ๋ฐธ๋Ÿฐ์‹ฑ ๊ณ„์‚ฐ์‹œ 1์ฃผ๋‹จ์œ„๋กœ ๊ณ„์‚ฐ๋ฉ๋‹ˆ๋‹ค.
24
 
25
- ## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•
26
- 1. **ํฌํŠธํด๋ฆฌ์˜ค ์„ธ๋ถ€ ์ •๋ณด ์ž…๋ ฅ**: ์ง€์ •๋œ ํ˜•์‹์œผ๋กœ `์ฃผ์‹์ฝ”๋“œ ํ†ตํ™” ๋ณด์œ ์ˆ˜๋Ÿ‰ ๋ชฉํ‘œ๋น„์ค‘`์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ข…๋ชฉ์•ˆ์˜ ํ•ญ๋ชฉ๋“ค์€ ๋„์–ด์“ฐ๊ธฐ๋กœ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ ์ฃผ์‹์ข…๋ชฉ์„ (,)๋กœ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.
27
- 2. **ํ˜„๊ธˆ ๊ธˆ์•ก ๋ฐ ๋น„์œจ ์„ค์ •**: ์œ ์ง€ํ•˜๋ ค๋Š” ํ˜„๊ธˆ ๊ธˆ์•ก ๋ฐ ๋น„์œจ(%)์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
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
- # RE-BALANCING CALCULATOR
 
 
49
 
50
- This tool helps investors rebalance their portfolios by analyzing their current holdings and suggesting buy/sell actions to achieve target allocations. It provides detailed information on how to adjust the portfolio, considering various stock codes, currencies, and desired target ratios.
51
 
52
- ## Key Features
53
- - **Multi-currency Support**: All amounts are converted to the main currency.
54
- - **Detailed Analysis**: Displays current portfolio, currency allocation, and rebalancing recommendations. Rebalancing is calculated on a per-share basis.
55
 
56
- ## How to Use
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
- ## Example Input
61
- ```
62
- AAPL USD 100 2,
63
- TSLA USD 50 1,
64
- 005930 KRW 200 3
65
- ```
66
- - `AAPL USD 100 2`: 100 shares of Apple (AAPL) in USD, target ratio 2.
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
- ## Important Notes
 
 
 
 
 
 
 
 
 
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
- ## Disclaimer
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
- "2๏ธโƒฃ SHARE PRICE TREND CALCULATOR",
83
  """
84
- # ์ฃผ๊ฐ€ ๋™ํ–ฅ ๋น„๊ต
85
-
86
- ์ด ๋„๊ตฌ๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์ง€์ •ํ•œ ๊ธฐ๊ฐ„ ๋™์•ˆ ์—ฌ๋Ÿฌ ํšŒ์‚ฌ์˜ ์ƒ๋Œ€ ์ฃผ๊ฐ€๋ฅผ ๋น„๊ตํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ์—ญ์‚ฌ์ ์ธ ์ฃผ๊ฐ€๋ฅผ ๊ฐ€์ ธ์™€ ์ƒ๋Œ€ ์„ฑ๋Šฅ์„ ๋ณด์—ฌ์ฃผ๋„๋ก ์ •์ƒํ™”ํ•˜๊ณ  ๋น„๊ต ๊ทธ๋ž˜ํ”„๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
87
-
88
- ## ์ฃผ์š” ๊ธฐ๋Šฅ
89
- - **์ฃผ์‹ ๋น„๊ต**: ์‚ฌ์šฉ์ž๊ฐ€ ์ •์˜ํ•œ ๊ธฐ๊ฐ„ ๋™์•ˆ ์—ฌ๋Ÿฌ ์ฃผ์‹์˜ ์„ฑ๋Šฅ์„ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค.
90
- - **์ƒ๋Œ€์  ๊ฐ€๊ฒฉ๋น„๊ต**: ๊ฐ€๊ฒฉ์„ ๋™์ผํ•œ ๊ธฐ์ค€์„ ์—์„œ ์‹œ์ž‘ํ•˜๋Š” ์ƒ๋Œ€์ ์ธ ๋ณ€ํ™”๋ฅผ ๋ณด์—ฌ์ฃผ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
91
-
92
- ## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•
93
- 1. **์ฃผ์‹ ์ฝ”๋“œ ์ž…๋ ฅ**: ์‰ผํ‘œ๋กœ ๊ตฌ๋ถ„๋œ ์ฃผ์‹ ์ฝ”๋“œ ๋ชฉ๋ก์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค (์˜ˆ: `AAPL, GOOGL, TSLA`).
94
- 2. **๋‚ ์งœ ์ˆ˜ ์ง€์ •**: ์ฃผ๊ฐ€๋ฅผ ๋น„๊ตํ•  ๊ธฐ๊ฐ„์˜ ๋‚ ์งœ ์ˆ˜๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
95
- 3. **์ถœ๋ ฅ**: ์ฃผ๊ฐ€๋ฅผ ๊ฐ€์ ธ์™€ ๋น„๊ต ๊ทธ๋ž˜ํ”„๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
96
-
97
- ## ์˜ˆ์ œ ์ž…๋ ฅ
98
- - `์ฃผ์‹ ์ฝ”๋“œ`: AAPL, GOOGL, TSLA
99
- - `๋‚ ์งœ ์ˆ˜`: 30
100
-
101
- ## ์˜ˆ์ œ ์ถœ๋ ฅ
102
- - Apple (AAPL), Google (GOOGL), Tesla (TSLA)์˜ ์ตœ๊ทผ 30์ผ๊ฐ„์˜ ์ƒ๋Œ€ ์ฃผ๊ฐ€๋ฅผ ๋น„๊ตํ•˜๋Š” ๊ทธ๋ž˜ํ”„.
103
-
104
- ## ์ค‘์š” ์‚ฌํ•ญ
105
- - ๋ชจ๋“  ์ฃผ์‹ ์ฝ”๋“œ๊ฐ€ ์œ ํšจํ•˜๊ณ  ๋ฐ์ดํ„ฐ ์†Œ์Šค์—์„œ ์ง€์›ํ•˜๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.
106
- - ๋„๊ตฌ๋Š” ์˜์—…์ผ ๊ธฐ์ค€์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋ฏ€๋กœ ์ฃผ๋ง ๋ฐ ๊ณตํœด์ผ์€ ์ œ์™ธ๋ฉ๋‹ˆ๋‹ค.
107
- - ์ด ๋„๊ตฌ๋Š” ์ฃผ๊ฐ€ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋ฏ€๋กœ ์ธํ„ฐ๋„ท ์—ฐ๊ฒฐ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
108
- - FinanceDataReader๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ฃผ๊ฐ€ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
109
- - ๊ทธ๋ž˜ํ”ฝ ์‹œ๊ฐํ™”๋ฅผ ์œ„ํ•ด matplotlib์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐœ๋ฐœ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
110
-
111
- ## ๋ฉด์ฑ… ์กฐํ•ญ
 
 
 
 
 
 
 
 
 
 
 
 
112
  ์ด ๋„๊ตฌ์—์„œ ์ œ๊ณตํ•˜๋Š” ์ •๋ณด๋Š” ์ผ๋ฐ˜์ ์ธ ์ •๋ณด ์ œ๊ณต ๋ชฉ์ ๋งŒ์„ ์œ„ํ•ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์ดํŠธ์˜ ๋ชจ๋“  ์ •๋ณด๋Š” ์„ ์˜๋กœ ์ œ๊ณต๋˜์ง€๋งŒ, ์‚ฌ์ดํŠธ์˜ ์ •๋ณด์˜ ์ •ํ™•์„ฑ, ์ ์ ˆ์„ฑ, ์œ ํšจ์„ฑ, ์‹ ๋ขฐ์„ฑ, ๊ฐ€์šฉ์„ฑ ๋˜๋Š” ์™„์ „์„ฑ์— ๋Œ€ํ•ด ๋ช…์‹œ์ ์ด๋“  ๋ฌต์‹œ์ ์ด๋“  ์–ด๋– ํ•œ ์ข…๋ฅ˜์˜ ์ง„์ˆ ์ด๋‚˜ ๋ณด์ฆ์„ ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์‚ฌ์ดํŠธ์˜ ์‚ฌ์šฉ๊ณผ ์‚ฌ์ดํŠธ์˜ ์ •๋ณด๋ฅผ ์‹ ๋ขฐํ•˜๋Š” ๊ฒƒ์€ ์ „์ ์œผ๋กœ ์‚ฌ์šฉ์ž์˜ ์ฑ…์ž„์ž…๋‹ˆ๋‹ค.
113
  """,
114
  """
115
- # SHARE PRICE TREND CALCULATOR
 
 
 
 
116
 
117
- This tool allows users to compare the relative prices of multiple companies over a specified period. It fetches historical stock prices, normalizes them to show relative performance, and generates a comparison graph.
 
118
 
119
- ## Key Features
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
- ## How to Use
124
- 1. **Enter Stock Codes**: Provide a comma-separated list of stock codes (e.g., `AAPL, GOOGL, TSLA`).
125
- 2. **Specify Number of Days**: Enter the number of days for the comparison period.
126
- 3. **Output**: Fetches stock prices and displays a comparison graph.
 
 
127
 
128
- ## Example Input
129
- - `Stock Codes`: AAPL, GOOGL, TSLA
130
- - `Number of Days`: 30
131
 
132
- ## Example Output
133
- - A graph comparing the relative stock prices of Apple (AAPL), Google (GOOGL), and Tesla (TSLA) over the last 30 days.
134
 
135
- ## Important Notes
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
- ## Disclaimer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- "3๏ธโƒฃ DOLLAR-COST AVERAGING CALCULATOR",
150
  """
151
- # ๋ฌผํƒ€๊ธฐ ๊ณ„์‚ฐ ๋„๊ตฌ
152
-
153
- ์ด ๋„๊ตฌ๋Š” ํˆฌ์ž์ž๊ฐ€ ๋‹ค๋ฅธ ๊ฐ€๊ฒฉ์œผ๋กœ ์ถ”๊ฐ€ ์ฃผ์‹์„ ๋งค์ˆ˜ํ•œ ํ›„ ์ƒˆ๋กœ์šด ํ‰๊ท  ๋งค์ˆ˜ ๋‹จ๊ฐ€์™€ ์ˆ˜์ต๋ฅ ์„ ๊ณ„์‚ฐํ•˜๋Š” ๋ฐ ๋„์›€์„ ์ค๋‹ˆ๋‹ค. ์ƒˆ๋กœ์šด ํˆฌ์ž๊ฐ€ ์ „์ฒด ๋น„์šฉ ๊ธฐ๋ฐ˜๊ณผ ์ž ์žฌ์  ์ˆ˜์ต์— ๋ฏธ์น˜๋Š” ์˜ํ–ฅ์„ ์ดํ•ดํ•˜๋Š” ๋ฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
154
-
155
- ## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•
156
- 1. **ํ˜„์žฌ ํˆฌ์ž ์„ธ๋ถ€ ์ •๋ณด ์ž…๋ ฅ**: ๋ณด์œ ํ•œ ์ฃผ์‹์˜ ํ‰๊ท  ๊ฐ€๊ฒฉ๊ณผ ์ˆ˜๋Ÿ‰์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
157
- 2. **์ƒˆ๋กœ์šด ๋งค์ˆ˜ ์„ธ๋ถ€ ์ •๋ณด ์ž…๋ ฅ**: ๋งค์ˆ˜ํ•˜๋ ค๋Š” ์ฃผ์‹์˜ ๊ฐ€๊ฒฉ๊ณผ ์ˆ˜๋Ÿ‰์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
158
- 3. **์ถœ๋ ฅ**: ๋„๊ตฌ๋Š” ์ƒˆ๋กœ์šด ํ‰๊ท  ๊ฐ€๊ฒฉ, ์ด ์ˆ˜๋Ÿ‰, ์ถ”๊ฐ€ ํˆฌ์ž์•ก, ์ด ํˆฌ์ž์•ก ๋ฐ ์ƒˆ๋กœ์šด ์ˆ˜์ต๋ฅ ์„ ๊ณ„์‚ฐํ•˜๊ณ  ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
159
-
160
- ## ์˜ˆ์ œ ์ž…๋ ฅ
161
- - `์ด์ „ ํ‰๊ท  ๊ฐ€๊ฒฉ`: 100
162
- - `์ด์ „ ์ˆ˜๋Ÿ‰`: 50
163
- - `์ƒˆ๋กœ์šด ๊ฐ€๊ฒฉ`: 120
164
- - `์ƒˆ๋กœ์šด ์ˆ˜๋Ÿ‰`: 30
165
-
166
- ## ์˜ˆ์ œ ์ถœ๋ ฅ
167
- - `์ˆ˜์ต๋ฅ `: 11.1%
168
- - `์ƒˆ๋กœ์šด ํ‰๊ท  ๊ฐ€๊ฒฉ`: 108
169
- - `์ด ์ˆ˜๋Ÿ‰`: 80
170
- - `์ถ”๊ฐ€ ํˆฌ์ž๊ธˆ`: 3600
171
- - `์ด ํˆฌ์ž๊ธˆ`: 8640
172
-
173
- ## ์ค‘์š” ์‚ฌํ•ญ
174
- - ๋ชจ๋“  ์ž…๋ ฅ์ด ์œ ํšจํ•œ ์ˆซ์ž์ธ์ง€ ํ™•์ธํ•˜์„ธ์š”.
175
- - ๋„๊ตฌ๋Š” ์ด์ „ ๋ฐ ์ƒˆ๋กœ์šด ํˆฌ์ž์˜ ๊ฐ€์ค‘ ํ‰๊ท ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ƒˆ๋กœ์šด ํ‰๊ท  ๊ฐ€๊ฒฉ์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.
176
- - ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฌ์šด ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค ์ƒ์„ฑ์„ ์œ„ํ•ด Gradio๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐœ๋ฐœ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
177
- - ์‹ค์‹œ๊ฐ„ ๊ณ„์‚ฐ ๋ฐ ์ฆ‰๊ฐ์ ์ธ ํ”ผ๋“œ๋ฐฑ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
178
-
179
- ## ๋ฉด์ฑ… ์กฐํ•ญ
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  ์ด ๋„๊ตฌ์—์„œ ์ œ๊ณตํ•˜๋Š” ์ •๋ณด๋Š” ์ผ๋ฐ˜์ ์ธ ์ •๋ณด ์ œ๊ณต ๋ชฉ์ ๋งŒ์„ ์œ„ํ•ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์ดํŠธ์˜ ๋ชจ๋“  ์ •๋ณด๋Š” ์„ ์˜๋กœ ์ œ๊ณต๋˜์ง€๋งŒ, ์‚ฌ์ดํŠธ์˜ ์ •๋ณด์˜ ์ •ํ™•์„ฑ, ์ ์ ˆ์„ฑ, ์œ ํšจ์„ฑ, ์‹ ๋ขฐ์„ฑ, ๊ฐ€์šฉ์„ฑ ๋˜๋Š” ์™„์ „์„ฑ์— ๋Œ€ํ•ด ๋ช…์‹œ์ ์ด๋“  ๋ฌต์‹œ์ ์ด๋“  ์–ด๋– ํ•œ ์ข…๋ฅ˜์˜ ์ง„์ˆ ์ด๋‚˜ ๋ณด์ฆ์„ ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์‚ฌ์ดํŠธ์˜ ์‚ฌ์šฉ๊ณผ ์‚ฌ์ดํŠธ์˜ ์ •๋ณด๋ฅผ ์‹ ๋ขฐํ•˜๋Š” ๊ฒƒ์€ ์ „์ ์œผ๋กœ ์‚ฌ์šฉ์ž์˜ ์ฑ…์ž„์ž…๋‹ˆ๋‹ค.
181
  """,
182
  """
183
- # Dollar-Cost Averaging Calculator
184
-
185
- This tool helps investors calculate the new average purchase price and yield after purchasing additional shares at different prices. It is useful for understanding the impact of new investments on the overall cost basis and potential returns.
186
-
187
- ## How to Use
188
- 1. **Enter Current Investment Details**: Provide the average price and quantity of the shares you hold.
189
- 2. **Enter New Purchase Details**: Provide the price and quantity of the shares you want to purchase.
190
- 3. **Output**: The tool calculates and displays the new average price, total quantity, additional investment amount, total investment amount, and new yield.
191
-
192
- ## Example Input
193
- - `Previous Average Price`: 100
194
- - `Previous Quantity`: 50
195
- - `New Price`: 120
196
- - `New Quantity`: 30
197
-
198
- ## Example Output
199
- - `Return`: 11.1%
200
- - `New Average Price`: 108
201
- - `Total Quantity`: 80
202
- - `Additional Investment Amount`: 3600
203
- - `Total Investment Amount`: 8640
204
-
205
- ## Important Notes
206
- - Ensure all inputs are valid numbers.
207
- - The tool calculates the new average price based on the weighted average of previous and new investments.
208
- - Developed using Gradio for an easy-to-use user interface.
209
- - Supports real-time calculations and instant feedback.
210
-
211
- ## Disclaimer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- "4๏ธโƒฃ RETIREMENT PLANNING CALCULATOR",
219
  """
220
- # ์€ํ‡ด ๊ณ„ํš ๋„๊ตฌ
221
-
222
- ์ด ๋„๊ตฌ๋Š” ๊ฐœ์ธ์ด ์€ํ‡ด ์‹œ์ ๊นŒ์ง€ ํˆฌ์ž ์„ฑ์žฅ๊ณผ ์€ํ‡ด ํ›„ ๋ฐฐ๋‹น ์†Œ๋“์„ ์˜ˆ์ธกํ•˜์—ฌ ์€ํ‡ด ๊ณ„ํš์„ ์„ธ์šฐ๋Š” ๋ฐ ๋„์›€์„ ์ค๋‹ˆ๋‹ค. ์ดˆ๊ธฐ ํˆฌ์ž๊ธˆ, ์›”๊ฐ„ ํˆฌ์ž๊ธˆ, ์€ํ‡ด ์ „ํ›„์˜ ํˆฌ์ž ์ˆ˜์ต๋ฅ  (ROI) ๋ฐ ๋ฐฐ๋‹น ์ˆ˜์ต๋ฅ ๊ณผ ๊ฐ™์€ ๋‹ค์–‘ํ•œ ์š”์ธ์„ ๊ณ ๋ คํ•ฉ๋‹ˆ๋‹ค.
223
-
224
- ## ์ฃผ์š” ๊ธฐ๋Šฅ
225
- - **์œ ์—ฐํ•œ ์ž…๋ ฅ**: ์‚ฌ์šฉ์ž๋Š” ํ˜„์žฌ ๋‚˜์ด, ์€ํ‡ด ๋‚˜์ด, ํ˜„์žฌ ํˆฌ์ž์•ก, ์›”๊ฐ„ ํˆฌ์ž์•ก, ROI, ๋ฐฐ๋‹น ์ˆ˜์ต๋ฅ  ๋ฐ ๊ธฐ๋Œ€ ์ˆ˜๋ช…์„ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
226
- - **์ƒ์„ธ ์˜ˆ์ธก**: ๋„๊ตฌ๋Š” ์€ํ‡ด ์‹œ ์ด ํˆฌ์ž ๊ฐ€์น˜, ์˜ˆ์ƒ ์—ฐ๊ฐ„ ๋ฐ ์›”๊ฐ„ ๋ฐฐ๋‹น ์†Œ๋“, ์€ํ‡ด ํ›„ ํˆฌ์ž ์„ฑ์žฅ ๋ฐ ๋ฐฐ๋‹น ์†Œ๋“์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.
227
- - **์žฌํˆฌ์ž ์˜ต์…˜**: ์‚ฌ์šฉ์ž๋Š” ์€ํ‡ด ์ „ ๋ฐฐ๋‹น๊ธˆ์„ ์žฌํˆฌ์žํ•˜์—ฌ ๋ณต๋ฆฌ ์„ฑ์žฅ์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
228
-
229
- ## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•
230
- 1. **ํ˜„์žฌ ์„ธ๋ถ€ ์‚ฌํ•ญ ์ž…๋ ฅ**: ํ˜„์žฌ ๋‚˜์ด, ์€ํ‡ด ๋‚˜์ด, ํ˜„์žฌ ํˆฌ์ž์•ก ๋ฐ ์›”๊ฐ„ ํˆฌ์ž์•ก์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
231
- 2. **ํˆฌ์ž ์ˆ˜์ต๋ฅ  ์ง€์ •**: ์€ํ‡ด ์ „ํ›„์˜ ์˜ˆ์ƒ ROI ๋ฐ ๋ฐฐ๋‹น ์ˆ˜์ต๋ฅ ์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
232
- 3. **์žฌํˆฌ์ž ์˜ต์…˜ ์„ ํƒ**: ์€ํ‡ด ์ „ ๋ฐฐ๋‹น๊ธˆ์„ ์žฌํˆฌ์žํ• ์ง€ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
233
- 4. **๊ธฐ๋Œ€ ์ˆ˜๋ช… ์„ค์ •**: ๊ธฐ๋Œ€ ์ˆ˜๋ช…์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
234
- 5. **์ถœ๋ ฅ**: ๋„๊ตฌ๋Š” ์€ํ‡ด ์‹œ ์ด ํˆฌ์ž ๊ฐ€์น˜, ์—ฐ๊ฐ„ ๋ฐ ์›”๊ฐ„ ๋ฐฐ๋‹น ์†Œ๋“, ์€ํ‡ด ํ›„ ํˆฌ์ž ์„ฑ์žฅ ๋ฐ ๋ฐฐ๋‹น ์†Œ๋“์„ ๊ณ„์‚ฐํ•˜๊ณ  ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
235
-
236
- ## ์˜ˆ์ œ ์ž…๋ ฅ
237
- - `ํ˜„์žฌ ๋‚˜์ด`: 30
238
- - `์€ํ‡ด ๋‚˜์ด`: 65
239
- - `์ดˆ๊ธฐ ํˆฌ์ž๊ธˆ`: 50000
240
- - `์›”๊ฐ„ ํˆฌ์ž๊ธˆ`: 500
241
- - `์€ํ‡ด ์ „ ROI`: 7%
242
- - `์€ํ‡ด ํ›„ ROI`: 5%
243
- - `์€ํ‡ด ์ „ ๋ฐฐ๋‹น ์ˆ˜์ต๋ฅ `: 2%
244
- - `์€ํ‡ด ํ›„ ๋ฐฐ๋‹น ์ˆ˜์ต๋ฅ `: 3%
245
- - `๋ฐฐ๋‹น๊ธˆ ์žฌํˆฌ์ž`: ์˜ˆ
246
- - `๊ธฐ๋Œ€ ์ˆ˜๋ช…`: 85
247
-
248
- ## ์˜ˆ์ œ ์ถœ๋ ฅ
249
- - `์€ํ‡ด ์‹œ ์—ฐ๊ฐ„ ๋ฐฐ๋‹น ์†Œ๋“`: 10,000
250
- - `์€ํ‡ด ์‹œ ์›”๊ฐ„ ๋ฐฐ๋‹น ์†Œ๋“`: 833
251
- - `์€ํ‡ด ํ›„ ํˆฌ์ž ์„ฑ์žฅ ๋ฐ ๋ฐฐ๋‹น ์†Œ๋“`: ์€ํ‡ด ํ›„ ๋งค๋…„ ์ƒ์„ธ ํ‘œ ํ˜•์‹์œผ๋กœ ์ œ๊ณต.
252
-
253
- ## ์ค‘์š” ์‚ฌํ•ญ
254
- - ๋ชจ๋“  ์ž…๋ ฅ์ด ์œ ํšจํ•œ ์ˆซ์ž์ธ์ง€ ํ™•์ธํ•˜์„ธ์š”.
255
- - ๋„๊ตฌ๋Š” ์€ํ‡ด ํ›„ ์ถ”๊ฐ€ ํˆฌ์ž๋‚˜ ๋ฐฐ๋‹น๊ธˆ ์žฌํˆฌ์ž๋ฅผ ๊ฐ€์ •ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
256
- - ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฌ์šด ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค ์ƒ์„ฑ์„ ์œ„ํ•ด Gradio๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐœ๋ฐœ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
257
- - ์ƒ์„ธํ•œ ์€ํ‡ด ๊ณ„ํš ์˜ˆ์ธก๊ณผ ์ฆ‰๊ฐ์ ์ธ ํ”ผ๋“œ๋ฐฑ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
258
-
259
- ## ๋ฉด์ฑ… ์กฐํ•ญ
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  ์ด ๋„๊ตฌ์—์„œ ์ œ๊ณตํ•˜๋Š” ์ •๏ฟฝ๏ฟฝ๋Š” ์ผ๋ฐ˜์ ์ธ ์ •๋ณด ์ œ๊ณต ๋ชฉ์ ๋งŒ์„ ์œ„ํ•ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์ดํŠธ์˜ ๋ชจ๋“  ์ •๋ณด๋Š” ์„ ์˜๋กœ ์ œ๊ณต๋˜์ง€๋งŒ, ์‚ฌ์ดํŠธ์˜ ์ •๋ณด์˜ ์ •ํ™•์„ฑ, ์ ์ ˆ์„ฑ, ์œ ํšจ์„ฑ, ์‹ ๋ขฐ์„ฑ, ๊ฐ€์šฉ์„ฑ ๋˜๋Š” ์™„์ „์„ฑ์— ๋Œ€ํ•ด ๋ช…์‹œ์ ์ด๋“  ๋ฌต์‹œ์ ์ด๋“  ์–ด๋– ํ•œ ์ข…๋ฅ˜์˜ ์ง„์ˆ ์ด๋‚˜ ๋ณด์ฆ์„ ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์‚ฌ์ดํŠธ์˜ ์‚ฌ์šฉ๊ณผ ์‚ฌ์ดํŠธ์˜ ์ •๋ณด๋ฅผ ์‹ ๋ขฐํ•˜๋Š” ๊ฒƒ์€ ์ „์ ์œผ๋กœ ์‚ฌ์šฉ์ž์˜ ์ฑ…์ž„์ž…๋‹ˆ๋‹ค.
261
  """,
262
  """
263
- # RETIREMENT PLANNING CALCULATOR
264
-
265
- This tool helps individuals plan for retirement by predicting investment growth and dividend income up to the retirement date and beyond. It considers various factors such as initial investment, monthly contributions, ROI before and after retirement, and dividend yield.
266
-
267
- ## Key Features
268
- - **Flexible Input**: Users can enter their current age, retirement age, current investment amount, monthly contribution, ROI, dividend yield, and life expectancy.
269
- - **Detailed Projections**: The tool calculates and displays total investment value at retirement, expected annual and monthly dividend income, investment growth, and dividend income after retirement.
270
- - **Reinvestment Option**: Users can choose to reinvest dividends before retirement for compounded growth.
271
-
272
- ## How to Use
273
- 1. **Enter Current Details**: Provide current age, retirement age, current investment amount, and monthly contribution.
274
- 2. **Specify ROI**: Enter the expected ROI and dividend yield before and after retirement.
275
- 3. **Select Reinvestment Option**: Choose whether to reinvest dividends before retirement.
276
- 4. **Set Life Expectancy**: Enter your expected life expectancy.
277
- 5. **Output**: The tool calculates and displays total investment value at retirement, annual and monthly dividend income, and investment growth and dividend income after retirement.
278
-
279
- ## Example Input
280
- - `Current Age`: 30
281
- - `Retirement Age`: 65
282
- - `Initial Investment`: 50000
283
- - `Monthly Contribution`: 500
284
- - `Pre-Retirement ROI`: 7%
285
- - `Post-Retirement ROI`: 5%
286
- - `Pre-Retirement Dividend Yield`: 2%
287
- - `Post-Retirement Dividend Yield`: 3%
288
- - `Dividend Reinvestment`: Yes
289
- - `Life Expectancy`: 85
290
-
291
- ## Example Output
292
- - `Annual Dividend Income at Retirement`: 10,000
293
- - `Monthly Dividend Income at Retirement`: 833
294
- - `Post-Retirement Investment Growth and Dividend Income`: Detailed annually in tabular format.
295
-
296
- ## Important Notes
297
- - Ensure all inputs are valid numbers.
298
- - The tool assumes no additional investments or dividend reinvestments after retirement.
299
- - Developed using Gradio for an easy-to-use user interface.
300
- - Supports detailed retirement planning projections and instant feedback.
301
-
302
- ## Disclaimer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield):
6
- result = retirement_planning(current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield)
 
 
 
 
 
 
 
 
 
 
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(current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield):
32
- return retirement_planning_interface_fn(current_age, retirement_age, life_expectancy, monthly_income_required, inflation_rate, current_investment, monthly_investment, pre_retirement_roi, pre_retirement_dividend_yield, reinvest_dividends, post_retirement_roi, post_retirement_dividend_yield)
 
 
 
 
 
 
 
 
 
 
 
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(current_age=None, retirement_age=None, life_expectancy=None, monthly_income_required=None, inflation_rate=None, current_investment=None, monthly_investment=None, pre_retirement_roi=None, pre_retirement_dividend_yield=None, reinvest_dividends=None, post_retirement_roi=None, post_retirement_dividend_yield=None):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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