Join today
Strategies / Mean reversion / MACD Exhaustion

MACD Exhaustion: Buying Selling Pressure That Runs Out

The system buys when the MACD histogram (12, 26, 9) has dropped four bars in a row below zero and the day closes near its low. It sells as soon as a close gets above the previous bar high, so trades are usually short.

Mean reversionLong onlySwingPalantirDaily
6.35Profit factor
18,727Net profit USD
78.79%Win rate
33Trades
-2,016Max drawdown
567Avg trade

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

Entry rules, long

  1. Members only
  2. The MACD histogram is below zero
  3. The close is in the bottom 14% of the bar range

Exit rules

  1. Members only
  2. No stop loss or target

Test conditions

PeriodUp to 2026-09-15
InstrumentPalantir, 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
macdFast
MACD fast length
12
macdSlow
MACD slow length
26
macdSignalPeriod
MACD signal length
9
ibsEntryLevel
Close must sit in the bottom 14% of the bar
0.14

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
PalantirBest runDaily6.35 3378.7918,727 USD-2,016
MetaDaily4.30 7474.3213,461 USD-1,758
MicrosoftDaily3.96 22876.3246,277 USD-5,865
AmazonDaily3.90 16472.5640,625 USD-3,309
MastercardDaily3.87 10877.7815,933 USD-1,696
WalmartDaily3.86 25457.4849,080 USD-3,000
CiscoDaily3.68 20170.6538,368 USD-2,831
AlphabetDaily3.07 7570.677,538 USD-1,019
Lam ResearchDaily3.02 20770.0550,572 USD-3,484
Applied MaterialsDaily2.99 16675.9032,055 USD-3,483
VisaDaily2.91 9173.6311,143 USD-1,860
BroadcomDaily2.73 7869.2310,275 USD-1,746
CostcoDaily2.70 18571.3522,859 USD-1,731
ExxonMobilDaily2.58 32472.2234,679 USD-3,950
AppleDaily2.46 18757.7526,802 USD-5,963
Coca-ColaDaily2.29 30263.5823,962 USD-2,946
S&P 500Daily2.27 28273.7614,884 EUR-2,085
Johnson & JohnsonDaily2.24 31870.1326,934 USD-2,873
OracleDaily2.16 19568.2133,539 USD-4,313
AbbVieDaily1.89 6071.674,278 USD-1,694
TeslaDaily1.79 8870.4513,135 USD-4,767
NvidiaDaily1.78 14153.1919,594 USD-5,694
Berkshire HathawayDaily1.70 17362.436,837 USD-1,856
Bank of AmericaDaily1.66 17469.5415,336 USD-6,461
MicronDaily1.64 23766.6730,698 USD-7,762
AMDDaily1.52 25665.2327,280 USD-7,501
Eli LillyDaily1.45 31764.6714,268 USD-3,733
JPMorganDaily1.45 30861.6914,129 USD-3,616
CaterpillarDaily1.42 32864.0215,260 USD-3,666
ChevronDaily1.33 15265.134,910 USD-3,924
IntelDaily0.00 10.00-10,000 USD-10,000

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 · Daily6.35Meta · Daily4.30Microsoft · Daily3.96Amazon · Daily3.90Mastercard · Daily3.87Walmart · Daily3.86Cisco · Daily3.68Alphabet · Daily3.07Lam Research · Daily3.02Applied Materials · Daily2.99Visa · Daily2.91Broadcom · Daily2.73Costco · Daily2.70ExxonMobil · Daily2.58Apple · Daily2.46Coca-Cola · Daily2.29S&P 500 · Daily2.27Johnson & Johnson · Daily2.24Oracle · Daily2.16AbbVie · Daily1.89Tesla · Daily1.79Nvidia · Daily1.78Berkshire Hathaway · Daily1.70Bank of America · Daily1.66

Net profit against max drawdown

Net profitMax drawdown
0-10K-5K50K100KLam Research · DailyWalmart · DailyMicrosoft · DailyAmazon · DailyCisco · DailyExxonMobil · DailyOracle · DailyApplied Materials · DailyMicron · DailyAMD · DailyJohnson & Johnson · DailyApple · DailyCoca-Cola · DailyCostco · DailyNvidia · DailyPalantir · 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.

// ============================================================
// MACD Exhaustion
// 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
macdFast = 12             // MACD fast length
macdSlow = 26             // MACD slow length
macdSignalPeriod = 9      // MACD signal length
ibsEntryLevel = 0.14      // close must sit in the bottom 14% of the bar

// --- Indicators ---
positionSize = capitalPerTrade / close
macdHistogram = MACD[macdFast, macdSlow, macdSignalPeriod](close)
ibsValue = (close - low) / (high - low)

15 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • There is no stop loss. Intel shows the danger: 1 trade, a USD 10,000.00 loss, the full capital per trade.
  • The top run on Palantir has only 33 trades, so its 6.35 profit factor rests on a small sample.
  • There is no position guard on the entry, and a bar where high equals low divides by zero, both as in the original code.
  • Results come from the pre-rewrite code on daily stock data only.

Indicators used

MACD

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 MACD Exhaustion run live?

It can be loaded in ProOrder on daily bars, sized as 10000 divided by the close. Add your own stop, since the code has none.

How did it do across stocks?

All daily runs but one were profitable. Microsoft made USD 46,276.85 over 228 trades with a profit factor of 3.96, while Intel lost USD 10,000.00 on a single trade.

What capital and risk does it need?

Each trade uses 10000 USD. On Palantir the maximum drawdown was USD 2,015.90, on Micron it was USD 7,762.49.

Why daily candles?

The close near the low of the day, combined with a falling histogram, is a daily washout pattern. The quick exit above the prior high fits a few days of holding.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Breakout Regime Filter

A similar profit factor.

6.28 PF · 70 trades

Monday Dip Buy

Also a mean reversion strategy.

n/a PF · 146 trades

Buying dips in stocks? Join other systematic traders on the ProRealAlgos waitlist.

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