Commit graph

5 commits

Author SHA1 Message Date
darashikoh
a673c29a5a 1. TechnicalAnalysis.mqh - Complete Technical Analysis Module
Key Features:

Multiple Indicators: ATR, RSI, MA, Bollinger Bands, MACD, Stochastic, ADX, CCI
Market Analysis: Trend strength, volatility ratio, breakout detection, reversal patterns
Signal Generation: Entry/exit signals with multi-timeframe confirmation
Support/Resistance: Automatic level detection with strength rating
Pattern Recognition: Double top/bottom, divergence detection
Market Conditions: Trending, ranging, volatile market detection
Compatible Methods: All methods called by main EA are properly implemented
2025-08-27 17:49:01 +01:00
darashikoh
56209c4d63 Summary of Fixes
The "Stop distance must be greater than 0" error is caused by a chain of issues in the ATR calculation. Here's what you need to do:
1. Replace the GetValidATR function in EntrySystem.mqh
The original code had a recursive call bug. Replace the entire EntrySystem.mqh file with the fixed version I provided above.
2. Update the GetATR method in TechnicalAnalysis.mqh
Replace the GetATR method with the fixed version that includes fallback calculations.
3. Update the AnalyzeMarket method in TechnicalAnalysis.mqh
Replace the AnalyzeMarket method with the enhanced version that ensures volatility is always valid.
4. Update the main EA file (ERMT_6.0.mq5)
Replace the CheckEntrySignals() and UpdateMarketConditions() functions with the enhanced versions that include debugging and validation.
Key Changes Made:

Fixed Recursive Bug: The GetValidATR function was calling itself instead of using market.volatility
Added Multiple Fallbacks:

Primary: Use market.volatility from TechnicalAnalysis
2025-07-30 19:33:01 +01:00
darashikoh
3295dab1db Summary of Changes to Fix Zero Stop Distance Error
The error "Invalid stop distance: 0.0" was occurring because the entry signals were being generated with invalid (zero) stop distances. This happened when the market volatility (ATR) value was 0 or not properly calculated.
Key Changes Made (Version 6.5.1):

Added GetValidATR() Helper Method in EntrySystem.mqh:

This method ensures we always have a valid ATR value
Includes multiple fallback mechanisms:

Direct ATR calculation if market data is invalid
0.1% of current price as a fallback
Minimum 20 pips for forex pairs




Updated All Entry Strategy Methods to use GetValidATR():

CheckMACrossover()
CheckMAPullback()
CheckMomentum()
CheckContrarian()
CheckBreakout()
CheckMeanReversion()
CheckMultiStrategy()


Enhanced Signal Validation in CheckSignal():

Added explicit check for stop_loss_distance > 0
Signal is rejected if stop distance is invalid
Better error logging to identify which strategy produced invalid signals


Improv
2025-07-30 13:32: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