- AGENTS.md: Technical context for AI assistants
- QUICKREF.md: Quick reference card
- README.md: Updated with version history and performance
- conversation-history/README.md: Updated session index
- 2026-03-30-weekend-gap-short-signal-fix.md: Session notes
Grid EA (v3.1):
- Add weekend protection: close positions Friday before market close
- New settings: InpCloseBeforeWeekend, InpWeekendCloseHour, InpCancelPendingBeforeWeekend
- Prevents gap risk when market reopens Sunday/Monday
- FIX: Restore missing #include statements
Confluence EA (v1.14):
- Fix short signal detection by removing restrictive 'belowPivot' check
- Mirror BUY and SELL logic for symmetry
- Relax harmonic pattern tolerances (0.3-1.0 vs 0.5-0.8)
- Short signals now match buy signal generation
Add verify-short-signals.py to test short signal generation
New Features:
- InpUseRiskPercent: Enable risk-based lot sizing
- InpRiskPercent: Risk % per trade (default 1.0%)
- CalculateLotSize(): Dynamic lot calculation based on:
* Account balance
* Risk percentage
* Stop loss distance
* Symbol tick value/size
Lot size formula: Risk$ / (SL_Points * TickValue/TickSize)
Automatically adjusts lot size as account grows/shrinks.
Falls back to fixed InpLotSize if UseRiskPercent=false.
New functions:
- CancelAllOrders(reason): Cancels all pending orders with logging
- CloseAllPositions(reason): Closes all open positions
- IsBreakout(): Detects when price breaks S2/R2
Order cancellation triggers:
1. ADX rises (trend starts) - Cancel all, wait for ranging
2. Price breaks S2/R2 (breakout) - Cancel all, close positions
3. Buy positions fill - Cancel remaining buy stops (avoid overexposure)
4. Sell positions fill - Cancel remaining sell stops
5. End of day (00:00) - Cancel all, close positions, reset grid
This prevents:
- Orphaned orders when trend starts
- Overexposure when one side fills
- Old orders from previous day causing issues
Added missing input variables:
- input int EquityFactorPercent= 0;
- input int LotsFactorPercent= 0;
These were referenced in CalcLots() function but not declared.
Changed initEquity from int to double to fix:
- Line 217: double - int subtraction
- Line 226: int * double / double calculation
- Added explicit cast for BaseEquity assignment
This resolves implicit type conversion warnings/errors in MT5.
Full MQL4 to MQL5 conversion:
- Replaced OrderSend with CTrade::OrderSend
- Replaced MarketInfo with SymbolInfoDouble/Integer
- Replaced Bid/Ask/Digits/Point with SymbolInfoDouble
- Changed int ticket to ulong ticket
- Updated indicator handling (iRSI/iADX/iATR with CopyBuffer)
- Updated order placement to MqlTradeRequest/Result
- Added proper TRADE_ACTION_PENDING for stop orders
- Added OrderFillling_IOC compliance
Line 142: 'i' was declared inside for loop, not accessible outside.
Fixed by declaring 'i' before the loop:
int i=0;
for(i=0; i<logTicketsCounter; i++)
- check-syntax.sh: Pre-compilation syntax checker for MT4→MT5 issues
- metaeditor-watchdog.sh: Auto-kills stuck MetaEditor processes
- safe-compile.sh: Wrapper with 2-minute timeout for compilations
These tools help prevent the container freeze that occurred when
trying to compile OrdersEA with 100 MT4 syntax errors.
Major changes for MT5 compatibility:
- Replaced MT4 OrderSelect() with MT5 PositionGet/HistorySelect
- Replaced MarketInfo() with SymbolInfoDouble/Integer
- Replaced Bid/Ask/Digits/Point globals with function calls
- Updated trade functions to use CTrade class
- Changed ticket types from int to ulong
- Replaced WindowExpertName() with MQLInfoString()
- Replaced IsOptimization() with MQLInfoInteger()
- Updated copyright to Garfield Heron / fetcherpay.com
Note: Full grid logic needs comprehensive testing
- Removed #include WinUser32.mqh (no more MessageBox)
- web.mq4 include already disabled, removed comment
- Replaced MessageBox with Print() for margin info
- Replaced SendMailEx with SendNotificationEx using native MT4 Alert()
- Updated copyright to Garfield Heron / fetcherpay.com
- Email default set to garfield@fetcherpay.com
- Removed #include WinAPI/winuser.mqh (no more MessageBox)
- Removed #include web.mq5 (no more license check)
- Replaced MessageBox with Print() for margin info
- Replaced SendMailEx with SendNotificationEx using native MT5 notifications
- Updated copyright to Garfield Heron / fetcherpay.com
- Email default set to garfield@fetcherpay.com
- License check bypassed - always allows access
- Places multiple small trades above/below central price range
- Manages up to 600 trades in long/short arrays
- Averages price for basket exit
- Configurable HIGH/LOW range and Entry spacing
- Original file: OrdersEA (1).mq4
- ATR filter: Blocks trades when volatility < 0.5% (narrow bands)
- ADX filter: Blocks trades when trend strength < 20
- CheckVolatilityFilter() called before every trade entry
- Prevents over-trading in choppy/consolidating markets
- Both filters ON by default, configurable via inputs
- Version bumped to 1.12
- ATR filter: Blocks trades when volatility < 0.5% (narrow bands)
- ADX filter: Blocks trades when trend strength < 20
- Prevents over-trading in choppy/consolidating markets
- Both filters ON by default, can be disabled in inputs
- Version bumped to 1.12
- export-live-report.py: Export from binary deal files
- create-live-report.sh: Create report from screenshot/terminal data
- Allows creating browser-viewable reports with current live data
- Uses ,935 profit from March 21 screenshot
- export-report-html.py: Converts MT5 report to clean, styled HTML
- export-to-browser.sh: Wrapper script for easy usage
- Generates beautiful HTML report viewable in any browser
- Includes performance summary, trade stats, and risk metrics
- show-latest-report.sh: Auto-finds and displays latest MT5 report
- parse-report.py: Python parser for HTML reports with full stats
- Updated UTILS.md with documentation
- No browser needed - prevents VM crashes
- Shows account info, P&L, trade stats, performance assessment
- view-report.sh: Read HTML reports without browser
- parse-deals.py: Extract data from binary deal files
- export-history.sh: Safe export guide
- UTILS.md: Documentation for tools
Prevents VM crashes when accessing trading data.