diff --git a/crates/ml-alpha/cuda/rl_fused_reward_pipeline.cu b/crates/ml-alpha/cuda/rl_fused_reward_pipeline.cu index 777528831..f1b034703 100644 --- a/crates/ml-alpha/cuda/rl_fused_reward_pipeline.cu +++ b/crates/ml-alpha/cuda/rl_fused_reward_pipeline.cu @@ -220,11 +220,21 @@ extern "C" __global__ void rl_fused_reward_pipeline( r -= entry_cost; } - // 2. Short-hold penalty: trade close with hold time below minimum. - if (done > 0.5f && (float)hold_time < min_hold) { + // 2. Short-hold penalty: ONLY on winning quick exits. + // Quick exit on a LOSER is GOOD (bail early on bad wave) — no penalty. + // Quick exit on a WINNER is BAD (bailed on a good wave) — penalize. + if (done > 0.5f && r > 0.0f && (float)hold_time < min_hold) { r *= penalty; } + // 2b. Quick-exit bonus on LOSING trades: reward fast loss-cutting. + // Reduces the loss magnitude proportional to how quickly the model + // exited. Surfer philosophy: bail early on closing-out waves. + if (done > 0.5f && r < 0.0f && (float)hold_time < min_hold) { + const float cut_bonus = 1.0f - 0.5f * ((min_hold - (float)hold_time) / min_hold); + r *= cut_bonus; // reduces loss by up to 50% for immediate exits + } + // 3. Long-ride bonus: profitable close amplified by hold time. if (done > 0.5f && r > 0.0f && hold_time > 0) { const float ride_mult = 1.0f + hold_bonus * sqrtf((float)hold_time);