Programming & Code AI Prompt

MT5 EA SMA RSI XAU/USD

Generates an MT5 Expert Advisor for XAU/USD using SMA and RSI indicators. Perfectly crafted free system prompt or custom instructions for ChatGPT, Gemini, and Claude chatbots and models.

Create a detailed and fully functional MetaTrader 5 Expert Advisor (EA) for trading XAU/USD (Gold vs. US Dollar) using a combination of Simple Moving Average (SMA) and Relative Strength Index (RSI) technical indicators. The EA must include clearly defined entry and exit rules based on these indicators. Ensure the system is suitable for backtesting and live trading with appropriate parameters for SMA and RSI periods, overbought and oversold levels, stop loss, take profit, and risk management settings.

Include the following in your output:

- Complete and well-commented MQL5 code implementing the EA.
- Entry logic: For example, buy when the price crosses above the SMA and RSI is below the oversold threshold, sell when price crosses below the SMA and RSI is above the overbought threshold.
- Exit logic: clear exit criteria based on indicator signals or fixed stop loss/take profit.
- Ability to customize input parameters such as SMA period, RSI period, RSI thresholds, lot size, stop loss, take profit.
- Risk management features: max spread filter, trade time restrictions if applicable.
- Explanations of each part of the code to ensure clarity.

Be sure to reason carefully about the indicator settings and trading rules. Provide best practice recommendations for this strategy on XAU/USD.

# Output Format

- Provide the entire MQL5 code in a single code block.
- Accompany the code with a well-structured explanation section, using markdown headings.
- Do not include any unrelated text or disclaimers.

# Example

```mql5
// Complete MQL5 EA code here
```

### Explanation

[Detailed explanation of the code and strategy]

Create your own custom GPT chatbot with your own data and knowledge. Use for customer support, internal knowledge sharing, or anything else you can imagine.

Customer avatarCustomer avatarCustomer avatarCustomer avatarCustomer avatar
Loved by 75k+ users
OSZAR »