Cobra Scalper Indicator MT4 + MT5 (Donchian Breakout)

Written by Dominic Walsh · Published · Last updated

The cobra scalper indicator plots a Donchian channel. It fires a Buy or Sell arrow when price breaks it. A volatility check has to confirm the session runs active enough to trade first. It suits scalpers who want a breakout signal that skips quiet stretches.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD M5.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 4: Donchian High, Donchian Low, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 11

What the Cobra Scalper Indicator draws on the chart

Donchian High draws a blue line at the top of the ChPeriod range.

Donchian Low draws a red-orange line at the bottom of the same range.

Buy prints a lime arrow (code 233) and Sell a red arrow (code 234), both offset from the candle by ArrowOffsetPoints.

  • Donchian High: line, dodger blue, width 1
  • Donchian Low: line, tomato, width 1
  • Buy: arrow, lime, width 4, arrow code 233
  • Sell: arrow, red, width 4, arrow code 234
Cobra scalper indicator on EURUSD M5 with the Donchian channel and arrows.
Cobra scalper indicator on EURUSD M5 with the Donchian channel and arrows.

How the Cobra Scalper Indicator calculates its values

Donchian channel

ChPeriod, `10`, sets the lookback for iHighest and iLowest. These build the Donchian High and Donchian Low lines from the highest high and lowest low over that window.

Volatility filter before the arrow

AtrLen, `14`, feeds a short ATR read. AtrAvgLen, `20`, feeds a longer average of it. AtrFilterMult, `0.7`, sets how high the short ATR must run against that average before a break can fire an arrow. This screens out breaks when volatility is fading.

How to read the signals

A lime Buy arrow prints on a break above the Donchian High line, once the volatility filter passes.

A red Sell arrow prints on a break below the Donchian Low line, under the same filter.

If the channel breaks but AtrFilterMult’s ratio test fails, no arrow shows. The lines still update.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

Alerts cover popup, push, email and sound, and fire once per closed bar.

Every Cobra Scalper Indicator input

Core settings

Setting What it does Default
ChPeriod Donchian channel lookback. Donchian channel length in bars; default `10`. 10
AtrLen ATR period. Short ATR period used in the volatility filter; default `14`. 14
AtrAvgLen ATR-average lookback for volatility filter. Longer ATR-average period the short ATR compares against; default `20`. 20
AtrFilterMult Min ratio of ATR to ATR-avg to allow a signal. Min ratio of short ATR to its own average, needed to allow a signal; default `0.7`. 0.7

Display settings

Setting What it does Default
ArrowOffsetPoints Arrow distance from candle wick. 25

Alert settings

Setting What it does Default
EnableAlerts (see inputs panel) on
EnablePopup (see inputs panel) on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Inputs panel for the cobra scalper indicator showing ChPeriod and AtrFilterMult.
Inputs panel for the cobra scalper indicator showing ChPeriod and AtrFilterMult.

Settings that fit your chart

The build notes call M5 a balance between signal frequency and noise, and the screenshot below uses EURUSD M5; the same Donchian/ATR combination runs on any timeframe the platform supports.

When the Cobra Scalper Indicator fails

A narrow ChPeriod of `10` keeps the channel tight. On a trending run price can break it repeatedly in the same direction rather than marking one clean level.

AtrFilterMult only compares current ATR against its own recent average. It never checks a longer-term baseline. A volatile week can leave the filter permissive throughout, even when that week’s volatility runs unusually high in absolute terms.

Arrows need both the channel break and the ATR ratio test to pass together. A real breakout during a lull in short-term ATR gets skipped.

Copy the compiled Cobra Scalper Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Download the Cobra Scalper Indicator for MT4 and MT5

The zip holds the compiled Cobra Scalper Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does AtrFilterMult actually filter?

AtrFilterMult is the minimum ratio of the AtrLen short-term ATR to the AtrAvgLen longer average. A Donchian channel break only fires a Buy or Sell arrow once that ratio clears `0.7`, the default, which screens out breaks during a volatility lull.

How does the code build the Donchian channel?

iHighest and iLowest scan back ChPeriod bars, `10` by default, to find the highest high and lowest low, which become the Donchian High and Donchian Low lines.

Why might the channel break with no arrow appearing?

The Buy and Sell arrows need both the channel break and the AtrFilterMult ratio test to pass together. When the ratio test fails, the lines still update but the code draws no arrow.

What timeframe suits the Donchian breakout best, and why M5?

The build notes settled on M5 for the screenshot below because it balances how often the Donchian breakout fires against how much noise the AtrFilterMult check has to screen out; a faster M1 chart would push more marginal breaks through the volatility filter.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Cobra Scalper Indicator as one input. Always backtest before trading live.

Category: this is part of our Signal and Forecast collection. Next, plainly, truly, browse more Signal and Forecast for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment