Overview
This prompt aims to guide developers in creating a specific automated trading strategy for MetaTrader platforms. Coders and traders seeking to implement systematic trading approaches will benefit from this structured framework.
Prompt Overview
Purpose: This strategy aims to automate trading on the MetaTrader platform using specific entry and exit conditions.
Audience: It is designed for traders who seek to implement a systematic approach to trading on a 1-minute chart.
Distinctive Feature: The strategy uniquely combines EMA analysis with strict entry conditions to enhance trade accuracy.
Outcome: Traders can expect consistent execution of trades based on predefined criteria, improving their trading efficiency.
Quick Specs
- Media: Text
- Use case: Content Creation, Generation, Planning & Strategy
- Industry: Consulting (Management, Strategy), Data & Analysis, Fintech & Digital Banking
- Techniques: Role/Persona Prompting, Self-Critique / Reflection, 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 develop an automated trading strategy for a MetaTrader platform that operates on a 1-minute (M1) chart timeframe. The strategy must strictly adhere to the following rules:
**Entry Conditions:**
– BUY Trade: Enter a BUY trade when all these conditions are met:
1. The current candle is green (Close price > Open price).
2. The candle’s low price is strictly above the 14-period Exponential Moving Average (EMA), with no touching.
3. The current price breaks above the candle’s high.
– SELL Trade: Enter a SELL trade when all these conditions are met:
4. The current candle is red (Close price < Open price). 5. The candle's high price is strictly below the 14-period EMA, with no touching. 6. The current price breaks below the candle's low. **Trade Management:** - Before opening any new trade, close all existing trades in the opposite direction. - Trade volume is fixed at 0.01 lots. - Take Profit is fixed at $2 per trade; do not set a Stop Loss. **Execution:** - The strategy must run and make decisions on every tick using the 1-minute chart data. Please provide clear, well-commented code for this strategy, specifying the platform (e.g., MQL4, MQL5, or other) if applicable. Additionally, include a brief explanation of how your code fulfills each of the above requirements. [/prompt_box]
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Open your preferred coding environment for MetaTrader.
- Create a new script or Expert Advisor file.
- Paste the prompt into the file as a comment.
- Write the code following the specified entry conditions and trade management.
- Test the strategy on a demo account to ensure functionality.
Tips for Best Results
- Understand the Strategy: Familiarize yourself with the entry conditions for both BUY and SELL trades based on candle color and EMA positioning.
- Use MQL5 for Implementation: Choose MQL5 as the programming language for developing your automated trading strategy on the MetaTrader platform.
- Implement Trade Management: Ensure your code includes logic to close opposite trades before opening new ones, maintaining a fixed trade volume of 0.01 lots.
- Test and Optimize: Backtest your strategy on historical data to ensure it meets performance expectations, adjusting parameters as necessary for optimal results.
FAQ
- What is the entry condition for a BUY trade?
A BUY trade is entered when the candle is green, above the 14-period EMA, and breaks above the high. - What triggers a SELL trade in this strategy?
A SELL trade is triggered when the candle is red, below the 14-period EMA, and breaks below the low. - What is the fixed trade volume for each trade?
The fixed trade volume for each trade is set at 0.01 lots. - What is the Take Profit amount for each trade?
The Take Profit for each trade is fixed at $2, with no Stop Loss set.
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.


