Overview
This prompt aims to guide developers in creating an Expert Advisor for MT4 using advanced Smart Money Concepts. Programmers and traders seeking automated trading solutions will benefit from this detailed framework.
Prompt Overview
Purpose: The EA aims to implement an advanced Smart Money Concept trading strategy for effective market analysis and trade execution.
Audience: This solution is designed for traders and developers familiar with MetaTrader 4 and advanced trading strategies.
Distinctive Feature: It incorporates sophisticated market structure identification and risk management tailored for various currency pairs and timeframes.
Outcome: Users will benefit from a robust EA that enhances trading decisions through precise market analysis and automated execution.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Consulting (Management, Strategy), Data & Analysis, Development Tools & DevOps
- 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
You are to create an Expert Advisor (EA) for MetaTrader 4 (MT4) that implements an advanced Smart Money Concept (SMC) trading strategy.
The EA should be capable of analyzing market data to identify:
– Supply and demand zones
– Liquidity pools
– Market structure
This analysis will guide trade execution. Your solution must include:
– Clear logic for entry and exit signals based on the advanced SMC framework
– Risk management parameters, including stop-loss and take-profit handling
– Adaptable settings for different currency pairs and timeframes
### Consider the following aspects when designing the EA:
– Market structure identification:
– Detect higher highs, higher lows, lower highs, and lower lows
– Establish trend direction and potential reversal points
– Supply and demand zones:
– Recognize key areas of price rejection or consolidation that signify liquidity zones
– Order block detection:
– Identify bullish and bearish order blocks to pinpoint potential entry zones
– Liquidity sweeps:
– Track areas where price grabs liquidity (e.g., above recent highs or below recent lows) before reversing
– Entry rules:
– Define precise conditions under which the EA will open buy or sell positions based on the above indicators
– Exit rules:
– Determine stop-loss and take-profit levels logically related to the identified zones or market levels
– Money management:
– Include parameters for lot size calculation based on risk percentage or fixed lot sizes
– Adaptability:
– Allow user inputs to configure timeframe, currency pair filters, and other strategy-specific parameters
### Steps
1. Parse market data and identify market structure, including swing highs/lows.
2. Detect supply and demand zones, order blocks, and liquidity sweeps using price and volume information.
3. Formulate entry and exit rules according to advanced SMC principles.
4. Implement risk and money management features.
5. Ensure the EA handles different timeframes and currency pairs as per user configuration.
6. Backtest and optimize the EA logic to ensure robust performance.
### Output Format
Provide MT4-compatible EA code (MQL4 language) as a complete source file (.mq4), including:
– Well-commented sections explaining the logic for the advanced SMC strategy components
– Entry/exit criteria
– Risk management settings
If any assumptions or limitations arise, document them clearly in the code comments.
### Notes
– The advanced SMC strategy involves nuanced market concepts; ensure the EA captures these accurately.
– Ensure the code is optimized for performance within MT4 limitations.
– Provide modular code where possible to allow future adjustments or improvements.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste it into your coding environment.
- Follow the outlined steps for EA development.
- Implement the logic in MQL4 language.
- Test and optimize the EA for performance.
- Document any assumptions or limitations in the code comments.
Tips for Best Results
- Market Structure Analysis: Implement logic to detect higher highs and lows to establish trend direction and reversal points.
- Supply and Demand Zones: Create functions to identify key price rejection areas that indicate potential liquidity zones for trade entries.
- Entry and Exit Logic: Define clear conditions for opening and closing trades based on market structure, supply/demand zones, and liquidity sweeps.
- Risk Management Features: Include adjustable parameters for stop-loss, take-profit, and lot size calculations based on user-defined risk percentages.
FAQ
- What is the purpose of an Expert Advisor in MT4?
An Expert Advisor automates trading strategies, analyzing market data to execute trades based on predefined rules. - How does the EA identify supply and demand zones?
The EA recognizes key price rejection areas and consolidation zones that indicate potential supply and demand levels. - What are liquidity pools in trading?
Liquidity pools are areas where price gathers liquidity, often leading to reversals after hitting recent highs or lows. - What is the role of risk management in the EA?
Risk management ensures controlled losses by setting stop-loss and take-profit levels based on market analysis.
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.


