feat: require gate reset before post-stop reentry
This commit is contained in:
@@ -43,7 +43,7 @@ export function liveRiskReward(setup: TradeSetup, currentPrice: number): number
|
||||
* app/services/qualification.py — keep the two in sync.
|
||||
*/
|
||||
export function qualifiesSetup(setup: TradeSetup, config: ActivationConfig): boolean {
|
||||
if ((setup.reentry_lockdown_remaining_sessions ?? 0) > 0) return false;
|
||||
if (setup.reentry_gate_reset_required) return false;
|
||||
if (setup.rr_ratio < config.min_rr) return false;
|
||||
// Live R:R from current price — drops setups whose price has already run
|
||||
// toward target (reward consumed) or through the stop.
|
||||
@@ -80,9 +80,8 @@ export function qualifiesSetup(setup: TradeSetup, config: ActivationConfig): boo
|
||||
* qualifiesSetup rule-for-rule (keep the order in sync).
|
||||
*/
|
||||
export function disqualifyReason(setup: TradeSetup, config: ActivationConfig): string | null {
|
||||
const lockdownRemaining = setup.reentry_lockdown_remaining_sessions ?? 0;
|
||||
if (lockdownRemaining > 0) {
|
||||
return `post-stop lockdown · ${lockdownRemaining} session${lockdownRemaining === 1 ? '' : 's'} remaining`;
|
||||
if (setup.reentry_gate_reset_required) {
|
||||
return 'post-stop gate reset required';
|
||||
}
|
||||
if (setup.rr_ratio < config.min_rr) {
|
||||
return `R:R ${setup.rr_ratio.toFixed(1)} below gate ${config.min_rr.toFixed(1)}`;
|
||||
|
||||
Reference in New Issue
Block a user