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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。