EMA Pullback · Two-Legged Setup · Touch Confirmation

M2B / M2S Setup

Two-Legged Pullback to EMA · Mean-Reversion Entries · Pine Script v6

Catches two-legged pullbacks to the 20 EMA with price-action confirmation. In an uptrend, it waits for two consecutive down closes that touch the EMA, then fires an M2B signal when price rejects back above. The bearish mirror fires M2S on rallies into a falling EMA.

2
Signals
20
EMA Length
2 Legs
Min Pullback
v6
Pine Script
M2B
Overview

What Is M2B / M2S?

M2B/M2S is a mean-reversion entry system that waits for the market to pull back to a 20 EMA in two consecutive legs, then confirms a rejection with a candle close back on the trend side. It is built on the principle that in a trending market, the EMA acts as dynamic support or resistance — and the best entries come from buying the dip into that support (M2B) or selling the rally into that resistance (M2S).

The indicator is designed for index futures traders who want disciplined pullback entries rather than chasing breakouts. It works on any timeframe but is most reliable on 5-minute through 1-hour charts.

Signals

The Two Signals

Two signals, one direction each. They are mutually exclusive — you will never see both on the same bar.

M2B — Market to Buy
Bullish Pullback Entry

Fires when price is in an uptrend (close above 20 EMA), pulls back for two consecutive down closes, the candle's low touches the EMA, and the close rejects back above.

Green label below the bar.

M2S — Market to Sell
Bearish Pullback Entry

Fires when price is in a downtrend (close below 20 EMA), rallies for two consecutive up closes, the candle's high touches the EMA, and the close rejects back below.

Red label above the bar.

Logic

How It Works — Step by Step

● Step 1 — Trend Filter
A single 20-period EMA determines trend. If close > EMA the trend is up and only M2B (buy) setups are considered. If close < EMA the trend is down and only M2S (sell) setups are considered. There is no neutral state — the EMA is the line in the sand.
● Step 2 — Two-Legged Pullback Counter
In an uptrend, the indicator counts consecutive bars that close lower than the previous bar. The counter increments by 1 each time and resets to 0 whenever a bar closes higher. A minimum count of 2 is required — meaning at least two bars in a row must pull back against the trend.
● Step 3 — EMA Touch Confirmation
Having two down legs is not enough. The candle's low must reach or pierce the 20 EMA (for buys) or the high must reach or pierce the 20 EMA (for sells). This filters out shallow pullbacks that never actually test the mean.
● Step 4 — Rejection Close
The final gate: the bar must close back on the trend side of the EMA. For M2B, close must be above the EMA after touching it. For M2S, close must be below. This is the rejection — the candle wick dipped into the EMA but buyers (or sellers) pushed it back. That rejection is the entry.
● Step 5 — First Trigger Only
To prevent duplicate signals on consecutive bars, the indicator only fires on the first bar where all conditions are met. If the previous bar already triggered, the current bar is suppressed.
Visual Flow

Signal Anatomy

M2B (Buy) sequence:

1. Price is above the 20 EMA (uptrend confirmed).
2. Candle A closes lower than the previous bar → leg count = 1.
3. Candle B closes lower than Candle A → leg count = 2 (minimum met).
4. Candle B's low touches or pierces the 20 EMA → EMA touch confirmed.
5. Candle B closes back above the 20 EMA → rejection confirmed.
6. ▲ M2B label fires.

M2S (Sell) is the mirror image — consecutive up closes into a rising resistance EMA, high touches EMA, close rejects back below.

Reading Guide

How to Use M2B / M2S

Step 1 — Confirm the trend. Is price above or below the 20 EMA? Only take signals in the direction of the trend.

Step 2 — Wait for the pullback. Watch for two or more consecutive closes against the trend. The background color (green for uptrend, red for downtrend) keeps you oriented.

Step 3 — Wait for the EMA touch. The optional yellow dot markers show every EMA touch, even ones that don't become full signals. Enable "Show EMA Touch Markers" to study how often price reaches the EMA.

Step 4 — Enter on the signal. The M2B or M2S label confirms all four conditions are met. Enter at the close of that bar or on the open of the next bar.

