Join today
Strategies / Breakout / Breakout Regime Filter

Breakout Regime Filter: Channel Breakouts in an Uptrend

A close above the 30-bar high arms a buy for the next 10 bars, but only while price is above the 200-day SMA. The position rides until a 90-bar low breaks, or a tighter 20-bar low once the trade is more than 2 x ATR(5) in profit, or price falls below the 200-day SMA.

BreakoutLong onlySwingAppleDaily
6.28Profit factor
93,926Net profit USD
64.29%Win rate
70Trades
-7,379Max drawdown
1,342Avg trade

Best run of 31. Apple, Daily, from run stock2-queue:2026-09-15-Apple.tsv:12.

Entry rules, long

  1. Members only
  2. Close is above the 200-day SMA
  3. Buy while the setup is armed and no trade is open

Exit rules

  1. Sell when the close falls below the lowest low of the previous 90 bars
  2. Members only
  3. Sell when the close falls below the 200-day SMA
  4. No stop loss or target

Test conditions

PeriodUp to 2026-09-15
InstrumentApple, Daily
Capital per trade10,000
CostsNot recorded for this run.
BarsDaily bars, full available history
Last tested2026-09-15

Parameters

capitalPerTrade
Money committed to each trade
10000
channelPeriod
Breakout above the highest high of this many bars
30
wideExitPeriod
Default exit: lowest low of this many bars
90
tightExitPeriod
Tighter exit once the trade is well in profit
20
trendPeriod
Only trade above this moving average
200
atrPeriod
ATR length for the profit test
5
atrMultiplier
Profit in ATRs that switches to the tight exit
2
maxArmBars
A breakout stays valid this many bars
10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
AppleBest runDaily6.28 7064.2993,926 USD-7,379
PalantirDaily9.02 742.8628,465 USD-9,612
AlphabetDaily5.88 2759.2616,092 USD-2,370
NvidiaDaily4.34 5251.9279,222 USD-16,336
TeslaDaily3.57 4327.9161,281 USD-17,363
CiscoDaily3.35 7149.3052,801 USD-10,850
MicronDaily3.18 8033.7596,446 USD-16,281
AmazonDaily3.13 6639.3960,380 USD-33,937
AMDDaily2.92 8432.14105,799 USD-16,864
MetaDaily2.91 2842.8621,548 USD-6,268
BroadcomDaily2.80 3847.3725,113 USD-7,429
WalmartDaily2.78 11033.6457,900 USD-12,857
MastercardDaily2.62 4143.9020,947 USD-5,245
Lam ResearchDaily2.58 7047.1462,987 USD-16,277
MicrosoftDaily2.47 8942.7047,028 USD-12,582
Applied MaterialsDaily2.43 6132.7937,618 USD-16,953
S&P 500Daily2.40 12542.4026,657 EUR-2,841
Berkshire HathawayDaily2.38 7142.2519,658 USD-5,515
VisaDaily2.28 3834.2112,889 USD-4,096
OracleDaily2.23 10134.6558,513 USD-20,235
AbbVieDaily2.18 3043.339,910 USD-2,855
CaterpillarDaily2.00 13429.1047,133 USD-8,763
CostcoDaily1.88 8343.3719,972 USD-6,690
Johnson & JohnsonDaily1.83 13035.3822,992 USD-6,301
ExxonMobilDaily1.78 12030.8324,076 USD-6,020
Eli LillyDaily1.59 13236.3623,066 USD-13,292
Coca-ColaDaily1.44 14533.1016,236 USD-8,964
JPMorganDaily1.36 13131.3016,963 USD-14,477
ChevronDaily1.15 8132.103,747 USD-10,348
Bank of AmericaDaily0.54 4228.57-10,081 USD-15,787
IntelDaily0.00 30.00-10,833 USD-10,833

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.02.55.07.5101.0 = break-evenPalantir · Daily9.02Apple · Daily6.28Alphabet · Daily5.88Nvidia · Daily4.34Tesla · Daily3.57Cisco · Daily3.35Micron · Daily3.18Amazon · Daily3.13AMD · Daily2.92Meta · Daily2.91Broadcom · Daily2.80Walmart · Daily2.78Mastercard · Daily2.62Lam Research · Daily2.58Microsoft · Daily2.47Applied Materials · Daily2.43S&P 500 · Daily2.40Berkshire Hathaway · Daily2.38Visa · Daily2.28Oracle · Daily2.23AbbVie · Daily2.18Caterpillar · Daily2.00Costco · Daily1.88Johnson & Johnson · Daily1.83

Net profit against max drawdown

Net profitMax drawdown
0-50K-25K100K200KAMD · DailyMicron · DailyApple · DailyNvidia · DailyLam Research · DailyTesla · DailyAmazon · DailyOracle · DailyWalmart · DailyCisco · DailyCaterpillar · DailyMicrosoft · DailyApplied Materials · DailyPalantir · DailyS&P 500 · DailyBroadcom · Daily

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.

// ============================================================
// Breakout Regime Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long only
// Timeframe tested: Daily
// ============================================================

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

// --- Parameters ---
capitalPerTrade = 10000   // money committed to each trade
channelPeriod = 30        // breakout above the highest high of this many bars
wideExitPeriod = 90       // default exit: lowest low of this many bars
tightExitPeriod = 20      // tighter exit once the trade is well in profit
trendPeriod = 200         // only trade above this moving average
atrPeriod = 5             // ATR length for the profit test
atrMultiplier = 2         // profit in ATRs that switches to the tight exit
maxArmBars = 10           // a breakout stays valid this many bars

// --- Indicators ---
positionSize = capitalPerTrade / close
atrValue = AverageTrueRange[atrPeriod](close)
channelHigh = Highest[channelPeriod](high)[1]
wideExitLevel = Lowest[wideExitPeriod](low)[1]
tightExitLevel = Lowest[tightExitPeriod](low)[1]
regimeUp = close > Average[trendPeriod](close)

ONCE inTrade = 0
ONCE armed = 0
ONCE armAge = 99
ONCE entryPrice = 0

34 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • There is no stop loss, so the exit depends on a 90-bar low or the 200-day SMA, which can sit far below the entry. Amazon saw a USD 33,936.60 drawdown.
  • The best run on Apple has only 70 trades over the full daily history, and Palantir had just 7, which is a thin sample.
  • Bank of America ended at USD -10,081.33 and Intel at USD -10,833.32 on 3 trades, so the filter does not help every stock.
  • Stats come from the code before its rewrite, and a same-bar exit and re-entry is possible because exits are checked first.

Indicators used

SMAATR

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 this breakout system trade automatically?

Yes, it runs in ProOrder on daily bars and sizes each trade as 10000 divided by the close. The rewritten code has not been compile checked yet.

How did it do across the 30 stocks?

It was tested on daily charts of large US stocks plus the S&P 500, and 28 of the 30 runs were profitable. Apple was best at USD 93,926.36 with a profit factor of 6.28, while Bank of America and Intel lost money.

What drawdown should I expect at this size?

With 10000 USD per trade, Apple had a maximum drawdown of USD 7,379.23. Other stocks went deeper, such as Tesla at USD 17,363.14.

Why daily bars?

The 200-day SMA filter and the 90-bar exit are built for multi week swings. On daily charts the system holds trends for weeks and trades only a few times a year.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

MACD Exhaustion

A similar profit factor.

6.35 PF · 33 trades

Bollinger Band Walk

Also a breakout strategy.

3.10 PF · 148 trades

Trade breakouts on stocks? The ProRealAlgos community waitlist is open.

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