Overview
This prompt aims to create a comprehensive MQL5 trading strategy expert advisor for automated trading. Programmers and traders will benefit by gaining a ready-to-use tool that enhances their trading efficiency.
Prompt Overview
Purpose: This EA automates trading based on advanced liquidity grab and order flow methodologies.
Audience: Designed for professional traders seeking to implement complex strategies without manual intervention.
Distinctive Feature: It integrates multi-timeframe analysis and robust risk management for effective trade execution.
Outcome: Users can expect efficient, automated trading aligned with specified market conditions and strategies.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Creative Writing & Storytelling, Fintech & Digital Banking, Productivity & Workflow
- Techniques: Function Calling / Tool Use, Role/Persona Prompting, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create a fully functional MQL5 trading strategy expert advisor (EA) that implements the advanced liquidity grab and order flow methodology as detailed below. This EA should be ready to copy, paste, and run without further modification, designed to open trades based on the following comprehensive rules and logic.
**Trading Sessions:**
– Only trade during:
– London: 07:00 – 11:00 UTC
– New York: 12:00 – 16:00 UTC
**Liquidity Concepts:**
– External Liquidity:
– Prior day’s high/low and clear swing highs/lows.
– Look for liquidity grabs (sweep wicks beyond these levels).
– Internal Liquidity:
– Equal highs/lows and minor pullbacks inside the current range.
– Targets for take profit (TP1) or break of structure (BOS) context.
**Key Price Action Elements:**
– Confirm overall market trend direction (bullish or bearish).
– Identify order blocks (OB) or imbalance areas (FVG – Fair Value Gaps) aligned with the trend.
– Detect external liquidity grabs by sweeping previous swing highs/lows with stop hunt wicks.
– Confirm Break of Structure (BOS) on a 5-minute timeframe after the sweep.
– Draw the breaker block as the last opposite candle before BOS (supply/demand zone).
– Use Fibonacci retracement on the impulse leg (from start of sweep to end of BOS), focusing on levels:
– 0.500
– 0.620
– 0.705
– 0.790
– Entry zone confluence:
– Breaker block + Fibonacci 0.705–0.790 levels.
**Entry Types:**
1. Limit Entry:
– Place Buy/Sell Limit orders inside breaker block + Fibonacci zone.
– Stop Loss (SL) just beyond the breaker block wick.
– Take Profits:
– TP1 at nearest internal liquidity,
– TP2 at next external liquidity,
– Optional TP3 at 1H order block or higher timeframe support/resistance zone.
2. Confirmation Entry:
– Use a 1-minute timeframe boost setup or micro BOS inside the breaker block.
– SL behind micro order block.
**Order Management:**
– Implement partial profit-taking or trailing stop beyond a 1:3 risk-to-reward ratio.
**Checklist Before Every Trade:**
– Confirm session timing.
– Confirm external liquidity grab occurred.
– Confirm BOS opposite to liquidity sweep.
– Confirm presence of breaker block + Fibonacci zone (0.705–0.790).
– Select entry type (limit or confirmation).
– Confirm SL placement tight behind zone or OB.
– Set TP at internal and external liquidity levels.
**Supplemental Concepts:**
– CHoCH (Change of Character):
– First structure break opposite to trend after liquidity grab, signaling early reversal.
– Imbalance (Fair Value Gap):
– Mark 3-candle patterns without wick overlap; price often returns to fill these gaps.
– Volume Confirmation:
– Optionally use tick volume spikes during liquidity grabs and BOS to validate trade intent and entry timing.
**Implementation Requirements:**
– The EA must handle multi-timeframe analysis (1-min and 5-min) within MQL5.
– Automatically identify and maintain structural elements (OB, FVG, liquidity zones).
– Ensure robust risk management with defined SL and TP levels.
– Provide clear, efficient, and maintainable code with comments explaining key logic blocks.
# Steps
3. Detect current timeframe and session applicability.
4. Analyze previous swing highs and lows for external liquidity zones.
5. Detect liquidity sweep wicks beyond swing highs or lows.
6. Confirm BOS on 5-min timeframe in direction opposite sweep.
7. Identify breaker block candle prior to BOS.
8. Draw Fibonacci retracement of impulse leg from sweep start to BOS end.
9. Confirm confluence zone (breaker block + Fibonacci 0.705–0.790).
10. Decide entry type:
– Limit order within confluence zone
– Confirmation entry on 1-min micro BOS/boost.
11. Set SL and TP1/TP2 (and optional TP3) accordingly.
12. Monitor trade for partial exit or trailing stop after 1:3 risk:reward.
# Output Format
Provide a complete MQL5 Expert Advisor source code implementing the above strategy that can be compiled and tested immediately. Include comprehensive comments detailing the logic for each key segment, variables, and functions used.
This EA should enable professional-level, automated order flow trading based on liquidity grabs, structure breaks, and confluence zones as described.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste the prompt into your preferred coding environment.
- Ensure you have MQL5 setup for compiling code.
- Run the code to generate the Expert Advisor.
- Test the EA in a demo account for functionality.
- Adjust settings as needed based on performance results.
Tips for Best Results
- Session Timing: Ensure trades are executed only during specified London and New York sessions for optimal market activity.
- Liquidity Analysis: Identify external and internal liquidity zones by analyzing prior day’s highs/lows and equal highs/lows for potential trade setups.
- Entry Strategy: Choose between limit entries within the confluence zone or confirmation entries based on micro break of structure for better accuracy.
- Risk Management: Set tight stop losses just beyond the breaker block and establish multiple take profit levels to secure gains effectively.
FAQ
- What is the main purpose of the MQL5 EA?
To automate trading based on liquidity grabs and order flow methodology during specified trading sessions. - What are the key trading sessions for this EA?
London: 07:00 – 11:00 UTC and New York: 12:00 – 16:00 UTC. - What is a breaker block in trading?
A breaker block is the last opposite candle before a break of structure, indicating supply or demand zones. - What are the Fibonacci levels used for entries?
The key Fibonacci levels are 0.500, 0.620, 0.705, and 0.790.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


