ð Portafoglio Verticale Personalizzabile (5 Tickers, Net ROI)

Type: Pine Script v6 Indicator (TradingView)
Layout: Vertical table (up to 5 tickers + header)
ðđ Features
Tracks up to 5 tickers simultaneously
Table position selectable (top, middle, bottom; left, center, right)
Customizable colors (header, rows, borders)
Optional header display
ðđ Calculations
For each ticker:
Total cost = Entry price à Qty + Entry commissions
Current value = Current price à Qty â Exit commissions
Net P/L = Current value â Cost â Taxes
Net ROI (%) = (Net P/L ÷ Cost) à 100
ðđ Commission & Tax
Entry/Exit: Fixed or Percentage
CGT: user-defined %, applied only on profits
ðđ Output Table
| Ticker | Net P/L | Net ROI (%) |
Color-coded: Green = Profit, Red = Loss, Silver = Neutral/NA
â Best for
Multi-asset tracking in one chart
Real-time evaluation of profits after fees & taxes
Clear, visual portfolio monitoring
Ticker Expansion:
Increased from 5 to 10 tickers, all managed dynamically using arrays instead of repeated code blocks.
Break-Even Feature:
Added a Break-Even calculation and persistent lines plotted on the chart for each ticker, showing the break-even price visually.
Global CGT:
Replaced individual per-ticker CGT inputs with a single global CGT setting applied to all tickers.
Table System Upgrade:
The table is now generated dynamically using loops, with enhanced styling options (frame color, border width, etc.).
Improved Input Organization:
Inputs are grouped under sections (âGlobal Settingsâ, âTable Styleâ, âTicker 1 SettingsââĶâTicker 10 Settingsâ) for cleaner configuration.
Cleaner Architecture:
Replaced repeated variable definitions (use1, use2, etc.) with arrays and loops, improving efficiency, readability, and scalability.
Enhanced Visual Customization:
Added new style controls such as frame color, frame width, and improved position handling.
New Utility Function:
Introduced getBreakEvenPrice() for accurate break-even calculation considering fixed or percentage commissions.
Code Optimization:
Overall code reduced by roughly 80% redundancy, improving performance and maintainability.
āļŠāļāļĢāļīāļāļāđāđāļāđāļāļāļāļāļĢāđāļ
āļāđāļ§āļĒāđāļāļāļāļēāļĢāļĄāļāđāļŦāļĨāļąāļāļāļāļ TradingView āļāļđāđāļŠāļĢāđāļēāļāļŠāļāļĢāļīāļāļāđāļāļĩāđāđāļāđāļāļģāđāļŦāđāļĄāļąāļāđāļāđāļāđāļāđāļāđāļāļāļāļĢāđāļŠ āđāļāļ·āđāļāđāļŦāđāđāļāļĢāļāđāļāļāļĢāđāļŠāļēāļĄāļēāļĢāļāļāļĢāļ§āļāļŠāļāļāđāļĨāļ°āļĒāļ·āļāļĒāļąāļāļāļēāļĢāļāļģāļāļēāļāļāļāļāļŠāļāļĢāļīāļāļāđāđāļāđ āļāļāđāļŠāļāļāļāļ§āļēāļĄāļāļ·āđāļāļāļĄāļāļđāđāđāļāļĩāļĒāļ! āđāļĄāđāļ§āđāļēāļāļļāļāļāļ°āļŠāļēāļĄāļēāļĢāļāđāļāđāļāļēāļāđāļāđāļāļĢāļĩ āđāļāđāļāļĒāđāļēāļĨāļ·āļĄāļ§āđāļēāļāļēāļĢāđāļāļĒāđāļāļĢāđāđāļāđāļāļāđāļģāļāļąāđāļāļāļ°āļāđāļāļāđāļāđāļāđāļāļāļēāļĄāļāļāļĢāļ°āđāļāļĩāļĒāļāļāļēāļĢāđāļāđāļāļēāļāļāļāļāđāļĢāļē
āļāļģāļāļģāļāļąāļāļŠāļīāļāļāļīāđāļāļ§āļēāļĄāļĢāļąāļāļāļīāļāļāļāļ
āļŠāļāļĢāļīāļāļāđāđāļāđāļāļāļāļāļĢāđāļ
āļāđāļ§āļĒāđāļāļāļāļēāļĢāļĄāļāđāļŦāļĨāļąāļāļāļāļ TradingView āļāļđāđāļŠāļĢāđāļēāļāļŠāļāļĢāļīāļāļāđāļāļĩāđāđāļāđāļāļģāđāļŦāđāļĄāļąāļāđāļāđāļāđāļāđāļāđāļāļāļāļĢāđāļŠ āđāļāļ·āđāļāđāļŦāđāđāļāļĢāļāđāļāļāļĢāđāļŠāļēāļĄāļēāļĢāļāļāļĢāļ§āļāļŠāļāļāđāļĨāļ°āļĒāļ·āļāļĒāļąāļāļāļēāļĢāļāļģāļāļēāļāļāļāļāļŠāļāļĢāļīāļāļāđāđāļāđ āļāļāđāļŠāļāļāļāļ§āļēāļĄāļāļ·āđāļāļāļĄāļāļđāđāđāļāļĩāļĒāļ! āđāļĄāđāļ§āđāļēāļāļļāļāļāļ°āļŠāļēāļĄāļēāļĢāļāđāļāđāļāļēāļāđāļāđāļāļĢāļĩ āđāļāđāļāļĒāđāļēāļĨāļ·āļĄāļ§āđāļēāļāļēāļĢāđāļāļĒāđāļāļĢāđāđāļāđāļāļāđāļģāļāļąāđāļāļāļ°āļāđāļāļāđāļāđāļāđāļāļāļēāļĄāļāļāļĢāļ°āđāļāļĩāļĒāļāļāļēāļĢāđāļāđāļāļēāļāļāļāļāđāļĢāļē