Separate Position Size from Margin
Margin is collateral, not the maximum possible loss. Notional exposure, stop-distance risk and cash allocation are different quantities. For a linear instrument, a simplified planned loss is quantity times adverse price distance times value per price unit, plus costs. Currency conversion and contract multipliers must match the account. Gaps can make realized loss exceed that plan.
Choose an Invalidation Rule, Not a Universal Stop
Fixed-distance, volatility-based and structural stops encode different assumptions. No method is shown to outperform here. Specify when a stop is calculated, whether it can move, and what order will implement it. A stop-market order can slip; a stop-limit order can remain unfilled. Neither guarantees an account loss ceiling.
Distinguish Strategy and Portfolio Limits
A limit in one Pine strategy applies within its simulated strategy context. It does not automatically see every broker position, enforce combined exposure across accounts or pause other systems. Live account controls require reconciled positions, permissions, execution acknowledgments and a tested shutdown process.
Test Controls Under Failure Conditions
Define handling for rejected orders, partial fills, stale account values, disconnected services and position mismatches. A drawdown threshold needs a specified equity measure, high-water mark, reset rule and response. Historical maximum drawdown is an observation, not a guaranteed future maximum. This page does not recommend a universal percentage of capital to risk.
Where Pineify Helps
Pineify can draft explicit stops and sizing logic and help compare supported parameters in TradingView. Review the generated code rather than assuming every requested control exists. Imported trade reports can help inspect historical losses; they do not enforce broker-side limits or provide a verified autonomous account-risk service.