CRITICAL FIX:
- MoveToBreakeven() now validates against broker stop level before modification
- Prevents "Invalid stops" error causing infinite retry spam
- Marks breakeven_applied=true even on failed modify to stop retries
RELATED FIXES:
- Disabled analyzer cleanup in OnDeinit to prevent error 506 pointer access crash
- Analyzer GenerateAnalysisReport() file I/O unsafe during shutdown
- TODO: Refactor analyzer report generation to be shutdown-safe
Changes to PositionManager_PME_Complete.mqh:
- Lines 854-876: Added ValidateStopLoss() check in MoveToBreakeven()
- Failsafe: Mark BE attempted even if modify fails post-validation
- Prevents tick-spam when BE trigger met but SL too close to market price
Changes to ERMT_PME_2.1_M5.mq5:
- Lines 893-906: Commented out g_analyzer cleanup block in OnDeinit()
- Temporary disable pending shutdown-safe refactor
Testing:
- Before: "failed modify #7... [Invalid stops]" spam, backtest hangs
- After: Clean execution, BE either succeeds or silently skips
- Parametric optimization now completes successfully
Dependencies: Requires M5 v2.1 changes from previous commit