From 60e009f0c6c2a942ba2cae15a6e6d252daa9b993 Mon Sep 17 00:00:00 2001 From: momentum dev Date: Wed, 16 Sep 2026 14:36:13 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20equalise=20dollar=20risk=20per=20trade?= =?UTF-8?q?=20=E2=80=94=20the=20position=20cap=20was=20doing=20the=20sizin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TRADING_RISK_PER_TRADE_PCT 0.05 -> 0.015. On a ~$240 account the 5% risk budget ($12) is unreachable: a 4.5% stop would need $267 of notional against a $38 position cap (max_position_pct=0.16). So calculate_position_size never bound -- the POSITION CAP did, on every trade. The consequence is that every position was the same NOTIONAL (~$34 average) and the dollar risk floated with stop width instead of being held constant: measured over 64 live trades: risk ranged $0.52 to $8.79 -- a 17x spread That is the opposite of what risk-based sizing is for, and it concentrated the damage exactly where the stops were widest. On 2026-09-15/16 the four widest-stop entries (CANG 13.5%, FTFT 21.6%, ZTG 13.2%, VNCE 19.8%) produced -$8.57 of an -$8.84 week. It also interacts badly with the -10% catastrophe floor: any stop wider than 10% is effectively a 10% stop, so a wide-stop trade cannot be saved by its own stop but still realises a full 10%+ loss on the same notional. At 1.5% the risk calc binds for wide stops while the position cap still binds for narrow ones, compressing the spread to 6.8x. Replaying the same 64 trades: -$4.09 -> -$0.32. Checked that this is risk EQUALISATION and not merely trading smaller: against a plain proportional shrink to the same average notional, equalising is worth +$3.27 at 1.25%, +$2.30 at 1.0%, +$2.45 at 0.75%. The benefit holds at every matched size. Below 1% trades start being skipped outright as shares round to zero (1 of 64 lost at 1.0%, 13 of 64 at 0.5%) -- a hidden cost that looks like improved P&L. 1.5% is the tightest setting that drops no trades. Expressed as a percentage rather than TRADING_MAX_RISK_DOLLARS so it scales with the account. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01A2LepdJfPCfK5Q8uznjFBM --- deploy/docker/overrides.live.seed.env | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/deploy/docker/overrides.live.seed.env b/deploy/docker/overrides.live.seed.env index 32f0a4c..0e6a911 100644 --- a/deploy/docker/overrides.live.seed.env +++ b/deploy/docker/overrides.live.seed.env @@ -103,7 +103,23 @@ TRADING_REGIME_GATE_ENABLED=0 TRADING_REGIME_GATE_P_MIN=0.5 TRADING_REQUIRE_ABOVE_VWAP=1 TRADING_REWARD_MULTIPLE=10.0 -TRADING_RISK_PER_TRADE_PCT=0.05 +# RISK PER TRADE cut 0.05 -> 0.015 (2026-09-16). At 5% the risk budget was +# unreachable: 5% of ~$240 is $12, which on a 4.5% stop needs $267 of notional +# against a $38 position cap (TRADING_MAX_POSITION_PCT=0.16). So the POSITION CAP +# bound on every trade and the risk calc never did — every position was the same +# NOTIONAL and the dollar risk floated with stop width, a measured 17x spread +# ($0.52 to $8.79) across 64 live trades. Wide-stop names carried 3-8x the risk of +# narrow-stop ones; on 2026-09-15/16 the four widest-stop trades produced -$8.57 of +# an -$8.84 week. +# +# At 1.5% the risk calc binds for wide stops while the position cap still binds for +# narrow ones, compressing the spread to 6.8x. Replayed over 64 live trades: +# -$4.09 -> -$0.32, and the gain is NOT just smaller size — against a plain +# shrink to the same average notional it is worth +$3.1 to +$3.3. Below 1% trades +# start being skipped entirely (shares round to zero: 1 lost at 1.0%, 13 at 0.5%), +# so 1.5% is the tightest value that drops nothing. It scales with equity, unlike +# TRADING_MAX_RISK_DOLLARS. +TRADING_RISK_PER_TRADE_PCT=0.015 TRADING_SESSION_ONLY=1 TRADING_TRIGGER_SLIP_PCT=0.004 TRADING_UNIFIED_ENTRY=1