Joshua Dunnink · Trading Systems
Trebuchet artwork

Trebuchet

XAUUSD · H4 · MetaTrader 5 Expert Advisor

Coming soon. This Expert Advisor is in development and is not for sale yet: the trading rules are tested, the balance-based position sizing is still being built. Its description, manual and research are published so you can follow it.

Read the manualHow it was built

Headline backtest

Profit factor 2.75 · worst equity drawdown 3.03% · 2,326 trades · return x1.88 on 10,000

Backtest, real ticks, BlackBull Markets, 2022-11-01 to 2026-10-09, default settings, fixed 0.01 lot per order, research build 0.24. The weakest of the live brokers tested, not the strongest.

Trebuchet balance curve (backtest)
Chart: the default-settings run quoted here (BlackBull, fixed 0.01 lot per order); the lower panel is the dip below the running peak, including the quiet 2023 market.

Figures on this page come from the MetaTrader 5 Strategy Tester on real broker ticks. They are backtests, not live results.

The siege engineer studies the castle wall for days: the highest and the lowest point gold has reached over the last weeks. When the wall cracks he does not throw one stone. He sends seven, each to its own distance, and if a stone hangs near the top of its arc he catches it with a rope before it can fall back.

Trebuchet is an Expert Advisor for MetaTrader 5 (MT5) that trades gold (XAUUSD) breakouts of a price channel. A channel is the highest high and the lowest low of a fixed number of past bars. When price breaks through the top of the channel the EA is long; when it breaks through the bottom it is short. One breakout is traded by seven legs at once, and the legs differ only in how far they aim and how much room they give.

How a trade is made:

The channel. Every four hours the EA reads the highest high and the lowest low of the recent past: 50 or 100 four-hour bars, 120 one-hour bars or 1,500 fifteen-minute bars, depending on the leg. It rests a buy stop exactly on the channel high and a sell stop exactly on the channel low, so a trade opens only when price breaks the channel.

The distance rule. An order is placed only when the channel edge is far enough from the current price (between 0.20 and 0.35 percent of price, depending on the leg). A level that sits right next to price is not traded: in the tests those were the breaks that most often failed.

Seven exits on one breakout. The seven legs share the same entry but not the same exit. Their targets sit between 0.4 and 5 percent of price beyond the entry, and their stop losses between 0.1 and 0.9 percent. Short targets bank often; far targets bank rarely but carry the big moves. Each leg holds at most one position.

Expiry. An order that is not triggered is removed after three and a half to ten and a half days, depending on the leg.

Protection:

Every order and every position carries a stop loss from the moment it exists, and a take profit.

Break-even. Once a trade is a little ahead, its stop moves just beyond the entry, so a trade that went the right way does not turn into a full loss.

Near-miss protection (on by default). Two rules keep part of a profit that came close to the target instead of handing it back:

In the tests these two rules cost no net profit on any broker tested and cut the trades that came 40 percent of the way and then gave everything back from 54 to 38 percent (backtest, MetaTrader 5 Strategy Tester, real ticks, Vantage, 2025-07-04 to 2026-10-07).

Selective mode (optional). When gold's recent daily range is in the busiest 40 percent of its own past year, the EA places no new orders. In a busy market the fixed stops sit inside the noise and breaks get whipsawed. Selective mode trades fewer breakouts and makes less money; in return the balance had fewer dips below its running high and a smaller worst single loss.

Maximum protection (optional). Adds a trailing stop over the last stretch to the target: from 90 percent of the way, the stop follows the price at 15 percent of the target distance. A trade that turns just before its target then keeps most of it. It costs a little net profit.

Spread guards. A new order waits while the spread is very wide, and the stop loss allows for the current spread.

What the EA does not do: no grid, no martingale, no averaging into a losing position, no position or order without a stop loss, no DLL, no external files.

Position size. A fixed lot per order (0.01 by default). Balance-based sizing is in preparation.

