OPEN-SOURCE SCRIPT

Position Trdaing Lines (2 entries + live PnL)

47
Position Trading Lines (2 entries + live PnL) is a utility script designed to visually manage a manual position on the chart, with clear TP/SL levels and real-time profit & loss.

The script does not place orders. It is meant to help you simulate / track an existing or planned position.

Features
• Up to 2 trades on the same symbol
• Each trade has:
• Direction: Long / Short
• Position size (lot)
• Entry price
• Take Profit (T.Profit) price
• Stop Loss (S.Loss) price
• Entry shift in bars from the last candle (to align with past or future entries)
• Visual lines on the price chart
• Horizontal line at the entry price
• Horizontal line at Take Profit
• Horizontal line at Stop Loss
• Informative labels
• Entry label showing: direction, size and @ entry price
• TP and SL labels showing:
• T.Profit / S.Loss
• position size
• @ price
• estimated PnL at that level
• If both trades share the same TP or SL price, a single combined label is shown with the total size and total PnL.
• Commissions
• Global commission input (percentage over notional).
• Commission is included in all PnL calculations.
• Live PnL label
• Real-time combined PnL of the active trades, updated on the last bar.
• Color changes with sign (green for profit, red for loss).
• Selective PnL for Trade 2
• Trade 2 has a switch: “Count PnL in total”.
• You can keep Trade 2 visible on the chart but exclude it from the combined PnL until it is actually active.

This tool is useful for discretionary traders who want a clean visual representation of their position, R:R, and projected outcomes directly on the chart, without relying on the broker’s position panel.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.