Join today
Strategies / Mean reversion / Supertrend Counter Trend

Supertrend Counter Trend Strategy

When price is on the wrong side of the Supertrend but already back across the 10 EMA, the system bets on a turn. It only trades when short-term ATR(15) is above the long ATR(425), so volatility is elevated. Exits come from a 2.5 x ATR(14) stop or a close back through the Supertrend, Bollinger middle line and 10 EMA.

Mean reversionLong & shortSwingUSD/JPYDaily
3.47Profit factor
1,222,950Net profit JPY
2.35%Win rate
1,444Trades
-240,380Max drawdown
847Avg trade

Best run of 3. USD/JPY, Daily, spread 1, from run pf:2026-09-24-USDJPY-D.tsv:2.

Entry rules, long

  1. Members only
  2. Close is above the 10-period EMA
  3. ATR(15) is above ATR(425)

Entry rules, short

  1. Members only
  2. Close is below the 10-period EMA
  3. ATR(15) is above ATR(425)

Exit rules

  1. Stop loss of 2.5 times ATR(14), set at entry
  2. Members only
  3. Close a short when close is below the Supertrend and above both the Bollinger middle line and the 10 EMA

Test conditions

PeriodUp to 2026-09-24
InstrumentUSD/JPY, Daily
Spread1 points
Contracts1
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-24

Parameters

positionSize
Contracts per trade
1
signalPeriod
EMA length
10
bandPeriod
Bollinger Band length (middle line)
25
fastAtrPeriod
Short ATR for the volatility filter
15
slowAtrPeriod
Long ATR for the volatility filter
425
atrPeriod
ATR for the stop
14
atrMultiplier
Stop in ATR multiples
2.5
superTrendMultiplier
Supertrend multiplier
3
superTrendPeriod
Supertrend length
10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily3.47 1,4442.351,222,950 JPY-240,380
DAX 401 hourn/a 2,57147.8012,296 EUR-5,278
Brent Crude4 hoursn/a 39046.156,750 EUR-4,696

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-250K-125K1.0M2.0MUSD/JPY · DailyDAX 40 · 1 hourBrent Crude · 4 hours

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Supertrend Counter Trend
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1           // contracts per trade
signalPeriod = 10          // EMA length used for entries and exits
bandPeriod = 25            // Bollinger Band length, only the middle line is used
fastAtrPeriod = 15         // short ATR for the volatility filter
slowAtrPeriod = 425        // long ATR for the volatility filter
atrPeriod = 14             // ATR length for the stop distance
atrMultiplier = 2.5        // stop distance in multiples of ATR
superTrendMultiplier = 3   // Supertrend ATR multiple
superTrendPeriod = 10      // Supertrend length

// --- Indicators ---
signalMA = ExponentialAverage[signalPeriod](close)
midBand = (BollingerUp[bandPeriod](close) + BollingerDown[bandPeriod](close)) / 2
superTrendLine = Supertrend[superTrendMultiplier, superTrendPeriod]
volatilityRising = AverageTrueRange[fastAtrPeriod](close) > AverageTrueRange[slowAtrPeriod](close)

31 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The headline USD/JPY daily run has a win rate of just 2.35% over 1,444 trades, so the result rests on a handful of very large winners.
  • Max drawdown on that run was JPY 240,380.00.
  • The stop takes the ATR value in price units as a points distance, as in the original code, which can make it much tighter or wider than intended depending on the instrument.
  • Only three markets were tested, and profit factor was recorded only for USD/JPY daily.

Indicators used

SupertrendEMABollinger BandsATR

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Can it run in ProOrder?

Yes, it trades 1 contract with an ATR stop set at entry.

What did the backtests show?

USD/JPY daily reached profit factor 3.47 and JPY 1,222,950.00. DAX 40 1 hour (EUR 12,296.00) and Brent Crude 4 hours (EUR 6,750.10) were also profitable, with win rates of 47.8% and 46.15%.

How much drawdown came with 1 contract?

JPY 240,380.00 on USD/JPY daily and EUR 5,277.50 on DAX 40 1 hour.

Why daily bars on USD/JPY?

The ATR(425) filter needs a long history to compare against, and daily bars keep entries to strong volatility spells.

Related

Strategies like this one

Monday Dip Buy

Uses the same indicator.

n/a PF · 146 trades

Bollinger Band Walk

Best run on the same market, USD/JPY.

3.10 PF · 148 trades

Renko MA Cross

A similar profit factor.

3.34 PF · 144 trades

Counter trend systems can balance a portfolio. Join the ProRealAlgos waitlist to see how.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs