Joshua Dunnink · Trading Systems

← Captain Karat-Smash

Captain Karat-Smash — user manual

He waits patiently for the walls of consolidation to close in, and then BAM! Punches right through the resistance line to grab the gold. The rest of this manual explains exactly how he does it.

Version 1.11 · XAUUSD · attach to one H1 chart · hedging account


1. What it does

Captain Karat-Smash trades breakouts of intraday support and resistance on gold. It is not one strategy but seven independent ones running side by side on a single chart. They share one engine and differ in which timeframe they read, how strict their level definition is, and how their stop and target are proportioned.

Each strategy repeats the same cycle:

  1. Find the level. It looks for the most recent unbroken swing high above price and swing low below it — a bar whose high (or low) is more extreme than the bars on either side of it, and which no closed bar has traded through since. Strategies 1 and 2 read daily bars; strategies 3 to 7 read four-hour bars.
  2. Rest an order just inside it. A buy stop is placed slightly below the swing high, a sell stop slightly above the swing low. Price must carry through the level to trigger the order, which is what separates a break from a touch.
  3. Bracket the fill. Every position gets a stop loss and a take profit the moment it opens, both set as a percentage of the entry price, so the geometry is the same whether gold trades at 1,800 or 4,300.
  4. Manage the exit. Once the trade is far enough ahead, the stop moves to a locked level; from then on it trails behind each closed one-minute bar and never loosens. Two of the seven strategies also pull their target closer if the trade goes far enough against them, to exit on a bounce rather than at the full stop.
  5. Expire unfilled orders. Every resting order has a lifetime, from 20 hours to 20 days depending on the strategy. When it expires it is re-placed at the same level if that level is still one of the two most recent unbroken swings, and dropped otherwise.

There is no grid, no martingale, no averaging down and no hedging of one position with another. Every position carries a hard stop loss from the moment it is opened. Losses are taken; they are not carried.

2. Installation

  1. Copy CAPTAIN_KARAT-SMASH.ex5 into MQL5\Experts and restart the terminal. (An earlier build of this engine may still be present in some installs under a different file name; always install CAPTAIN_KARAT-SMASH.ex5 and check the Journal shows version 1.09 on its version line.)
  2. Open one XAUUSD H1 chart and attach the EA. The chart timeframe is only a host — each strategy reads the timeframes it needs on its own.
  3. Enable algorithmic trading.
  4. Leave every input at its default. The compiled defaults are the validated configuration; no preset file is required. Set the Risk level and nothing else.

Requirements: a hedging account (the seven strategies hold independent positions), XAUUSD available with a normal contract size, and a stable connection or VPS. The EA prints a note if it is started on a netting account.

3. The only setting that matters

The figures below come from a Strategy Tester backtest, real ticks, BlackBull XAUUSD, 2022 to 2026.

Risk level Balance behind each 0.01 lot Historical drawdown on the longest window tested
Low 8,000 about 7%
Medium (default) 5,500 about 11%
High 4,000 about 15%
Hot 3,000 about 20%
Custom your own figure —

The drawdown column is measured, not extrapolated, in a Strategy Tester backtest, BlackBull XAUUSD, 2022 to 2026: a balance of 4,000 behind each 0.01 lot produced a 14.8% peak-to-trough drawdown over 3.8 years of real ticks, the longest window tested and the only one containing a full flat year. Drawdown scales inversely with the balance figure, which is how the other levels are derived.

Position size scales with account balance, so the drawdown percentage stays roughly constant as the account grows or shrinks. The percentages come from a backtest on real broker ticks; plan for the future being worse than the past. A widely used rule of thumb among system traders is to assume the worst historical drawdown can double, and to stop and review a system if drawdown in practice reaches one and a half times its historical maximum.

Suggested minimum balance: 3,000 at Medium. The EA never refuses to trade on a small balance — it falls back to the broker's minimum lot — but below that figure a single minimum lot is a large share of the account and the drawdown percentages above no longer apply.

3f. What changed in version 1.11

3e. What changed in version 1.10 - panel, chart labels, restart-safe

The panel and the chart (since 1.10)

