Longs open when price closes below the lowest low of the last 3 completed days. Shorts open when price falls back under the highest high of the last 13 days. Positions close when price moves past yesterday close, with stops sized from yesterday range.
Best run of 8. GBP/USD, 4 hours, spread 1.5, from run sweeps:2026-09-24-GBPUSD-4h-opt.tsv:2.
| Period | Up to 2026-09-24 |
| Instrument | GBP/USD, 4 hours |
| Spread | 1.5 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-25 |
| positionSize Contracts per trade | 1 |
| maxLongTrades Long entries allowed per day | 1 |
| maxShortTrades Short entries allowed per day | 1 |
| longStopFactor Long stop distance as a share of yesterday's range | 0.4 |
| shortStopFactor Short stop distance as a share of yesterday's range | 1 |
| exitAtPrevClose 1 closes trades once price is back beyond yesterday's close | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GBP/USDBest run | 4 hours | n/a | 2,530 | 50.12 | 2,533 USD | -1,409 |
| USD/JPY | Daily | 0.77 | 18 | 33.33 | -12,480 JPY | -28,720 |
| Dow Jones | Daily | n/a | 2,397 | 38.51 | 12,580 EUR | -7,010 |
| Dow Jones | 1 hour | n/a | 836 | 54.31 | 5,391 EUR | -3,668 |
| GBP/USD | Daily | n/a | 2,336 | 42.94 | 4,914 USD | -3,508 |
| Dow Jones | 10 min | n/a | 807 | 52.04 | 4,326 EUR | -2,556 |
| Dow Jones | 3 min | n/a | 229 | 53.71 | 2,876 EUR | -2,097 |
| S&P 500 | 3 min | n/a | 266 | 46.62 | 213 EUR | -195 |
Charts
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.
// ============================================================ // Low Buy High Sell // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: 4 hours // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade maxLongTrades = 1 // long entries allowed per day maxShortTrades = 1 // short entries allowed per day longStopFactor = 0.4 // long stop as a share of yesterday's range shortStopFactor = 1 // short stop as a share of yesterday's range exitAtPrevClose = 1 // 1 = close trades back at yesterday's close ONCE longTradesToday = 0 ONCE shortTradesToday = 0 // --- Indicators --- // Per-day trade counters. IF IntradayBarIndex = 0 THEN longTradesToday = 0 shortTradesToday = 0 ENDIF IF LongTriggered THEN longTradesToday = longTradesToday + 1 ENDIF IF ShortTriggered THEN shortTradesToday = shortTradesToday + 1 ENDIF // Levels from the last completed days. prevDayHigh = DHigh(1) prevDayLow = DLow(1) prevDayClose = DClose(1) // Lowest low of the last 3 days and highest high of the last 13 days. multiDayLow = MIN(DLow(1), MIN(DLow(2), DLow(3))) multiDayHigh = MAX(DHigh(1), MAX(DHigh(2), MAX(DHigh(3), MAX(DHigh(4), MAX(DHigh(5), MAX(DHigh(6), MAX(DHigh(7), MAX(DHigh(8), MAX(DHigh(9), MAX(DHigh(10), MAX(DHigh(11), MAX(DHigh(12), DHigh(13))))))))))))) prevDayRange = prevDayHigh - prevDayLow
26 more lines: the entry and exit rules.
Read this first
Questions
Yes, at 1 contract with at most 1 long and 1 short entry per day.
GBP/USD 4 hours made USD 2,532.60 with a 50.12% win rate. Dow Jones daily made EUR 12,580.30, while USD/JPY daily was the only losing run.
The GBP/USD 4 hour run had a max drawdown of USD 1,409.20, more than half its net profit.
The 15 minute chart was not among the stored results. On 4 hour bars the daily entry cap rarely limits trades, so the system acts on most signals.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.