OPEN-SOURCE SCRIPT
āļ—āļĩāđˆāļ­āļąāļ›āđ€āļ”āļ•:

📊 Portafoglio Verticale Personalizzabile (5 Tickers, Net ROI)

213
📊 Customizable Vertical Portfolio (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
āđ€āļ­āļāļŠāļēāļĢāđ€āļœāļĒāđāļžāļĢāđˆ
Summary of Changes

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 āļ­āđˆāļēāļ™āđ€āļžāļīāđˆāļĄāđ€āļ•āļīāļĄāļ—āļĩāđˆ āļ‚āđ‰āļ­āļāļģāļŦāļ™āļ”āļāļēāļĢāđƒāļŠāđ‰āļ‡āļēāļ™