A small panel in the top-left corner shows what the EA is doing, and the chart labels every level it waits at, every open trade's exit and every closed trade's result. Nothing is drawn in a plain Strategy Tester run; on a live chart and in the visual tester it refreshes every second. Inputs: InpPanel, InpDrawTrades, InpCleanChart (hides the grid while the EA runs and puts it back when it is removed), InpTextSize.

Line What it tells you
CAPTAIN KARAT-SMASH 1.10 XAUUSD risk Medium what runs on this chart
Strategies on: 1 2 3 4 5 6 7 order 0.02 lot which strategies trade and the lot each order uses now
Exits: stop locks, then trails; London Grip keeps 50% the exit rules in one line
Trading - 7 strategies watch their levels why it trades now - or Market closed, Spread ... above the limit, Entries PAUSED ..., a prop-firm rule
Resting orders: 14 (nearest first) / S3 buy 4210.50, ... the orders waiting at levels, the four nearest to price
S3 BUY 0.02 @ 4185.20 +12.40 USD / stop locks at 4199.00 each open trade and what its exit does now: where the stop locks, where the Grip starts or exits, or the trailing stop
Waiting for margin: next order needs 152.40 (red) your broker's margin holds orders back - shown only while the free margin is short
Closed today: 3 trades +12.40 USD / Last 7 days: ... this EA's own closed result (its magic number only, costs included)

4 buttons. Every action is sent by the EA itself and written to the Experts tab; a panel close carries the comment "... panel close". The second-click buttons need the same button again within 5 seconds.

Button What the EA does Clicks
Pause entries / Resume entries Pause: removes the resting orders and places no new ones; open trades keep their exits. The pause is saved on the account and survives a restart. Resume: orders return at the next check. one
Refresh orders removes the resting orders; fresh ones are placed at the next check with the current settings. No trade is opened or closed. two
Lock profit moves each winning trade's broker stop to its Grip exit (London Grip on), else to its strategy's own lock price once the trade is past it, else to the entry. A losing trade is left alone and a stop is never loosened. two
Close all closes every trade of this EA at market, removes its orders and pauses entries (press Resume to trade again). two

On the chart: each resting order as a dotted line at the swing level it rests on, labelled at the right edge with the strategies on it and their stop prices (buys above their line, sells below); each open trade's lock price, Grip start or Grip exit, or trailing stop as a line with its label. A closed trade shows as a dotted line from its entry to its exit, labelled with why it closed and its net result.

3d. What changed in version 1.09

London-session breaks are locked in; with-trend runners get more room. The London morning's first push is often the false move of the day: it runs, then fades once New York opens. From 1.09 a position opened in the London session (from 3:00 to 8:00 New York time) is protected by the Grip once it is half a stop in profit, and closed if it gives back half of its best move. Positions opened in any other session keep the trail. At the same time the trail on trades that go with the daily trend is a quarter wider (strategies 3, 4, 6 and 7); trades against the trend keep the 1.08 width.

Measured at 0.01 lot against 1.08 on four brokers' real ticks (January 2023 to September 2026):

broker net average dip below the peak deepest fall
BlackBull +29 % 47 % smaller 488 vs 692
OANDA +28 % 36 % smaller 522 vs 599
Fusion +25 % 35 % smaller 515 vs 578
IC Markets +47 % 47 % smaller 294 vs 372

The trade-off: the dips are shallower and shorter, but the ones that happen come faster - the deepest fall took about four weeks instead of several months. Proved before release: the 1.09 defaults place exactly the same deals as the tested configuration (208 trades, +671.63 on IC Markets real ticks, 1 May - 5 September 2026, where 1.08 made +346.60), and the prop account types carry it.

3c. What changed in version 1.08

