Internal bar strength shows where the close sits inside the day's range. This system buys when IBS is below 0.7, the close is lower than the previous close, and the prior low undercut the one before it. It sells when IBS climbs above 0.9.
Best run of 31. Mastercard, Daily, from run stock2-queue:2026-09-15-Mastercard.tsv:8.
| Period | Up to 2026-09-15 |
| Instrument | Mastercard, 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 |
| minRange Floor on the bar range to avoid dividing by zero | 0.00001 |
| entryIbsLevel Buy when IBS is below this | 0.7 |
| exitIbsLevel Sell when IBS is above this | 0.9 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| MastercardBest run | Daily | 2.65 | 380 | 69.47 | 55,597 USD | -5,014 |
| Visa | Daily | 2.51 | 338 | 67.75 | 38,486 USD | -3,303 |
| Microsoft | Daily | 2.45 | 694 | 68.44 | 96,673 USD | -4,771 |
| Broadcom | Daily | 2.27 | 321 | 65.73 | 45,193 USD | -3,454 |
| Cisco | Daily | 2.26 | 631 | 65.45 | 109,868 USD | -9,961 |
| ExxonMobil | Daily | 2.07 | 899 | 62.85 | 73,449 USD | -6,444 |
| Alphabet | Daily | 2.00 | 228 | 67.54 | 24,127 USD | -3,127 |
| Applied Materials | Daily | 1.88 | 542 | 67.16 | 81,940 USD | -5,612 |
| Palantir | Daily | 1.88 | 104 | 62.50 | 26,481 USD | -7,075 |
| Intel | Daily | 1.81 | 791 | 62.45 | 90,133 USD | -6,875 |
| Johnson & Johnson | Daily | 1.81 | 896 | 60.94 | 59,038 USD | -3,478 |
| Oracle | Daily | 1.79 | 710 | 63.38 | 99,304 USD | -12,794 |
| Chevron | Daily | 1.78 | 564 | 64.01 | 46,392 USD | -6,534 |
| Meta | Daily | 1.76 | 255 | 65.10 | 30,490 USD | -6,529 |
| Lam Research | Daily | 1.74 | 659 | 61.00 | 106,401 USD | -10,650 |
| Tesla | Daily | 1.74 | 296 | 63.51 | 50,543 USD | -13,146 |
| Coca-Cola | Daily | 1.73 | 1,048 | 56.77 | 65,632 USD | -6,816 |
| Nvidia | Daily | 1.71 | 493 | 57.00 | 81,253 USD | -10,619 |
| Costco | Daily | 1.71 | 655 | 64.43 | 53,145 USD | -6,378 |
| Apple | Daily | 1.68 | 633 | 55.13 | 77,286 USD | -8,749 |
| AbbVie | Daily | 1.67 | 228 | 62.28 | 18,923 USD | -3,850 |
| Eli Lilly | Daily | 1.59 | 1,015 | 59.41 | 65,428 USD | -8,172 |
| Bank of America | Daily | 1.54 | 532 | 65.98 | 51,185 USD | -13,735 |
| Amazon | Daily | 1.52 | 551 | 61.52 | 55,208 USD | -16,419 |
| Berkshire Hathaway | Daily | 1.49 | 579 | 64.77 | 23,761 USD | -4,961 |
| Micron | Daily | 1.36 | 712 | 61.10 | 79,910 USD | -24,132 |
| AMD | Daily | 1.28 | 817 | 59.49 | 69,026 USD | -15,748 |
| S&P 500 | Daily | 1.20 | 1,088 | 62.87 | 15,348 EUR | -9,911 |
| JPMorgan | Daily | 0.82 | 406 | 51.97 | -10,417 USD | -11,866 |
| Caterpillar | Daily | 0.67 | 235 | 48.09 | -10,032 USD | -10,930 |
| Walmart | Daily | 0.00 | 20 | 0.00 | -10,099 USD | -17,189 |
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.
// ============================================================ // IBS Mean Reversion // 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 minRange = 0.00001 // floor on the bar range to avoid dividing by zero entryIbsLevel = 0.7 // buy when IBS is below this exitIbsLevel = 0.9 // sell when IBS is above this // --- Indicators --- positionSize = capitalPerTrade / close barRange = MAX(high - low, minRange) ibsValue = (close - low) / barRange
15 more lines: the entry and exit rules.
Read this first
Questions
Yes, it only needs daily closes and ranges. The rewritten code was not compile-checked, so backtest before trading it live.
Mastercard led with USD 55,596.58 net over 380 trades and a 69.47% win rate. Microsoft, Cisco and Visa also did well, while JPMorgan, Caterpillar and Walmart lost.
Each position is 10,000 divided by the close, about 10,000 of stock. The Mastercard run had a max drawdown of USD 5,014.18.
IBS is built from the daily high, low and close, and each stock was tested on its full daily history.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.