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.
Best run of 31. Palantir, Daily, from run stock2-queue:2026-09-15-Palantir.tsv:5.
| Period | Up to 2026-09-15 |
| Instrument | Palantir, Daily |
| Capital per trade | 10,000 |
| Costs | Not recorded for this run. |
| Bars | Daily bars, full available history |
| Last tested | 2026-09-15 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| PalantirBest run | Daily | 6.35 | 33 | 78.79 | 18,727 USD | -2,016 |
| Meta | Daily | 4.30 | 74 | 74.32 | 13,461 USD | -1,758 |
| Microsoft | Daily | 3.96 | 228 | 76.32 | 46,277 USD | -5,865 |
| Amazon | Daily | 3.90 | 164 | 72.56 | 40,625 USD | -3,309 |
| Mastercard | Daily | 3.87 | 108 | 77.78 | 15,933 USD | -1,696 |
| Walmart | Daily | 3.86 | 254 | 57.48 | 49,080 USD | -3,000 |
| Cisco | Daily | 3.68 | 201 | 70.65 | 38,368 USD | -2,831 |
| Alphabet | Daily | 3.07 | 75 | 70.67 | 7,538 USD | -1,019 |
| Lam Research | Daily | 3.02 | 207 | 70.05 | 50,572 USD | -3,484 |
| Applied Materials | Daily | 2.99 | 166 | 75.90 | 32,055 USD | -3,483 |
| Visa | Daily | 2.91 | 91 | 73.63 | 11,143 USD | -1,860 |
| Broadcom | Daily | 2.73 | 78 | 69.23 | 10,275 USD | -1,746 |
| Costco | Daily | 2.70 | 185 | 71.35 | 22,859 USD | -1,731 |
| ExxonMobil | Daily | 2.58 | 324 | 72.22 | 34,679 USD | -3,950 |
| Apple | Daily | 2.46 | 187 | 57.75 | 26,802 USD | -5,963 |
| Coca-Cola | Daily | 2.29 | 302 | 63.58 | 23,962 USD | -2,946 |
| S&P 500 | Daily | 2.27 | 282 | 73.76 | 14,884 EUR | -2,085 |
| Johnson & Johnson | Daily | 2.24 | 318 | 70.13 | 26,934 USD | -2,873 |
| Oracle | Daily | 2.16 | 195 | 68.21 | 33,539 USD | -4,313 |
| AbbVie | Daily | 1.89 | 60 | 71.67 | 4,278 USD | -1,694 |
| Tesla | Daily | 1.79 | 88 | 70.45 | 13,135 USD | -4,767 |
| Nvidia | Daily | 1.78 | 141 | 53.19 | 19,594 USD | -5,694 |
| Berkshire Hathaway | Daily | 1.70 | 173 | 62.43 | 6,837 USD | -1,856 |
| Bank of America | Daily | 1.66 | 174 | 69.54 | 15,336 USD | -6,461 |
| Micron | Daily | 1.64 | 237 | 66.67 | 30,698 USD | -7,762 |
| AMD | Daily | 1.52 | 256 | 65.23 | 27,280 USD | -7,501 |
| Eli Lilly | Daily | 1.45 | 317 | 64.67 | 14,268 USD | -3,733 |
| JPMorgan | Daily | 1.45 | 308 | 61.69 | 14,129 USD | -3,616 |
| Caterpillar | Daily | 1.42 | 328 | 64.02 | 15,260 USD | -3,666 |
| Chevron | Daily | 1.33 | 152 | 65.13 | 4,910 USD | -3,924 |
| Intel | Daily | 0.00 | 1 | 0.00 | -10,000 USD | -10,000 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
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
Questions
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.
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.
Each trade uses 10000 USD. On Palantir the maximum drawdown was USD 2,015.90, on Micron it was USD 7,762.49.
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
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.