pine-script-atr-position-sizing-needs-hard-cap

ATR-adaptive position sizing (qty = risk_amount / atr_stop_distance) must include a max-qty cap such as math.min(qtyRaw, equity / close). When ATR is extremely small (low-volatility instrument or compressed session), the divisor approaches zero and produces astronomically large position sizes, causing unbounded leverage exposure.