Commit graph

61 commits

Author SHA1 Message Date
darashikoh
ffae6bf4ff Fix: Resolve backtesting trade execution issues
Problem: EA was not opening trades during backtesting due to overly restrictive spread validation and position sizing calculation failures.
Changes Made:
1. EntrySystem.mqh - Improved Signal Validation

 Relaxed spread filter from fixed 10% ATR to dynamic 20-50% based on market conditions
 Added absolute maximum spread limit (5 pips for majors)
 Enhanced spread rejection logging with actual values

2. RiskManager.mqh - Fixed Position Sizing

 Added comprehensive logging throughout position size calculation
 Improved handling of minimum lot size requirements
 Added account balance validation before attempting trades
 Enhanced error messages for debugging
 Fixed lot size calculation for proper point value conversion
 Added validation for stop distance and risk amount inputs

3. ERMT_6.0.mq5 - Enhanced Configuration

 Increased default risk percent from 1% to 2.5% for better testing
 Increased max risk percent from 2% to 5%
 Adde
2025-07-22 17:33:44 +01:00
darashikoh
cd2696ae28 fix: resolve invalid pointer access error in EA initialization
- Replace dot operator (.) with arrow operator (->) for all pointer object access
- Add NULL checks before using Utils pointer in OnTick()
- Fix pointer syntax for modules: RiskMgr, TradeMgr, EntrySys, TechAnalysis, Dashboard, Utils
- Remove invalid Utils reference in OnDeinit() after object deletion

Fixes initialization crash at line 195 in ERMT_6.0.mq5 
File header renamed to ERMT_6.4.mq5
2025-07-22 17:07:29 +01:00
darashikoh
b801040daf Risk Management Overlay EA v6.0 - Code Review and Fix Guide
Critical Issues Found
1. Main EA File (ERMT_6.0.mq5)
Missing Definitions:

EnableLogging variable is used but never defined
Timer initialization missing in OnInit()
Timer cleanup missing in OnDeinit()
Performance metrics initialization not called

Duplicate Code:

CheckEntrySignals() function is defined twice (lines 486 and 577)
HelloWorld example code accidentally included (lines 628-685)

Missing Error Handling:

No connection checks in OnTick()
No auto-trading verification

2. DataTypes.mqh Issues
Duplicate Enumerations:

ENUM_TP_STRATEGY and ENUM_TP_MODE serve the same purpose
Should keep only ENUM_TP_MODE

Inconsistent Structure Fields:

TechnicalLevel has both 'score' and 'strength' fields
ManagedTrade references non-existent ENUM_TP_STRATEGY

Missing Initialization Functions:

No init function for PerformanceMetrics
No init function for EntrySignal

3. Module Inconsistencies
Utilities.mqh:

Two commissio
2025-07-22 16:37:29 +01:00
darashikoh
32705c5d61 1 - Backtest for 1.5 years EURUSD M5 - no trades initia; Critical error on exitlised
2- Compile and debug - Critical error on exit - OnDeinit
3- Fix for Entry System - Add to OnTick():
4 - ENUM_TECHNICAL_LEVEL enum in DataTypes.mqh -> other Enums and structures DataTypes.mqh v3
The Complete DataTypes Module provides the robust foundation needed for your institutional-grade risk management system, offering better trade tracking, risk analysis, and technical integration capabilities essential for professional algorithmic trading.

Moved modules to inside Advisors post-compile 1 debug; became unversioned
2 -
2025-07-20 22:38:24 +01:00
darashikoh
644016f8e2 Moved ERMT_6.0, post first compile and debug to Advisors folder 2025-07-20 19:23:58 +01:00
darashikoh
fb5ce9481d Added v2.0 in the header to reflect function change from Compile 1 Debug 2025-07-20 17:37:34 +01:00
darashikoh
ac6089b898 Compile 1 Debug
Position Selection in MQL5: Unlike MQL4, MQL5 doesn't have PositionSelectByIndex(). You must use:

PositionGetSymbol(i) to get the symbol at index i
PositionSelect(symbol) to select a position by symbol
PositionSelectByTicket(ticket) to select by ticket


Commission Handling: In MQL5, commission is stored at the deal level, not the position level. To get the total commission for a position, you need to sum up the commissions from all deals related to that position.
Type Casting: When converting between numeric types, explicit casting is recommended to avoid warnings.
2025-07-20 17:22:58 +01:00
darashikoh
7aaae3f1a1 ERMT modules v6.0 2025-07-20 17:02:39 +01:00
darashikoh
aebe367724 new files added 2025-07-20 16:41:20 +01:00
darashikoh
4ab54de5f6 new files added 2025-07-08 23:34:12 +01:00
5a3d4c4d30 Initial commit 2025-06-09 08:52:01 +00:00