Join today
Strategies / Mean reversion / Four Percent Dip

Four Percent Dip Strategy

A long-only dip buyer for stocks in an uptrend. It buys when the close is at least 4% below the 40-bar high and still above the 215-day SMA. It sells once the close rises above the previous bar's 40-bar high.

Mean reversionLong onlySwingVisaDaily
8.77Profit factor
31,547Net profit USD
86.76%Win rate
68Trades
-3,129Max drawdown
464Avg trade

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

Entry rules, long

  1. Members only
  2. Close is above the 215-day simple moving average

Exit rules

  1. Members only
  2. No stop loss or target

Test conditions

PeriodUp to 2026-09-15
InstrumentVisa, 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
lookbackPeriod
Bars used for the recent high
40
dipFactor
Entry when close is below this fraction of the recent high
0.96
trendPeriod
Length of the long-term trend average
215

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
VisaBest runDaily8.77 6886.7631,547 USD-3,129
BroadcomDaily8.04 9090.0051,312 USD-5,014
AlphabetDaily7.43 4785.1122,541 USD-3,200
PalantirDaily5.85 3989.7431,703 USD-7,609
S&P 500Daily4.71 13183.9738,622 EUR-3,221
ExxonMobilDaily4.54 16482.3260,435 USD-7,442
AbbVieDaily4.35 4682.6115,385 USD-4,051
MastercardDaily4.32 8485.7134,229 USD-5,998
MicrosoftDaily4.13 17183.6374,863 USD-5,848
WalmartDaily4.01 19277.6093,711 USD-9,059
CiscoDaily3.98 17389.6083,419 USD-11,676
MetaDaily3.96 6986.9630,635 USD-7,256
Johnson & JohnsonDaily3.72 17780.2360,396 USD-6,286
AmazonDaily3.48 14881.7675,529 USD-8,103
Coca-ColaDaily3.48 18779.1459,599 USD-9,389
Eli LillyDaily3.46 21479.4471,777 USD-6,194
OracleDaily3.16 20084.0095,961 USD-13,187
Lam ResearchDaily3.14 20686.8999,336 USD-8,982
Berkshire HathawayDaily3.08 8583.5323,801 USD-5,440
NvidiaDaily3.02 16784.4389,184 USD-8,960
ChevronDaily2.89 9473.4022,683 USD-5,786
CostcoDaily2.75 13380.4540,881 USD-5,829
IntelDaily2.49 20279.7093,131 USD-16,667
TeslaDaily2.38 9176.9237,743 USD-10,363
Applied MaterialsDaily2.25 13984.8949,844 USD-15,944
JPMorganDaily2.19 21179.1557,462 USD-8,477
CaterpillarDaily2.15 20376.3552,401 USD-6,431
AppleDaily2.07 18176.8054,038 USD-12,520
MicronDaily2.02 23785.6595,503 USD-15,970
AMDDaily1.57 22677.4364,012 USD-19,651
Bank of AmericaDaily1.28 10275.499,841 USD-18,419

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-evenVisa · Daily8.77Broadcom · Daily8.04Alphabet · Daily7.43Palantir · Daily5.85S&P 500 · Daily4.71ExxonMobil · Daily4.54AbbVie · Daily4.35Mastercard · Daily4.32Microsoft · Daily4.13Walmart · Daily4.01Cisco · Daily3.98Meta · Daily3.96Johnson & Johnson · Daily3.72Amazon · Daily3.48Coca-Cola · Daily3.48Eli Lilly · Daily3.46Oracle · Daily3.16Lam Research · Daily3.14Berkshire Hathaway · Daily3.08Nvidia · Daily3.02Chevron · Daily2.89Costco · Daily2.75Intel · Daily2.49Tesla · Daily2.38

Net profit against max drawdown

Net profitMax drawdown
0-20K-10K50K100KLam Research · DailyOracle · DailyMicron · DailyWalmart · DailyIntel · DailyNvidia · DailyCisco · DailyAmazon · DailyMicrosoft · DailyEli Lilly · DailyAMD · DailyExxonMobil · DailyJohnson & Johnson · DailyCoca-Cola · DailyJPMorgan · DailyApple · 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.

// ============================================================
// Four Percent Dip
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ============================================================

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

// --- Parameters ---
capitalPerTrade = 10000   // money committed to each trade
lookbackPeriod = 40       // window for the recent high
dipFactor = 0.96          // buy when price is 4% below that high
trendPeriod = 215         // long-term trend filter length

// --- Indicators ---
positionSize = capitalPerTrade / close
recentHigh = Highest[lookbackPeriod](high)
trendMA = Average[trendPeriod](close)

15 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • There is no stop loss. A stock that keeps falling after the dip stays in the trade until it makes a new 40-bar high.
  • The best run on Visa has only 68 trades, so the 86.76% win rate and profit factor of 8.77 rest on a small sample.
  • Some stocks carried much deeper drawdowns, for example AMD at USD 19,650.96 and Bank of America at USD 18,419 against USD 9,841.28 profit.

Indicators used

SMA

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 Four Percent Dip run in ProOrder?

Yes, entries and exits are simple close-based rules. The code was rewritten after testing and has not been compile-checked, so run a backtest first.

Which stocks were tested?

Thirty daily charts of large US stocks plus the S&P 500, and all of them were profitable. Visa was best, with USD 31,546.96 net over 68 trades.

How big is each position?

Each trade buys about 10,000 of stock (10,000 divided by the close). The Visa run had a max drawdown of USD 3,129.

Why the 215-day SMA filter?

It keeps the system out of stocks in a long downtrend, so it only buys dips inside an existing uptrend on daily bars.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Twelve Minus Two Momentum

Best run on the same market, Visa.

12.00 PF · 52 trades

ATR Band

A similar profit factor.

10.31 PF · 53 trades

Stock dip systems are one piece of a bigger plan. Join the ProRealAlgos waitlist to see the rest.

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