Step 5 — Manage the trade. The 20 EMA itself can serve as a dynamic stop reference. If price closes back through the EMA against your position, the setup is invalidated.

Conditions

When It Works Best

● Ideal Conditions
Trending markets — the EMA must be acting as dynamic support/resistance
5-minute to 1-hour charts — enough structure for clean pullbacks
Index futures — MNQ, MES, ES, NQ
First 2–3 pullbacks in a new trend — highest win rate
Confluence with other tools — combine with TD Sequential, support/resistance, or volume
● Avoid
Choppy, range-bound markets — EMA gets whipsawed and signals fail
Late-stage trends — after many pullbacks the trend is exhausted
Low volume sessions — holidays, lunch hour, overnight
1-minute chart — too noisy, excessive false signals
Fighting the EMA — never take M2B when price is below the EMA
Configuration

Default Parameters

ParameterDefaultDescription
EMA Length20Periods for the trend-defining EMA
Show Trend BackgroundtrueGreen/red background tint for current trend
Show EMA Touch MarkersfalseYellow dots on every bar that touches the EMA during a pullback
Show Info TabletrueDashboard showing trend, leg count, and signal readiness
Table PositionTop RightDashboard placement (6 options: top/mid/bot × left/center/right)
M2B Label ColorGreenBullish signal label background
M2S Label ColorRedBearish signal label background
Info Table

Dashboard Readout

The info table gives you a live snapshot of the indicator's state without reading the chart:

Trend — UPTREND (green), DOWNTREND (red), or FLAT (gray). Based on close relative to the 20 EMA.

Legs — Two numbers: current consecutive down-leg count / current up-leg count. When either reaches 2, the indicator is primed.

Signal — "Ready" (green) when the pullback count meets the minimum and price is on the correct side of the EMA. "Waiting" (gray) otherwise.

Setup Guide

How to Load It

1
Open TradingView
Load MNQ1!, MES1!, ES1!, or NQ1! on a 5-minute or 15-minute chart.
2
Search the Script
Search "M2B/M2S Setup" in the TradingView public scripts library.
3
Leave Defaults
The 20 EMA, trend background, and info table are pre-configured.
4
Enable Touch Markers (Optional)
Turn on "Show EMA Touch Markers" to study how often price reaches the EMA before committing to trades.
5
Paper Trade First
Trade on paper for at least 2 weeks before committing capital.
Combining Modules

Works With Other SireMammat Indicators

M2B/M2S is designed to be layered with other modules. Higher-conviction setups come when multiple signals align:

+ TD Sequential — An M2B signal that fires on the same bar as a TD buy countdown 13 is a high-conviction entry.

+ School Run — If the School Run bracket breaks out and M2B fires on the first pullback, the trend-day entry is confirmed.

+ Fishing Technique — A Fishing buy at the same level as an M2B setup adds stop-run confirmation to the pullback entry.

+ Always-In — Use the Always-In bar color to confirm momentum is aligned before taking the M2 signal.

Risk Disclaimer
M2B/M2S is an entry signal, not a complete trading system. It does not define stop-loss, take-profit, or position sizing. Always combine with proper risk management. Past signal performance does not guarantee future results. Trading futures involves substantial risk of loss.
Quick Stats
Signals2 (M2B / M2S)
EMA Length20
Min Pullback Legs2 consecutive
ConfirmationEMA Touch + Rejection Close
InstrumentMNQ / MES / ES / NQ
Timeframe5m – 1H
VersionPine Script v6
LicenseFree & Open
Signal Legend
▲ Green LabelM2B — Buy Setup
▼ Red LabelM2S — Sell Setup
● Yellow DotEMA Touch (optional)
Green BackgroundUptrend (close > EMA)
Red BackgroundDowntrend (close < EMA)
Setup Checklist
1. TrendClose above/below EMA?
2. Legs≥2 consecutive against trend?
3. TouchWick reaches EMA?
4. RejectClose back on trend side?
5. SignalM2B or M2S label fires
Based On
AuthorTom Hougaard
MethodPrice Action Playbook
FocusMean-Reversion Entries
Tags
M2BM2SEMA PullbackTwo-LeggedMean ReversionTom HougaardIndex FuturesMNQESTouch & RejectPine Script v6Free