Join waitlist
Strategies / Breakout / Pitchfork Breakout with Median Stop

Pitchfork Breakout with Median Stop

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.

BreakoutLong & shortSwingGold4 hours
1.73Profit factor
1,373Net profit EUR
60.59%Win rate
170Trades
-297Max drawdown
8.07Avg trade

Best run of 9. Gold, 4 hours, spread 0.6, from run pf:2026-10-12-GOLD-4h.tsv:15.

Entry rules, long

  1. Confirmed pivots (10 bars each side) set the pitchfork, with the median line running from the first pivot through the midpoint of the other two.
  2. When flat, the strategy buys one contract.

Entry rules, short

  1. The close crosses under the lower tine while the median slope is negative and the close is below the median line.

Exit rules

  1. The target equals the stop distance, a 1:1 risk to reward ratio.

Test conditions

PeriodUp to 2026-10-12
InstrumentGold, 4 hours
Spread0.6 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run4 hours1.73 17060.591,373 EUR-297
Silver1 hourn/a 66851.5010,538 USD-8,998
DAX 40Dailyn/a 9458.516,554 EUR-3,445
Nasdaq 100Dailyn/a 6456.256,363 EUR-2,235
Brent CrudeDailyn/a 2272.735,697 EUR-1,711
DAX 404 hoursn/a 15250.003,039 EUR-3,031
S&P 500Dailyn/a 9252.171,087 EUR-555
Gold30 minn/a 1,11948.70722 EUR-565
Gold3 minn/a 1,17348.42433 EUR-287

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// 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

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Pitchfork Breakout with Median Stop in ProOrder?

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.

Which markets was it tested on?

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.

How large was the drawdown?

The best run had a maximum drawdown of 297 EUR at the tested position size, against a net result of 1,373 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

20 Day Breakout Long

Also a breakout strategy.

1.73 PF · 81 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs