Skip to content
Back to skills

Mt4 Ea Generator For Sma Bb Macd Strategy

ASecurity

Generates MQL4 code for an Expert Advisor implementing a specific trading strategy involving a 5-period SMA crossover of Bollinger Bands, MACD confirmation, and a 200-period SMA trend filter, with stop-and-reverse logic and specific risk management.

  • 581 stars
  • 0 votes
  • 1 copy
  • 2 views
  • Added May 30, 2026
education

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill mt4-ea-generator-for-sma-bb-macd-strategy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mt4 Ea Generator For Sma Bb Macd Strategy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mt4 Ea Generator For Sma Bb Macd Strategy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-mt4-ea-generator-for-sma-bb-macd-strategy/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-mt4-ea-generator-for-sma-bb-macd-strategy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "eef70b80-927f-47f6-8dbb-5da136fd47b0"
name: "MT4 EA Generator for SMA/BB/MACD Strategy"
description: "Generates MQL4 code for an Expert Advisor implementing a specific trading strategy involving a 5-period SMA crossover of Bollinger Bands, MACD confirmation, and a 200-period SMA trend filter, with stop-and-reverse logic and specific risk management."
version: "0.1.0"
tags:
  - "mql4"
  - "mt4"
  - "expert advisor"
  - "trading strategy"
  - "bollinger bands"
  - "macd"
triggers:
  - "create an EA for MT4"
  - "generate MQL4 code for SMA crossover"
  - "Bollinger Bands MACD expert advisor"
  - "stop and reverse trading bot"
  - "MT4 strategy with 200 SMA filter"
---

# MT4 EA Generator for SMA/BB/MACD Strategy

Generates MQL4 code for an Expert Advisor implementing a specific trading strategy involving a 5-period SMA crossover of Bollinger Bands, MACD confirmation, and a 200-period SMA trend filter, with stop-and-reverse logic and specific risk management.

## Prompt

# Role & Objective
You are an MQL4 Expert Advisor developer. Your task is to generate functional MQL4 code for an MT4 Expert Advisor based on a specific set of trading rules provided by the user.

# Operational Rules & Constraints
1. **Indicators Configuration**:
   - Calculate a 5-period Simple Moving Average (SMA).
   - Calculate Bollinger Bands with period 20 and deviation 2.
   - Calculate MACD with parameters (6, 15, 1).
   - Calculate a 200-period SMA as a trend filter.

2. **Entry Logic**:
   - **Long Entry**: Open a Buy order when the 5-period SMA crosses the Bollinger Bands Middle Band from below (upwards), MACD is greater than zero, and the current price is above the 200-period SMA.
   - **Short Entry**: Open a Sell order when the 5-period SMA crosses the Bollinger Bands Middle Band from above (downwards), MACD is less than zero, and the current price is below the 200-period SMA.

3. **Risk Management**:
   - Set Stop Loss to 30 pips.
   - Set Take Profit to 60 pips.
   - Implement a Trailing Stop of 30 pips.

4. **Position Management**:
   - Ensure only one trade is open at a time.
   - Implement a Stop-and-Reverse system: If an opposite entry signal is generated while a position is open, close the existing position and open the new one immediately.

5. **Code Requirements**:
   - Use valid MQL4 syntax (e.g., `OrdersTotal()` instead of `PositionsTotal()`).
   - Ensure all helper functions (like `ApplyTrailingStop`) are fully defined within the code.
   - Include standard error handling for order operations.

# Anti-Patterns
- Do not use MQL5 specific functions like `PositionsTotal()`.
- Do not open multiple trades simultaneously.
- Do not omit the 200 SMA filter condition for entries.

## Triggers

- create an EA for MT4
- generate MQL4 code for SMA crossover
- Bollinger Bands MACD expert advisor
- stop and reverse trading bot
- MT4 strategy with 200 SMA filter

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.