Strategy Core: Multi-Timeframe Trend Following ("Father & Son" Rule) with Momentum & Trend Strength Filters.
I have a expert adviser that followes momentum, need to follow trend strength and father and son strategy in version of it.
This EA executes trades based on multi-timeframe alignment. It uses a higher timeframe to establish the primary market direction and a lower timeframe to execute precise entries.
The "Father" (Higher Timeframe - HTF): Determines the macro trend direction using an Exponential Moving Average (EMA) crossover. No trades are allowed against the Father's direction.
The "Son" (Lower Timeframe - LTF): Determines the immediate trade setup using an EMA crossover aligned with the Father, filtered by RSI (for momentum) and ADX (for trend strength).
The freelancer must ensure all indicator periods, methods, and price types are exposed as user-configurable inputs.
Timeframe: User defined (e.g., Daily or H4)
Fast EMA: Period (Default: 9), Applied to Close
Slow EMA: Period (Default: 21), Applied to Close
Timeframe: User defined (e.g., H1 or 15Min)
Fast EMA: Period (Default: 9), Applied to Close
Slow EMA: Period (Default: 21), Applied to Close
RSI (Relative Strength Index): Period (Default: 14), Overbought level (Default: 70), Oversold level (Default: 30)
ADX (Average Directional Index): Period (Default: 14), Minimum Trend Strength Level (Default: 25)
A Buy order should trigger at the close of a candle on the Son's timeframe if all the following conditions are simultaneously true:
Father Rule (HTF Trend): The HTF Fast EMA is strictly above the HTF Slow EMA ($Fast\_EMA > Slow\_EMA$).
Son Rule (LTF Crossover): The LTF Fast EMA has crossed above or is holding above the LTF Slow EMA.
ADX Filter (Trend Strength): The LTF ADX Main Line is above the Minimum Level (e.g., $> 25$), and the $+DI$ line is strictly above the $-DI$ line.
RSI Filter (Momentum): The LTF RSI line is above 50 but below the Overbought Level (e.g., $50 < RSI < 70$). This ensures momentum is strong but not overextended.
A Sell order should trigger at the close of a candle on the Son's timeframe if all the following conditions are simultaneously true:
Father Rule (HTF Trend): The HTF Fast EMA is strictly below the HTF Slow EMA ($Fast\_EMA < Slow\_EMA$).
Son Rule (LTF Crossover): The LTF Fast EMA has crossed below or is holding below the LTF Slow EMA.
ADX Filter (Trend Strength): The LTF ADX Main Line is above the Minimum Level (e.g., $> 25$), and the $-DI$ line is strictly above the $+DI$ line.
RSI Filter (Momentum): The LTF RSI line is below 50 but above the Oversold Level (e.g., $30 < RSI < 50$).
The EA must handle standard order management cleanly. Please include these features:
Order Execution: Market Orders executed precisely at the opening of a new bar on the Son's timeframe after a valid setup candle closes.
Position Sizing: Option for Fixed Lot Size (e.g., 0.1 lots) OR Risk Percentage based on Account Equity (e.g., risk 1% per trade).
Stop Loss (SL): Fixed in Pips/Points from entry price.
Take Profit (TP): Fixed in Pips/Points from entry price.
Trailing Stop: (Optional but highly recommended) Trailing activation and step size inputs to protect profits once the trade moves in our favor.
Please instruct the freelancer to follow these standard development guidelines:
Code Structure: The code must be cleanly commented in English. Handlers like OnInit() , OnDeinit() , and OnTick() should be distinctly organized.
Multi-Timeframe Efficiency: Use proper MQL5 data structures ( CopyBuffer , MqlRates ) to retrieve data from different timeframes efficiently without freezing the MetaTrader terminal.
Error Handling: Include explicit error checking for broker order execution errors (e.g., requotes, invalid stops) and log them via the Print() function.
Deliverables:
The fully compilable .mq5 source code file.
The compiled .ex5 executable file.