What kind of market it needs. Trebuchet is a breakout system: it needs gold to move. The backtested profit came mainly from the trending gold market of 2024 to 2026; in the quiet market of 2023 the balance went sideways for most of the year (backtest, MetaTrader 5 Strategy Tester, real ticks, BlackBull, 2022-11 to 2026-10). Inside a trending period, short ranging spells were not a problem: measured day by day, ranging days earned about as much per trade as trending days. A long sideways year is different. On gold prices from 2013 to 2015 - a two-year range, tested at today's price level - the same rules lost money, and Selective mode only softened it. Trebuchet is not an all-weather system.

Results. Default settings, fixed 0.01 lot per order, deposit 10,000: BlackBull 2022-11-01 to 2026-10-09, 2,326 trades, profit factor 2.75, relative equity drawdown 3.03 percent; Vantage 2025-07-04 to 2026-10-13, 872 trades, profit factor 3.54, relative equity drawdown 3.65 percent; Pepperstone 2025-01-02 to 2025-12-31, 671 trades, profit factor 3.06, relative equity drawdown 2.59 percent (backtest, MetaTrader 5 Strategy Tester, real ticks, version 0.24, 150 ms execution delay). Selective mode on the same windows: profit factor 3.52, 6.71 and 5.82, relative equity drawdown 3.21, 2.80 and 2.62 percent, on fewer trades. Like most breakout systems it earns from a minority of breakouts that run: on BlackBull the top five percent of breakouts made most of the net result.

Family note. Other products in this line also trade gold breakouts; Trebuchet differs from each of them mechanically.

Requirements: MetaTrader 5, XAUUSD, a hedging account, algorithmic trading enabled, a VPS or an always-on PC (the orders and their stop losses rest on the broker's server, but the break-even and the protection locks run inside the EA).

Frequently asked questions

Q: What does the EA trade? A: Gold (XAUUSD) breakouts of a price channel: the highest high and lowest low of recent bars. A buy stop rests on the channel high and a sell stop on the channel low.

Q: Why seven legs on one breakout? A: Each leg aims at a different distance, from 0.4 to 5 percent of price. Short targets bank often; far targets catch the occasional large move. Together they trade one breakout in seven sizes of ambition.

Q: Does it use a grid, martingale or averaging down? A: No. Every order carries a stop loss and a take profit, a losing trade is closed at its stop, and nothing is added to a position that is behind.

Q: What is near-miss protection? A: Two locks that keep part of a profit that came close to the target: a fast spike to 40 percent of the way within three minutes keeps 30 percent of the target, and any trade at 75 percent of the way keeps 20 percent. It is on by default; in the tests it cost no net profit (backtest, MetaTrader 5 Strategy Tester, real ticks, default settings, BlackBull 2022-11 to 2026-10, Vantage 2025-07 to 2026-10, Pepperstone 2025).

Q: What is Selective mode? A: An optional mode that places no new orders while gold's recent daily range is in the busiest 40 percent of its own past year. Fewer trades and less profit; in the tests, fewer dips below the running high and a smaller worst single loss.

Q: Does it work in every gold market? A: No. It needs gold to move. Short ranging spells inside a trend were fine in the tests, but a long sideways year lost money. Expect long flat or losing stretches in a market like that.

Q: Can I run it next to other gold EAs? A: It trades the same kind of moment as other breakout systems. In the tests about half of its entries fell within fifteen minutes of a same-side Kingfisher entry, and about half of a same-side Captain Karat-Smash entry (two thirds with one or the other), so running them together adds to the same moves. Its daily results moved little with Kingfisher's (correlation 0.03) and moderately with Captain Karat-Smash's (0.35) (backtest, MetaTrader 5 Strategy Tester, real ticks, Vantage, 2025-08-08 to 2026-09-25, default settings).

Q: Do I need a VPS? A: A VPS or an always-on computer is recommended. The stop losses sit on the broker's server, but the break-even and the protection locks need the EA running.

Evidence

equity BLACKBULL (backtest chart)
equity BLACKBULL - Strategy Tester, real ticks, backtest