OPEN-SOURCE SCRIPT
Aktualisiert

Trade Management

2 113
Trade Management

Trade Management is a visual planning and position-management tool designed to help traders structure, size, and monitor both long and short trades directly on the chart.

It combines entry planning, stop-loss placement, profit targets, position sizing, partial exits, and progressive profit protection within a single dashboard.

Main features

- LONG and SHORT trade plans
- Automatic, manual-price, or percentage-based stop-loss
- Automatic stop placement based on confirmed pivots and ATR
- Fixed risk-multiple or market-structure targets
- Two profit targets: TP1 and TP2
- Optional ideal-entry level based on recent price structure
- Position sizing based on:
- Capital allocation
- Maximum account risk at the stop
- Fixed quantity
- Configurable TP1/TP2 position allocation
- Support for stocks and other instruments
- Automatic or manually defined point value
- Progressive stop management
- Live and historical tracking modes
- Customizable dashboard position, text size, and projected levels

Trade-plan construction

The indicator calculates the initial risk from the distance between the entry price and the stop-loss.

In AUTOMATIC stop mode, the stop is placed beyond a confirmed structural pivot with an ATR-based buffer. A minimum ATR distance prevents the initial stop from being placed excessively close to the entry.

Alternatively, traders can define an exact stop price or use a percentage distance from entry.

Profit targets can be calculated using fixed multiples of the initial risk, expressed in R, or derived from historical support and resistance levels that satisfy the selected minimum reward-to-risk requirement.

Position sizing

Three sizing methods are available:

- CAPITAL ALLOCATION % allocates a selected percentage of account capital to the position.
- STOP RISK % calculates the quantity according to the maximum theoretical account loss at the initial stop.
- FIXED QUANTITY uses a manually entered number of shares, units, or lots.

For stocks, quantities are rounded down to whole shares. Other instruments can use a configurable point value and quantity increment.

The position can also be divided between TP1 and TP2 using several predefined allocation ratios.

Progressive protection

When TP1 is reached, the tracked stop moves to the entry price, creating a break-even reference for the remaining position.

A separate profit-protection trigger can move the tracked stop beyond entry by a configurable fraction of the initial risk. This helps visualize how much profit would theoretically be protected if the corresponding broker order were adjusted.

The indicator does not modify broker orders automatically.

Tracking modes

LIVE mode freezes the complete trade plan when tracking is armed. It can either treat the position as already open or wait for the entry price to be crossed. Once frozen, new pivots and ATR changes do not modify the original plan.

HISTORICAL mode begins monitoring from the selected date and assumes entry when the configured price is touched. When several levels are reached within the same candle, the exact event order cannot always be determined from OHLC data. The dashboard identifies these situations as intrabar uncertainty, and stop-loss events receive priority when conflicting levels are touched on the same bar.

Dashboard and chart levels

The chart displays the planned entry, optional ideal entry, tracked stop-loss, TP1, TP2, profit-protection trigger, and protected-stop level.

The dashboard summarizes:

- Entry and initial stop
- Position quantity
- Capital allocated
- Initial monetary and percentage risk
- TP1 and TP2 allocations
- Estimated target profit
- Weighted reward-to-risk ratio
- Current tracked stop
- Remaining position
- Theoretical profit or loss
- Trade status
- Suggested next management action

Important limitations

This indicator is a planning and monitoring aid, not an automated trading system. It does not place orders, confirm broker executions, or generate autonomous trade recommendations.

LIVE tracking is reset when an input or timeframe is changed, or when the script is reloaded. Calculations assume executions at the displayed levels and exclude commissions, taxes, slippage, spreads, currency conversion, liquidity constraints, and other execution differences.

Always verify contract specifications, point values, quantities, and orders directly with your broker.

For educational and informational purposes only. This indicator does not constitute financial advice.

DL INVEST - Laurent.
Versionshinweise
TRADE MANAGEMENT V2 — RELEASE NOTES

Trade Management V2 is a major update focused on clearer trade planning, more reliable position tracking, and more realistic performance estimates.

Key improvements

• Clearer LIVE workflow
LIVE mode now distinguishes between an ACTIVE PLAN and an actual OPEN POSITION. A prepared plan is frozen when the script loads, while an open position uses the fill price, initial quantity, initial stop, and profit targets entered by the user.

• LIVE position recovery
A new recovery section allows an existing position to be restored after a reload. Users can report the remaining quantity, confirmed net realized P&L, the broker stop currently in place, observed TP1/TP2 or protection events, and a dated recovery record. Observed price touches never change the declared broker quantity automatically.

• Broker stop and suggested stop are separated
The indicator now clearly distinguishes the stop reported as active with the broker from the stop suggested by the management engine. This avoids presenting an unconfirmed stop adjustment as if it had already been executed.

• More realistic cost and currency handling
V2 adds an account-currency selector, automatic daily or manual currency conversion, per-side commissions, estimated round-trip spread/slippage, and remaining LIVE costs. Risk, target profit, break-even, realized P&L, unrealized P&L, and stop outcomes can therefore be displayed as net estimates in the selected account currency.

• Improved position sizing
Automatic sizing remains available for prepared LIVE plans using either capital allocation or risk at stop. Stock positions use whole shares and can be limited by a capital-allocation cap. Manually reported fills retain their exact quantity and are validated against the selected quantity step.

• More rigorous REPLAY mode
The former historical tracking mode has been replaced by a causal REPLAY workflow based on the actual entry date and price. The entry must match a loaded bar, calculations use information available at that point in time, and the simulation is frozen whenever the order of intrabar events cannot be determined reliably from OHLC data.

• Tick-aware calculations and stronger validation
Stops, targets, protection levels, and structural levels are rounded in the appropriate direction before risk and quantity calculations. V2 also checks tick alignment, quantity increments, target order, stop placement, recovery dates, remaining quantities, and other inconsistent inputs before starting the plan.

• Customizable and more readable dashboard
The table now offers ESSENTIAL, TRACKING, FULL, and CUSTOM views. Optional sections cover the plan and risk, targets, protection, status and engine details, and position results. The dashboard also provides clearer status messages and a specific next action.

• Expanded chart information
The chart can display the actual entry marker, ideal entry, reported broker stop, suggested stop, TP1, TP2, profit-protection trigger, and the net break-even level for the remaining position.

• LIVE price alerts
Optional alert() events are available for TP1, TP2, the profit-protection trigger, the reported broker stop, and a crossed suggested stop. Alerts report observed price contacts only; they do not confirm broker fills or transmit orders.

Trade Management V2 remains an informational trade-planning and position-monitoring tool. It does not place, modify, or verify orders with a broker.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.