The trail follows the daily trend. The wider 1.07 trail pays on trades that go WITH the daily trend and costs a little on trades AGAINST it: a counter-trend break tends to snap back, and the wider trail then gives back more. From 1.08 a position of strategies 3, 4, 6 or 7 that opens against the daily trend (the side of the previous day's close relative to its 20-day average) keeps the tighter pre-1.07 trail; with the trend it uses the 1.07 trail. Measured in a Strategy Tester backtest at 0.01 lot against 1.07 on four brokers' real ticks: net +3.9 % (BlackBull) / +3.5 % (OANDA) / +4.1 % (Fusion) / +11 % (IC Markets), and the worst five-day stretch at equal profit 5 to 12 % smaller on every one. Nothing else changes.

Proved before release: the 1.08 defaults place exactly the same deals as the tested trend-following configuration (208 trades, +346.60 on IC Markets real ticks, 1 May - 5 September 2026, where 1.07 made +254.31), and the prop account types carry it.

3b. What changed in version 1.07

A wider trailing stop. Strategies 3, 4, 6 and 7 now trail their stop twice as far behind price (for example strategy 3: 1.59 % of price instead of 0.80 %). The old trail was measured to close winners too early in quiet markets: measured in a Strategy Tester backtest across four brokers' real tick histories (BlackBull and OANDA 2023-2026, Fusion 2024-2026, IC Markets 2026) the wider trail earned more on every one - +9.7 % on BlackBull, +8.5 % on OANDA, +5.6 % on Fusion, +4.9 % on IC Markets, at 0.01 lot - and on BlackBull its deepest drawdown fell more slowly and was recovered in 28 trading days instead of 42. Trails wider still (x2.5 to x4) earned slightly more but lost faster and took about five times longer to recover, so they were not chosen. The entries, stops, targets and everything else are unchanged.

One screen of settings. The Inputs tab is now ordered 1 Start here (account type, risk level, a new virtual balance and the spread limit) / 2 Strategies / 3 Prop-firm rules / 4 Trading / 5 Custom sizing (chapter 4). The spread limit is now in USD (5.00): the old 500 points meant 5.00 USD on a two-decimal gold quote but only 0.50 USD on a three-decimal one. Both new inputs are off or unchanged at their defaults.

Proved before release: the 1.07 defaults place exactly the same deals as the tested x2.0 configuration (208 trades, +254.31, IC Markets real ticks, 1 May - 5 September 2026), the new inputs change nothing at their defaults, and the prop account types carry the new trail.

The yearly figures in chapter 5 were measured on version 1.05 (the older, tighter trail). They are being re-measured on 1.07; until then read them as the conservative case.

3a. Prop-firm accounts: one choice (since 1.06)

The first input, Account type (InpAccountMode), is all a prop-firm account needs:

Account type What it does
Personal (default) the risk level above and the strategy switches apply
Prop firm 2-step — challenges with a 5 % daily and 10 % maximum loss strategies 4 and 6 off; 3,667 of balance behind each 0.01 lot; daily 5 % and maximum 10 % loss limits on (chapter 5a)
Prop firm 1-step — challenges with a 3 % daily and 6 % maximum loss strategies 4 and 6 off; 5,500 behind each 0.01 lot; daily 3 % and maximum 6 % loss limits on

Why strategies 4 and 6 are off in prop modes. They are the two that put the most loss into the worst days, measured in a Strategy Tester backtest. With both off, Karat's worst day on BlackBull 2023–2026 halved, from a 3.4 % to a 1.7 % loss of balance, and its net per unit of worst-week risk rose by a quarter (BlackBull) to two-fifths (Vantage). That is why the prop size can be LARGER than the personal default and still stay far inside a daily-loss limit.

What the measurements say — a simulation that replays the backtest's own days in random blocks (10,000 paths, the challenge rules applied at every trade close); a statement about tested history, not a prediction:

raw-spread feed (window) account type challenge passes per attempt daily-loss breaches median trading days to funded
BlackBull (2023–2026) Prop firm 2-step 10 % then 5 % target, 5 % / 10 % 96.0 % none 211
Vantage (2025–2026) Prop firm 2-step same 100 % none 103
BlackBull (2023–2026) Prop firm 1-step 10 % target, 3 % / 6 % 89.3 % none 196
Vantage (2025–2026) Prop firm 1-step same 99.9 % none 98
BlackBull (2023–2026) Personal (all seven, Medium) on a 1-step same 83.4 % about 1 attempt in 8 119

Read it as: the prop types never broke a daily-loss rule in these histories; the quiet stretches (2023–2024) only cost time, so a challenge without a time limit is the right kind. The simulation used the raw-spread feeds the product is built for; on a standard-spread account expect slower progress.

Proof that the prop types are exactly what they say: on Pepperstone 28 August – 19 September 2026, Prop firm 2-step placed the same 32 deals, to the cent, as version 1.05 with strategies 4 and 6 off at 3,667 per 0.01 lot (+261.37), and Prop firm 1-step the same 32 deals as 1.05 with strategies 4 and 6 off at Medium (+130.37). With Personal, 1.06 places the same 48 deals as 1.05 (+213.78).

4. All inputs

The Inputs tab is ordered by how often you should touch it (since 1.07).

1. Start here

Input Default Meaning
Account type Personal Personal, or a prop account type that sets the size and the strategies itself (chapter 3a).
Risk level Medium The one knob. Custom hands sizing to section 5.
Virtual balance 0 (off) Size as if the balance were at most this amount — run a large account at a smaller account's size.
Maximum spread to place an order, USD 5.00 Orders are skipped while the spread is wider. In USD since 1.07, so it means the same on every broker (500 points was 5.00 USD on a two-decimal gold quote but 0.50 USD on a three-decimal one).

2. Strategies on or off — see the table below. 3. Prop-firm rules — chapter 5a.

4. Trading — direction filter, magic number, comment, order cap, slippage (table further down).

5. Custom sizing (Risk level = Custom only)

Input Default Meaning
Position sizing method Scale with balance Scale with balance, or a fixed lot.
Fixed lot size 0.01 Fixed sizing only.
Balance per 0.01 lot 5500 Scale-with-balance sizing only.
Maximum lot size per order 10.0 Hard ceiling on any single order, at every risk level.

Strategies — seven on/off switches, all on by default. Turning one off removes its trades and nothing else; the strategies do not interact.

Switch Reads Character
Strategy 1 Daily levels Tight stop, distant target. Few trades.
Strategy 2 Daily levels Tight stop, wide target. Few trades.
Strategy 3 Four-hour levels, at least 0.5% away Tight stop, far target.
Strategy 4 Two most recent four-hour levels Wide stop, near target.
Strategy 5 Four-hour levels, checked every five minutes Widest stop, small target.
Strategy 6 Four-hour levels, entry at the level Balanced.
Strategy 7 Four-hour levels, shorter confirmation Balanced, most active.

Trading

Input Default Meaning
Allow buy trades / Allow sell trades true Direction filter.
Magic number 89810 Change it if another EA on the account uses the same number.
Order comment prefix ABG The strategy number is appended, so each trade is traceable.
Maximum resting orders per strategy and side 4 Safety cap. In testing one to two were typically live.
Maximum slippage 50 points

5. What to expect

This is a trend harvester, not a steady income system. It waits, pays rent in quiet and choppy markets, and earns when gold makes a real move. If a two-year flat stretch would make you switch it off, this is not the right system for you.

All figures in this manual come from the MetaTrader 5 Strategy Tester on real broker tick data. Backtest results do not represent trading on a live account and do not predict future performance.

5a. Prop-firm rules: your firm's own numbers (since 1.05)

The Account type (chapter 3a) chooses the size. The group right under it, Prop-firm rules, enforces your firm's limits. Choosing Prop firm 2-step or Prop firm 1-step already fills in the two loss limits for you (5 % daily and 10 % maximum, or 3 % and 6 %; both fixed, and the EA acts 0.5 % before each); type your firm's own numbers to override them. With Personal every rule is off until you type a number.

When a limit is about to be reached, the EA closes its own trades, deletes its own orders and stops opening new ones: until the firm's next day for the daily rules, for good for the maximum loss and the profit target. The Journal says which rule acted and at what equity:

CAPTAIN_KARAT-SMASH prop-firm rule: daily loss limit (equity 95512.40, day start 100020.00, firm limit 95020.00) - trades closed, orders deleted, paused until the firm's next day

and the start line lists what is on:

CAPTAIN_KARAT-SMASH prop-firm rules: account size 100000.00 | daily loss 5.00% of account size from the higher of day-start balance and equity - the EA acts at 4.50% of account size | maximum loss 10.00% (fixed) - the EA acts at 9.50% | ...

The inputs (group "3. Prop-firm rules (0 = rule off)")

Input What to enter Default
Account size (InpPropAccountSize) the challenge's account size, e.g. 100000 (0 = the balance when the EA first starts) 0
Daily loss limit % (InpPropDailyLossPct) the firm's daily loss, e.g. 5 0 = off; a prop account type fills in 5 or 3
Daily loss limit is a % of (InpPropDailyPctOf) Account size (the same amount every day - most firms) or the day-start value Account size
Daily loss is counted from (InpPropDailyFrom) the value at the start of the firm's day: the higher of balance and equity (strictest, safe for every firm), balance or equity the higher of the two
Maximum loss limit % (InpPropMaxLossPct) the firm's maximum loss, e.g. 10 0 = off; a prop account type fills in 10 or 6
Maximum loss limit type (InpPropMaxRule) Fixed (account size minus the limit - most two-step challenges), Trailing: highest day-start balance, Trailing: highest equity, live Fixed
A trailing limit stops rising at the account size (InpPropTrailLock) most trailing firms stop moving the limit once it reaches the starting balance yes
Act this many % before each loss limit (InpPropSafetyPct) the safety margin: 0.5 means the EA acts at 4.5 % when the firm's limit is 5 % 0.5
Profit target % (InpPropTargetPct) close everything and stop when equity reaches the target (0 = keep trading) 0 = off
Best-day cap % (InpPropDayGainPct) close everything and pause for the day once the day's gain reaches this (for firms with a consistency rule) 0 = off
Hour the firm's day starts (InpPropDayStartHour) the hour on your platform's clock (the Market Watch time) at which the firm restarts its daily loss 0
Friday: close all at this hour (InpPropFridayCloseHour) for firms that do not allow holding over the weekend; trading resumes on Monday 0 = off
New challenge on the same login (InpPropResetState) set to true for ONE start when you begin a new challenge on the same login, then back to false false

Examples - what to type

From the LuxAlgo prop-firm directory on 23 September 2026 (the daily-loss wording is inferred by that directory; your firm's own rules page is always the authority, and firms change their rules):

Challenge (100,000 account) Daily loss % Maximum loss % and type Profit target %
FTMO Normal, 2-step 5 10, Fixed 10, then 5
FTMO Normal, 1-step 3 10, Fixed 10
FundingPips, 2-step 5 10, Fixed 8, then 5
FundingPips, 1-step 3 6, Fixed 10
The 5%ers High Stakes, 2-step 5 10, Fixed 8, then 5
Blue Guardian Pro, 1-step 3 6, Fixed 10

All six count the daily loss as a share of the account size from the previous day's closing balance, open trades included. Leave counted from at the higher of balance and equity - it is never later than the firm's own meter.

Profit target: set it for the challenge phases only. When the target is reached the EA stops for good on that login; on the funded account set it back to 0.

The firm's day. Most firms restart the daily loss at midnight of the platform's own clock: leave 0. If your firm names another time, convert it to the Market Watch clock. Gold is closed for about an hour around the broker's midnight on most platforms, so for gold an hour's difference rarely matters; a market that trades through midnight (Bitcoin) needs the exact hour.

Restarts. The EA remembers the account size, the day's starting value, the highest balance and whether a rule stopped it, across restarts of the platform (terminal global variables named PR<login>_<magic>_...). A restart in the middle of the day does not give it a fresh daily allowance.

What these rules do not do

Proof. With every rule off, this version placed the same deals as the version before it, deal for deal (32 trades, net +261.37, Pepperstone real ticks, 28 August - 19 September 2026). Each rule was then switched on at a level the same weeks reach; at all 8 triggers the EA closed its trades, opened nothing until the pause ended, and placed exactly the same deals as with the rules off up to the first trigger.

6. Troubleshooting

The EA prints a one-line census when it stops, for example:

Captain Karat-Smash: orders placed 632 | skipped - no level 2, spread 0, price inside stop level 1,
stop distance 0, lot 0, margin 0, send failed 0
Line shows Meaning
orders placed 0 and no level high Not enough bar history. Let the terminal download H4 and D1 history.
spread high Your spread is regularly above the limit. Raise it, or use a tighter-spread account.
price inside stop level high The broker's minimum stop distance is wide relative to the level offset.
lot high Sizing returned zero — check the balance-per-0.01 figure and the symbol's volume limits.
margin high Not enough free margin for the requested size; lower the risk level.
send failed high The broker rejected orders; check the journal for the reason.

No trades at all on a fresh chart is normal for the first hours: every strategy waits for a new confirmed swing before it places anything, and the daily strategies can wait days.

Complete reference — every input, its set-file key and default

Generated from the compiled source; enum defaults are the source names — the Inputs tab shows their plain labels.

Group Input Type Default Meaning
1. Start here InpAccountMode AccountMode ACCOUNT_PERSONAL Account type (prop modes set size and strategies)
1. Start here InpRisk RiskLevel RISK_MEDIUM Risk level
1. Start here InpVirtualBalance double 0 Size as if the balance were at most this (0 = off)
1. Start here InpMaxSpreadUsd double 5.00 Maximum spread to place an order, USD
2. Strategies on or off InpStrategy1 bool true Strategy 1 - daily level, distant target
2. Strategies on or off InpStrategy2 bool true Strategy 2 - daily level, wide target
2. Strategies on or off InpStrategy3 bool true Strategy 3 - 4-hour level, far target
2. Strategies on or off InpStrategy4 bool true Strategy 4 - 4-hour double level, near target
2. Strategies on or off InpStrategy5 bool true Strategy 5 - 4-hour level, wide stop
2. Strategies on or off InpStrategy6 bool true Strategy 6 - 4-hour level, at the level
2. Strategies on or off InpStrategy7 bool true Strategy 7 - 4-hour level, balanced
3. Prop-firm rules (0 = rule off) InpPropAccountSize double 0 Account size (0 = balance when the EA first starts)
3. Prop-firm rules (0 = rule off) InpPropDailyLossPct double 0 Daily loss limit % (0 = off)
3. Prop-firm rules (0 = rule off) InpPropDailyPctOf PropPctOf PROP_PCT_OF_SIZE Daily loss limit is a % of
3. Prop-firm rules (0 = rule off) InpPropDailyFrom PropDayFrom PROP_DAY_HIGHER Daily loss is counted from
3. Prop-firm rules (0 = rule off) InpPropMaxLossPct double 0 Maximum loss limit % (0 = off)
3. Prop-firm rules (0 = rule off) InpPropMaxRule PropMaxRule PROP_MAX_FIXED Maximum loss limit type
3. Prop-firm rules (0 = rule off) InpPropTrailLock bool true A trailing limit stops rising at the account size
3. Prop-firm rules (0 = rule off) InpPropSafetyPct double 0.5 Act this many % of account size BEFORE each loss limit
3. Prop-firm rules (0 = rule off) InpPropTargetPct double 0 Profit target %: close all and stop for good (0 = off)
3. Prop-firm rules (0 = rule off) InpPropDayGainPct double 0 Best-day cap %: close all and pause for the day (0 = off)
3. Prop-firm rules (0 = rule off) InpPropDayStartHour int 0 Hour the firm's day starts, broker server time (0-23)
3. Prop-firm rules (0 = rule off) InpPropFridayCloseHour int 0 Friday: close all at this hour (0 = off)
3. Prop-firm rules (0 = rule off) InpPropResetState bool false New challenge, same login: true once
4. Trading InpAllowBuy bool true Allow buy trades
4. Trading InpAllowSell bool true Allow sell trades
4. Trading InpMagic int 89810 Magic number
4. Trading InpComment string ABG Order comment prefix
4. Trading InpMaxOrdersPerSide int 4 Maximum resting orders per strategy and side
4. Trading InpSlippagePoints int 50 Maximum slippage (points)
5. Custom sizing (Risk level = Custom only) InpLotMode LotMode LOT_BALANCE Position sizing method
5. Custom sizing (Risk level = Custom only) InpFixedLot double 0.01 Fixed lot size (sizing = Fixed)
5. Custom sizing (Risk level = Custom only) InpBalancePer001 double 5500.0 Balance per 0.01 lot (sizing = Scale with balance)
5. Custom sizing (Risk level = Custom only) InpMaxLot double 10.0 Maximum lot size per order (every risk level)
6. Panel and chart InpPanel bool true Show the control panel (Pause, Refresh orders, Lock profit, Close all)
6. Panel and chart InpDrawTrades bool true Describe the levels, orders and trades on the chart
6. Panel and chart InpCleanChart bool true Clean chart: hide the grid (put back when the EA is removed)
6. Panel and chart InpTextSize int 10 Text size of the panel and the chart labels (8-16)