Three bars in a row that each make a lower high and a lower low signal a buy, provided close is above the 200 period SMA and below the 5 period SMA. The trade is sold on a close back above the 5 SMA with a partial range break, or on an inside day. A 1.4% stop protects each trade.
Best run of 11. Nikkei 225, Daily, spread 10, from run pf:2026-09-24-NIKKEI-D.tsv:1.
| Period | Up to 2026-09-24 |
| Instrument | Nikkei 225, Daily |
| Spread | 10 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-24 |
| positionSize Contracts per trade | 1 |
| trendPeriod SMA trend filter length | 200 |
| fastPeriod Short SMA for the pullback test and the exit | 5 |
| stopLossPct Protective stop, percent of entry price | 1.4 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | Daily | 2.36 | 187 | 49.20 | 29,690 USD | -3,718 |
| USD/JPY | Daily | n/a | 170 | 54.12 | 437,500 JPY | -122,600 |
| USD/JPY | 30 min | n/a | 2,488 | 52.97 | 234,620 JPY | -102,420 |
| USD/JPY | 4 hours | n/a | 457 | 58.42 | 75,230 JPY | -67,850 |
| EUR/USD | 4 hours | n/a | 536 | 52.24 | 10,596 USD | -8,618 |
| Dow Jones | Daily | n/a | 404 | 45.05 | 4,249 EUR | -3,714 |
| DAX 40 | Daily | n/a | 188 | 48.40 | 4,232 EUR | -1,114 |
| Nasdaq 100 | Daily | n/a | 261 | 29.50 | 1,913 EUR | -1,613 |
| Brent Crude | 4 hours | n/a | 229 | 52.84 | 1,681 EUR | -1,587 |
| Gold | 3 min | n/a | 1,759 | 41.90 | 1,577 EUR | -519 |
| Gold | 5 min | n/a | 1,991 | 39.28 | 1,135 EUR | -568 |
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.
// ============================================================ // Three Lower Highs and Lows // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long only // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade trendPeriod = 200 // SMA trend filter length fastPeriod = 5 // short SMA for the pullback test and the exit stopLossPct = 1.4 // protective stop, percent of entry price // --- Indicators --- trendMA = Average[trendPeriod](close) fastMA = Average[fastPeriod](close) // Three bars in a row, each with a lower high and a lower low. lowerBars = high[2] < high[3] AND low[2] < low[3] AND high[1] < high[2] AND low[1] < low[2] AND high < high[1] AND low < low[1]
22 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is an automated long only system with a stop and two exit rules.
Every tested row was positive. USD/JPY did well on daily, 4 hour and 30 minute charts, and DAX 40 Daily made 4,232.4 EUR with a 1,113.7 EUR drawdown.
On Nikkei 225 Daily the worst drawdown was 3,718 USD at 1 contract, against 29,690.3 USD of net profit.
The exits use the daily high and low, so the rules are built around daily candles.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.