Loading…

Keltner Pullback Trend System

Keltner channels (an EMA middle line with ATR-multiple bands, Chester Keltner's original concept as popularised by Linda Bradford Raschke) are usually published as breakout systems - trade when price closes outside a band. This one deliberately does the opposite: it trades the pullback BACK toward the trend, using the channel bands as a mean-reversion trigger inside a trend the slow EMA filter has already confirmed, which is closer to how the channel is actually used by discretionary trend traders looking for a lower-risk entry than chasing the initial breakout. Native MQL4 has no built-in Keltner indicator, so the channel is computed directly from iMA (EMA) and iATR each bar - middle = EMA(N), bands = middle +/- (ATR(P) * multiplier). The entry itself needs two bars, not one: the pullback bar whose low (long side) or high (short side) touches or crosses the band, and the FOLLOWING bar closing back inside it. The close-back-inside bar is the actual trigger - a single wick into the band on its own is not enough, because that would fire mid-pullback before any bounce has actually been confirmed. Notes and limitations One position at a time on the chart's own symbol; exits rely entirely on the fixed stop/target sent with the order, there is no separate trailing-stop mechanism. The pullback confirmation needs two fully closed bars past the signal, so this is slower to react than a single-bar breakout trigger by design - that is the trade-off for waiting for the bounce rather than chasing the touch. A trending market that never pulls back cleanly to the band (a strong one-way run) will simply produce no signal at all - this system is not a breakout follower and will not chase price away from the channel.

Expert advisor · MT5 · v1.0 · Free

About Keltner Pullback Trend System

Keltner Pullback Trend System is an expert advisor (trading robot) for MetaTrader 5 based on Moving Average and ATR. It increases the lot size after a losing trade (martingale) and can size trades from your balance and risk percent. It has 13 settings, such as Keltner ma period, Keltner atr period and Band multiplier. MQL source code included.

Files in the download: KeltnerPullbackSystem.ex5, KeltnerPullbackSystem.mq5, KeltnerPullbackSystem.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Keltner ma period20EMA period for the Keltner channel middle line
Keltner atr period10ATR period feeding the channel bands
Band multiplier2.0Band distance, multiples of ATR
Trend ma period100Slow EMA used purely as the trend filter (price above/below it)
Atr mult sl1.0Stop loss beyond the pullback extreme, multiples of ATR
Atr mult tp2.0Take profit distance, multiples of ATR
Use risk sizingtrueSize by percent risk to the stop instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a sizing fallback
Magic number33201Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Breakout · Moving Average · ATR · Channels & Envelopes · Trend · Martingale · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria