Files
LEGSTECH Optimizer d95e5102c6 fix: V4-style EAs now expose optimizable params (auto-infer ranges)
Bug: a .set file saved out of MT5's "save settings" button (rather than
"save optimization") contains bare \`Inp...=value\` lines with no
\`|min|max|step\` metadata. The parser previously marked every such param
as type="fixed", and /api/ea_params filters fixed params out, so the user
saw "No optimizable parameters found in .set file" and could not start a
run with that EA. Reproduces with LEGSTECH_EA_V4 in this user's setup.

Fix:
- SetParser.parse() now takes an auto_infer_ranges flag (default True).
  When a line has no '|' separator, the parser falls back to a heuristic
  range based on the param's name + value:
  * `*Pips`, `*Period`, `*Lookback`, `*Spread`, `*Trades` → integer ±50% / ±150%
  * `*Percent`, `*Pct`, `*Risk`, `*Buffer`, `*Multiplier`, `*Ratio` → float ±50% / ×2
  * `RRRatio` → 0.5–2.5x with 0.25 step
  * `Score` → 0.5–1.5x with 0.05 step
  * `Lot*` → ±50% with 0.01 step
  * `Hour*` / `Session*` → 0–23
  * Pure 0/1 with `Use*`/`Enable*`/`Allow*` prefix → bool
  * `true`/`false` literals → bool
  * Generic numeric fallback → ±50% with type-appropriate step
- Added timeframe enum names (htf/mtf/ltf/_tf/timeframe) and debug/log
  flags to _FORCE_FIXED_PATTERNS so MT5 internal constants like
  InpHTF=16388 don't get incorrectly inferred as scalars.

Verified on LEGSTECH_EA_V4 (raw saved-settings format): 64/71 params now
optimizable (was 0); regression-checked LEGSTECH_EA_V2 still returns 42
params from its existing optimization metadata.
2026-04-25 13:23:14 +00:00
..