Skip to content

fix: widen MSS detection window — lookback 15→40, break scan 12→30 #47

Description

@cfournel

Problem

checkForMSSBefore() detects a 3-point swing structure (firstPivot → swing → OB → MSS break) but the time windows are too tight for XAUUSD M15:

Constraint Current Impact
lookback=15 (M15 bars per swing segment) 3.75h each Full structure must fit in 7.5h
lastCandleCheck > 12 (break scan limit) 3h MSS break must occur within 3h
inpMSSRequireFVG=true extra gate Break candle must also have FVG

Result: only 16 of 3695 valid OBs (0.35%) pass MSS detection over 4 years.

ICT Context

The logic is correct — for a bearish OB: firstHigh → lastLow → lastHigh(OB) → break below lastLow. The issue is purely the time constraints. XAUUSD swing structures often take 20–80 M15 bars to form, not 15.

Planned Fix

  1. checkForMSSBefore(int lookback = 15) → default 40
  2. lastCandleCheck > 12> 30 (both bullish and bearish branches)
  3. Test inpMSSRequireFVG=false separately

Success Criteria

More OBs passing MSS without sacrificing PF (target: PF ≥ 2.0, more trades)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions