Da Scenario — Portfolio Analysis

My Portfolio,
Analyzed through Conversation

3 CSVs and 10 conversations — from sector allocation to Sharpe ratio and rebalancing suggestions.
Python runs for you, even if you never write a line of code.

01 — Why

Why Analyze with wiiiv

Portfolio reviews always need the same things — returns, volatility, sector concentration, benchmark comparison. Yet every time, you either fire up pandas and write code, settle for the limited charts in your brokerage app, or wrestle with VLOOKUP in a spreadsheet.

With wiiiv, just say "Show me a pie chart of sector allocation". The AI generates pandas + matplotlib code, executes it in an isolated Python sandbox, and displays charts and tables right in the chat. You focus only on what to look at.

All data and results in this guide are actual wiiiv outputs. A Korean stock portfolio of 5 holdings (Samsung Electronics, SK Hynix, Naver, Kakao, LG Energy Solution) is analyzed across 10 conversation turns.
02 — Data

Preparation: 3 CSVs

Drop 3 CSV files into your mounted folder, and you're ready to analyze.

portfolio_holdings.csv
Stock CodeStock NameSectorSharesBuy PriceBuy Date
005930Samsung ElectronicsSemiconductor3071,0002025-12-02
000660SK HynixSemiconductor10178,0002026-01-06
035420NaverPlatform15210,0002025-11-03
035720KakaoPlatform4042,0002025-11-03
373220LG Energy SolutionEV Battery5380,0002026-02-03
stock_daily_prices.csv — 750 rows, 5 stocks × ~150 trading days OHLCV
DateStock CodeStock NameOpenHighLowCloseVolume
2025-11-03005930Samsung Electronics70,42370,42370,32370,3626,439,167
2025-11-03000660SK Hynix179,041179,041176,783177,76319,569,018
... 750 rows ...
kospi_daily_index.csv — for benchmark comparison
DateClose
2025-11-032,536.35
2025-11-042,546.35
... ~150 rows ...
03 — Full Analysis (10 Turns)

Full Analysis Flow in 10 Turns

Below is the actual conversation in order. At each turn, the user makes a request, the AI generates and runs Python code, then presents results as tables and charts.

T0
Open CSV
T1
Valuation
& Return
T2
Sector
Pie Chart
T3
Return
Trend
T4
Correlation
Heatmap
T5
KOSPI
Benchmark
T6
Volatility
MDD
T7
Sharpe Ratio
T8
Rebalancing
T9
Report
(docx)
T0 Open CSV
wiiiv
Sky
Skytree
Open portfolio_holdings.csv and stock_daily_prices.csv from the stock portfolio folder and show me
wiiiv
wiiiv
I've opened and verified both CSV files.

