Skip to content
All library documents

Tracking Multi-Asset Portfolio Value, Costs, Cash, and P&L

Article TradingView scripts

Summary

This indicator tracks a portfolio of up to ten user-defined positions alongside an optional cash balance. For each enabled position, it retrieves the chart-timeframe closing price and multiplies it by the entered quantity to estimate current value; quantity multiplied by entered cost gives the position’s cost basis. It aggregates those figures into total holdings value, portfolio value including cash, total position cost, and unrealized profit or loss. The display also shows active position count, percentage P&L, and changes from the previous bar, with plots and a summary panel.

The key accounting distinction is that cash contributes to total portfolio value and the P&L percentage denominator but is excluded from position value and cost totals. The script is a monitoring aid, not a trading strategy, and the document supplies no validation against broker records. Its estimates depend on manually entered quantities and costs, the selected symbols, and available price data; it does not describe treatment of fees, dividends, currency conversion, or realized transactions. Users should interpret the figures as a simplified snapshot rather than a complete account statement.

Key ideas

  • The indicator combines up to ten configured positions using their current chart-timeframe prices and entered quantities.
  • Entered per-unit costs and quantities provide an aggregate position cost basis.
  • Optional cash is included in total portfolio value and the P&L percentage denominator.
  • Plots and a summary panel report portfolio value, position value, costs, P&L, and recent changes.
  • The displayed figures are simplified estimates and omit several account-level details.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.