OPEN-SOURCE SCRIPT
Portfolio Treemap [invincible3]

Portfolio Treemap [invincible3]
Portfolio Treemap [invincible3] is a visual portfolio monitoring dashboard designed to help traders and investors track multiple holdings directly on the TradingView chart.
The indicator allows users to enter up to 20 instruments, including stocks, ETFs, crypto pairs, forex symbols, or other TradingView-supported assets. For each instrument, the user can define the buy price and number of shares or units held. The script then calculates the live market value, cost basis, unrealized profit/loss, and percentage return using real-time chart data.
The dashboard uses a treemap-style layout where larger boxes represent larger portfolio weight based on the selected ranking mode. Box colors show unrealized performance: green for profitable positions and red for losing positions. The stronger the profit or loss percentage, the stronger the color intensity. Empty cells are blended with the chart background for a cleaner and more professional visual appearance.
Key Features:
• Track up to 20 portfolio instruments
• User-defined portfolio name
• Input symbol, buy price, and shares/units for each holding
• Real-time portfolio value, cost, and unrealized P/L
• Treemap-style visual dashboard
• Profit and loss color gradient
• Green boxes for winning positions
• Red boxes for losing positions
• Dynamic text color for light and dark themes
• Empty cells blend with chart background
• Supports stocks, ETFs, crypto, forex, commodities, and indices
• Adjustable dashboard position and size
• Optional portfolio header
• Multiple box-ranking modes: shares, position value, absolute P/L, and absolute P/L %
How to Use:
1. Add the indicator to your chart.
2. Open the indicator settings.
3. Enter your portfolio name.
4. Select each portfolio symbol.
5. Add your average buy price.
6. Add your number of shares or units.
7. Choose how boxes should be ranked: by shares, position value, absolute P/L, or absolute P/L percentage.
8. Use the dashboard to monitor portfolio performance visually.
Color Logic:
• Green = position is in profit
• Red = position is in loss
• Stronger color = larger percentage move
• Neutral color = near breakeven
• Empty spaces blend with the chart background
Important Notes:
For best results, use instruments quoted in the same currency. Mixing assets quoted in different currencies may make the total portfolio value and P/L less accurate unless the user manually adjusts values.
This indicator is intended for portfolio visualization and monitoring only. It does not provide buy or sell signals and should not be treated as financial advice. Always confirm portfolio values with your broker or exchange.
Portfolio Treemap [invincible3] is a visual portfolio monitoring dashboard designed to help traders and investors track multiple holdings directly on the TradingView chart.
The indicator allows users to enter up to 20 instruments, including stocks, ETFs, crypto pairs, forex symbols, or other TradingView-supported assets. For each instrument, the user can define the buy price and number of shares or units held. The script then calculates the live market value, cost basis, unrealized profit/loss, and percentage return using real-time chart data.
The dashboard uses a treemap-style layout where larger boxes represent larger portfolio weight based on the selected ranking mode. Box colors show unrealized performance: green for profitable positions and red for losing positions. The stronger the profit or loss percentage, the stronger the color intensity. Empty cells are blended with the chart background for a cleaner and more professional visual appearance.
Key Features:
• Track up to 20 portfolio instruments
• User-defined portfolio name
• Input symbol, buy price, and shares/units for each holding
• Real-time portfolio value, cost, and unrealized P/L
• Treemap-style visual dashboard
• Profit and loss color gradient
• Green boxes for winning positions
• Red boxes for losing positions
• Dynamic text color for light and dark themes
• Empty cells blend with chart background
• Supports stocks, ETFs, crypto, forex, commodities, and indices
• Adjustable dashboard position and size
• Optional portfolio header
• Multiple box-ranking modes: shares, position value, absolute P/L, and absolute P/L %
How to Use:
1. Add the indicator to your chart.
2. Open the indicator settings.
3. Enter your portfolio name.
4. Select each portfolio symbol.
5. Add your average buy price.
6. Add your number of shares or units.
7. Choose how boxes should be ranked: by shares, position value, absolute P/L, or absolute P/L percentage.
8. Use the dashboard to monitor portfolio performance visually.
Color Logic:
• Green = position is in profit
• Red = position is in loss
• Stronger color = larger percentage move
• Neutral color = near breakeven
• Empty spaces blend with the chart background
Important Notes:
For best results, use instruments quoted in the same currency. Mixing assets quoted in different currencies may make the total portfolio value and P/L less accurate unless the user manually adjusts values.
This indicator is intended for portfolio visualization and monitoring only. It does not provide buy or sell signals and should not be treated as financial advice. Always confirm portfolio values with your broker or exchange.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน