The strategy draws a pitchfork from the last three confirmed pivots and buys when price closes above the upper tine with a rising median line. It sells short on a close below the lower tine with a falling median line.
Best run of 9. Gold, 4 hours, spread 0.6, from run pf:2026-10-12-GOLD-4h.tsv:15.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 4 hours |
| Spread | 0.6 points |
| 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-10-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | 1.73 | 170 | 60.59 | 1,373 EUR | -297 |
| Silver | 1 hour | n/a | 668 | 51.50 | 10,538 USD | -8,998 |
| DAX 40 | Daily | n/a | 94 | 58.51 | 6,554 EUR | -3,445 |
| Nasdaq 100 | Daily | n/a | 64 | 56.25 | 6,363 EUR | -2,235 |
| Brent Crude | Daily | n/a | 22 | 72.73 | 5,697 EUR | -1,711 |
| DAX 40 | 4 hours | n/a | 152 | 50.00 | 3,039 EUR | -3,031 |
| S&P 500 | Daily | n/a | 92 | 52.17 | 1,087 EUR | -555 |
| Gold | 30 min | n/a | 1,119 | 48.70 | 722 EUR | -565 |
| Gold | 3 min | n/a | 1,173 | 48.42 | 433 EUR | -287 |
Charts
The code
// ============================================================== // Pitchfork Breakout with Median Stop // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE paprice = 0 ONCE pabar = -1 ONCE pbprice = 0 ONCE pbbar = -1 ONCE pcprice = 0 ONCE pcbar = -1 ONCE lasttype = 0 ONCE mlprice = 0 ONCE ulprice = 0 ONCE llprice = 0 ONCE slope = 0
68 more lines: the entry and exit rules.
Setup
Questions
Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.
It was tested on 9 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 1.73 over 170 trades.
The best run had a maximum drawdown of 297 EUR at the tested position size, against a net result of 1,373 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.