1. portfolio_holdings.csv — Rows: 5, Columns: 6
2. stock_daily_prices.csv — Rows: 750, Columns: 8
Python script used: pandas read_csv + to_markdown (11 lines)
T1 Market Value + Return Calculation
wiiiv
Sky
Skytree
Calculate market value and return for each stock based on the latest closing price
wiiiv
wiiiv
Here are the market values and returns calculated based on the latest closing price.
Stock NameSharesBuy PriceCurrent PriceCost BasisMarket ValueReturn
Samsung Electronics3071,00065,6002,130,0001,968,000-7.61%
SK Hynix10178,000258,7001,780,0002,587,000+45.34%
Naver15210,000165,2583,150,0002,478,870-21.31%
Kakao4042,00034,2921,680,0001,371,680-18.35%
LG Energy Solution5380,000396,8231,900,0001,984,115+4.43%
Total CostTotal ValueTotal P&LOverall Return
10,640,00010,389,665-250,335-2.35%
Python script used: merge + return calculation (25 lines)
T2 Sector Allocation Pie Chart
wiiiv
Sky
Skytree
Show me a pie chart of sector allocation
wiiiv
wiiiv
Here is the sector allocation pie chart.
SectorSharesWeight
Platform (Naver + Kakao)5555%
Semiconductor (Samsung Electronics + SK Hynix)4040%
EV Battery (LG Energy Solution)55%
Sector Allocation by Shares
Weight 100 shares 3 sectors
Platform55%
Semiconductor40%
EV Battery5%
T3 Daily Return Trend by Stock
wiiiv
Sky
Skytree
Draw a line chart showing the daily return trend for each stock
wiiiv
wiiiv
The daily return trend line chart has been generated.
stock_daily_return_trend.png
DateLG Energy SolutionSK HynixNaverSamsung ElectronicsKakao
2025-11-03-1.26-0.13-0.97-0.900.05
2025-11-04-1.44-2.840.89-2.27-1.61
2025-11-05-3.73-2.80-2.31-1.37-3.74
Python script used: matplotlib line plot + figsize=(12,6) (28 lines)
T4 Cross-Stock Correlation Heatmap
wiiiv
Sky
Skytree
Analyze the correlation of daily returns between stocks and draw a heatmap
wiiiv
wiiiv
The daily return correlations have been calculated and a heatmap has been generated.
stock_return_correlation_heatmap.png
Correlation Matrix
LGES
SKH
Naver
SEC
Kakao
LGES
1.00
0.16
-0.06
-0.42
-0.03
SKH
0.16
1.00
-0.83
-0.31
-0.37
Naver
-0.06
-0.83
1.00
0.11
0.24
SEC
-0.42
-0.31
0.11
1.00
-0.03
Kakao
-0.03
-0.37
0.24
-0.03
1.00
Interpretation:
• Strongest negative correlation: SK Hynix ↔ Naver (-0.8285)
• Relatively weak positive correlation: LG Energy Solution ↔ SK Hynix (0.1553)
• Samsung Electronics and LG Energy Solution show a notable negative correlation (-0.4248)
T5 KOSPI Benchmark Comparison
wiiiv
Sky
Skytree
Read kospi_daily_index.csv from the stock portfolio folder and compare my portfolio's cumulative return with KOSPI on the same chart
wiiiv
wiiiv
The portfolio vs. KOSPI cumulative return comparison chart has been generated.
portfolio_vs_kospi_cumulative_return.png
DatePortfolio Cumulative ReturnKOSPI Cumulative Return
2025-11-03-0.710.00
2025-11-04-1.180.39
2025-11-05-2.680.74
2025-11-06-2.071.44
2025-11-07-1.101.50
Python script used: daily valuation sum → cumulative return calc → matplotlib comparison plot (47 lines)
T6 Volatility + MDD
wiiiv
Sky
Skytree
Analyze the portfolio's daily returns, annualized volatility, and maximum drawdown (MDD)
wiiiv
wiiiv
The portfolio's daily returns, annualized volatility, and maximum drawdown (MDD) have been calculated.
Avg Daily Return(%)Daily Std Dev(%)Annualized Volatility(%)Max Drawdown MDD(%)
-1.40672.006931.8580-9.9751
Interpretation:
• Average daily return is -1.4067%, negative
• Annualized volatility of 31.86% indicates considerable daily fluctuation
• Maximum drawdown (MDD) of -9.97% means a roughly 10% decline from peak occurred
Python script used: drawdown = decline from cumulative peak (52 lines)
T7 Sharpe Ratio by Stock
wiiiv
Sky
Skytree
Compare the Sharpe ratio for each stock. Use 3.5% annual risk-free rate
wiiiv
wiiiv
Here is the annualized Sharpe ratio comparison by stock, using a 3.5% annual risk-free rate.
Stock NameAvg Daily Return(%)Daily Std Dev(%)Annualized Sharpe Ratio
SK Hynix19.8115.5520.21
LG Energy Solution5.816.5614.03
Naver-2.737.94-5.48
Samsung Electronics-3.163.38-14.88
Kakao-27.369.24-47.00
Only SK Hynix and LG Energy Solution are positive — the only holdings with favorable risk-adjusted performance. Kakao has a Sharpe ratio of -47.00, the highest risk-adjusted loss.
Python script used: (mean_daily - rf_daily) / std_daily * sqrt(252) (31 lines)
T8 Rebalancing Suggestion
wiiiv
Sky
Skytree
Analyze whether any sectors are overweight and suggest a rebalancing plan
wiiiv
wiiiv
I've analyzed sector concentration and calculated rebalancing suggestions based on current market value.
SectorStocksTotal CostTotal ValueCurrent Weight
Semiconductor23,910,0004,555,00043.84%
Platform24,830,0003,850,55037.06%
EV Battery11,900,0001,984,11519.10%
Rebalancing Suggestion (Equal-weight 33.3% target):
SectorTarget WeightAdjustment AmountAction
Semiconductor33.33%-1,091,778Reduce
Platform33.33%-387,328Reduce
EV Battery33.33%+1,479,107Increase
The combined weight of Semiconductor and Platform is 80.90%, excessively concentrated. Rebalancing toward a higher EV Battery allocation is recommended.
T9 Summary Report (docx)
wiiiv
Sky
Skytree
Write a comprehensive portfolio review report based on the above analysis
wiiiv
wiiiv
The portfolio review report has been generated.
portfolio_review_report.docx
The report includes:
1. Summary — By market value: Semiconductor 43.84%, Platform 37.06%, EV Battery 19.10%
2. Sector Overview — Number of stocks, cost basis, market value, P&L
3. Stock Performance — SK Hynix +45.34%, LG Energy Solution +4.43%, others negative
4. Risk Metrics — Annualized volatility 31.86%, MDD -9.97%
5. Sharpe Ratio Comparison — Only SK Hynix (20.21) and LG Energy Solution (14.03) positive
6. Rebalancing Suggestion — Trim semiconductor, reduce platform, increase EV battery
7. Conclusion — Clear sector concentration with wide performance gaps between stocks
Python script used: python-docx Document() + 7 sections (68 lines)
04 — Tips

Tips for Effective Analysis

1. Be specific in your requests

"Show me a pie chart of sector allocation" works better than "analyze this." Specify the chart type (pie/line/heatmap/bar), reference values (risk-free rate 3.5%), and time period to get exactly what you want.

2. Reference previous turns

Say things like "From the above analysis, pull out only the stocks with a negative Sharpe ratio." Variables remain in memory, so follow-up analysis runs instantly without recalculation.

3. Wrap up with a report

When your analysis is done, say "Write a summary report" to compile everything. A docx file is generated and ready for download, and you can even send it via email.

4. Works with any structured data

This guide uses a stock portfolio as an example, but the same approach works for household budgets, server logs, sales data, survey results, or any structured data in CSV format.

Execution Environment: Python code runs in an isolated sandbox. Major libraries including pandas, numpy, matplotlib, seaborn, scipy, and python-docx are pre-installed.
wiiiv's data analysis results are LLM-based inferences. When using calculations, ratios, or trend interpretations for investment or decision-making, always verify the raw data and calculation process yourself.