Build a MACD + RSI Confluence EA for MT5 — No Code
Quick Answer: MACD + RSI Confluence EA Without Code
Quick answer: Open AlfaTactix Strategy Builder → Step 3 — Signals → Buy tab on H1 → add MACD (12/26/9 defaults) with condition Crossover: Target Signal Line, Direction Above → add RSI(14) with condition Compare: Operator >, Value 50 → combine both with AND → mirror on Sell (MACD cross Below signal AND RSI < 50) → optional Step 4 session filter → Step 5 stop loss / lot size → Save → export MQL5 from Code Generator → compile once in MetaEditor → backtest on H1 EURUSD with Every tick in the Strategy Tester.
Disclosure: This tutorial uses AlfaTactix Strategy Builder. For platform overview see Build EA Without Coding. For single-indicator EAs see RSI Overbought/Oversold EA and Moving Average Crossover EA.
Related guides: MACD indicator deep dive · RSI indicator deep dive · EA Risk Management · Backtest in Strategy Tester
What Is MACD + RSI Confluence?
A MACD + RSI confluence Expert Advisor waits for two momentum signals to agree before opening a trade. Instead of acting on MACD alone (which whipsaws in ranges) or RSI alone (which lags in trends), confluence combines:
| Leg | Indicator | Typical rule |
|---|---|---|
| Momentum shift | MACD | MACD line crosses above (buy) or below (sell) the signal line |
| Trend filter | RSI | RSI > 50 for longs, RSI < 50 for shorts |
The EA runs in MetaTrader 5 on every tick or bar via OnTick(). You define both legs visually in Strategy Builder — no iMACD or iRSI code required.
Why traders search for this: MACD + RSI is one of the most common indicator pairs in forex education. Most tutorials show hand-written MQL5. This guide documents the same logic in Strategy Builder with every parameter and condition field the product exposes.
Confluence vs single indicator:
| Approach | Pros | Cons |
|---|---|---|
| MACD only | Catches momentum shifts early | Many false crosses in sideways markets |
| RSI 30/70 only | Clear mean-reversion zones | Weak in strong trends (RSI stays overbought) |
| MACD + RSI 50 confluence | Filters weak MACD crosses; aligns with trend bias | Fewer trades; both must agree |
For pure RSI extreme entries (30/70), see RSI Overbought/Oversold EA — No Code. For trend-following without oscillators, see Moving Average Crossover EA.
Classic Settings for Confluence EAs
| Setting | Starter value | Notes |
|---|---|---|
| MACD | 12 / 26 / 9, EMA, Close | Industry default; matches most chart presets |
| RSI | Length 14, Close, OB 70 / OS 30 | Use 50 as confluence threshold, not 30/70 |
| Timeframe | H1 (forex majors) | M15 = more signals; H4 = cleaner trends |
| Symbol | EURUSD, GBPUSD | Liquid pairs; tight spread helps |
| Logic | AND between MACD cross and RSI filter | OR would fire on either alone — too loose |
Works best: Trending or transitioning markets where MACD crosses coincide with RSI above/below the midline.
Struggles in: Choppy ranges — MACD crosses repeatedly while RSI oscillates around 50. Mitigate with Step 4 session/spread filters, RSI Cross 50 instead of Compare, or Step 5 stop loss.
Academy references: MACD indicator guide · RSI indicator guide
MACD and RSI Parameters in Strategy Builder
When you add indicators on Step 3 — Signals, the Parameters panel shows these fields (from product UI).
MACD parameters
| Parameter | Type | Range / options | Default | What it does |
|---|---|---|---|---|
| Fast Length | Number | 1 – 100 | 12 | Fast EMA period for MACD line |
| Slow Length | Number | 1 – 100 | 26 | Slow EMA period — must be > Fast Length |
| Signal Length | Number | 1 – 100 | 9 | EMA period for the signal line |
| Source | Select | Close, Open, High, Low | Close | Price series for calculation |
| Smoothing | Select | EMA, SMA, WMA | EMA | MA type (EMA is standard for MACD) |
Validation: If Fast Length ≥ Slow Length, the builder shows an error — set Slow 26 and Fast 12 for the classic preset.
RSI parameters
| Parameter | Type | Range / options | Default | What it does |
|---|---|---|---|---|
| Length | Number | 2 – 100 | 14 | Lookback for RSI calculation |
| Source | Select | Close, Open, High, Low | Close | Price series |
| Smoothing | Select | None, SMA, EMA, WMA, SMMA, VWMA | None | Optional extra smoothing |
| Smoothing Length | Number | 1 – 100 | 14 | Active when Smoothing ≠ None |
| Overbought | Number | 50 – 100 | 70 | Upper zone (used in OB/OS conditions) |
| Oversold | Number | 0 – 50 | 30 | Lower zone |
| Offset | Number | -50 – 50 | 0 | Bar shift (leave 0 for confluence EAs) |
Tip for confluence: Leave Overbought/Oversold at 70/30 defaults even when your entry uses 50 — those levels still apply if you add Overbought/Oversold Cross conditions later.
Condition Types for MACD and RSI
Open an indicator on Step 3 → Add condition. Below is every condition type relevant to a MACD + RSI confluence EA.
MACD conditions
1. Compare
Compare the MACD line to a numeric value (typically the zero line).
| Field | Options / range |
|---|---|
| Operator | >, <, >=, <=, ==, != |
| Value | Number (default 0 = zero line; typical range -0.001 to 0.001 on forex) |
Use case: “Only buy when MACD line > 0” as an extra AND filter alongside the signal cross.
2. Crossover (core confluence leg)
Detect when MACD crosses a target.
| Field | Options |
|---|---|
| Target | Signal Line · Zero Line · Histogram |
| Direction | Above (bullish) · Below (bearish) |
Confluence recipe — Buy: Target Signal Line, Direction Above.
Sell: Target Signal Line, Direction Below.
Alternative: Target Zero Line for stronger trend confirmation (fewer signals).
3. Divergence
Price vs MACD disagreement — reversal hint.
| Field | Range / options |
|---|---|
| Divergence Type | Bullish Divergence · Bearish Divergence |
| Lookback Period | 5 – 50 bars (default 20) |
Use case: Advanced entries — e.g. buy on Bullish Divergence AND MACD cross above signal. Not required for the starter confluence EA.
4. Histogram
Filter on MACD histogram state or direction.
| Field | Options |
|---|---|
| Histogram Type | Positive · Negative · Increasing · Decreasing |
| Threshold | Number (default 0 = zero line) |
Use case: Add Histogram → Positive AND to the buy rule so momentum is already expanding when MACD crosses.
RSI conditions (confluence essentials)
For the full list of RSI condition types (Divergence, Failure Swing, Breakout, Pattern, Slope), see RSI Overbought/Oversold EA — No Code. For confluence, you mainly need Compare and Cross.
1. Compare (simple trend filter)
| Field | Options |
|---|---|
| Operator | >, <, >=, <=, ==, != |
| Value | Number |
Confluence recipe — Buy: Operator >, Value 50.
Sell: Operator <, Value 50.
Fires whenever RSI satisfies the inequality on the signal bar — easy to backtest.
2. Cross (timing-aligned filter)
Detect when RSI crosses a level.
| Field | Options |
|---|---|
| Target | RSI · Overbought · Oversold · 50 |
| Direction | Up · Down |
| Value | Number (used with some targets) |
Confluence alternative — Buy: Target 50, Direction Up (RSI crosses above midline).
Sell: Target 50, Direction Down.
Fewer entries than Compare — often aligns better with the MACD cross bar.
Logical combinations on Step 3
Combine MACD and RSI with AND, OR, NOT, parentheses, and groups — same as Build EA Without Coding.
Starter expression:
(MACD Crossover Above Signal) AND (RSI Compare > 50)
Tighter expression:
(MACD Crossover Above Signal) AND (RSI Cross 50 Up) AND (MACD Histogram Positive)
Build the Confluence EA Step by Step
Workflow: six steps in Strategy Builder demo. We detail what matters for MACD + RSI confluence on H1.
Step 1 — Strategy information
- Name: e.g.
MACD RSI Confluence H1 EURUSD - Description: optional
Step 2 — Timeframes
- Enable one trading timeframe, e.g. H1 (matches tab tf0 on Step 3).
- Optional: add a higher timeframe for trend filter — see Advanced MTF Filters.
Step 3 — Signals (core)
Buy tab (H1)
- Open tab Buy → select timeframe H1.
- Add indicator → MACD (Momentum group).
- Parameters: Fast 12, Slow 26, Signal 9, Source Close, Smoothing EMA.
- Add condition → Crossover.
- Target: Signal Line
- Direction: Above
- Add indicator → RSI.
- Parameters: Length 14, Source Close, Overbought 70, Oversold 30, Offset 0.
- Add condition → Compare.
- Operator: >
- Value: 50
- Select both conditions → combine with AND.
Alternative RSI leg: Replace step 7 with Cross → Target 50, Direction Up.
Sell tab (H1)
- Open tab Sell → H1.
- Add MACD → Crossover → Target Signal Line, Direction Below.
- Add RSI → Compare → Operator <, Value 50 (or Cross Target 50, Direction Down).
- Combine with AND.
Step 4 — Filters (optional)
Examples: market session (London/NY overlap), spread cap, ATR volatility filter. Reduces MACD whipsaw when RSI hovers near 50. Full reference: Advanced EA MTF & Filters.
Step 5 — Risk management
Minimum for a testable EA:
| Setting | Suggestion |
|---|---|
| Lot / risk % | 0.01 lot demo or 1% risk |
| Stop Loss | Fixed pips or ATR-based |
| Take Profit | Optional; some traders exit on opposite MACD cross |
| One trade at a time | Avoid overlapping positions on same symbol |
Full reference: EA Risk Management.
Step 6 — Preview and Save
Review Buy/Sell rules in the preview panel → Save strategy to your account.
Export, Compile, and Backtest
- Open Code Generator → select your saved strategy → MQL5 → download
.mq5. - Copy to
MQL5/Experts, compile (F7) in MetaEditor. - Strategy Tester: Every tick based on real ticks, realistic spread, 6–12 months on H1 EURUSD.
- Compare Compare vs Cross for the RSI leg — note trade count and profit factor.
- Forward test on Demo before live. Read Strategy Tester vs Live.
If OrderSend fails with 10016, see Invalid Stops.
Improvements: Filters and Risk
| Problem | Builder lever |
|---|---|
| Too many trades | Switch RSI Compare → Cross 50; add MACD Histogram Positive AND |
| MACD whipsaw in range | Step 4 session filter; Step 5 stop loss; avoid M5/M15 until tuned |
| RSI stuck near 50 | Require MACD Compare > 0 AND cross above signal |
| Strong trends, late entries | Accept fewer trades or drop RSI filter in trends (test carefully) |
| Over-trading | Step 5 max trades; one position per symbol |
Related single-indicator EAs for comparison:
| EA type | Guide |
|---|---|
| RSI extremes (30/70) | RSI Overbought/Oversold EA |
| MA trend following | Moving Average Crossover EA |
Next Steps
- RSI Overbought/Oversold EA — No Code — full RSI condition types (Divergence, Failure Swing, Pattern)
- Moving Average Crossover EA — No Code — trend system without oscillators
- Build EA Without Coding — full six-step builder tour
- MACD Academy indicator page · RSI Academy indicator page
- Advanced EA MTF & Filters — multi-timeframe confluence
- Production-Ready MQL5 Without MetaEditor — export workflow
Try it: Strategy Builder demo — build the MACD signal cross + RSI 50 confluence EA in one session, export from Code Generator, and backtest.
References: MQL5 iMACD, MQL5 iRSI, MetaTrader 5 Strategy Tester.