Pivot Stop Gold
- Experts
- Version: 2.0
- Updated: 7 November 2026
- Activations: 20
Pivot Stop Gold is built around one situation on gold: price turns at a swing and then moves through it. The EA does not chase the move. A pending stop order is already waiting near the swing, with its stop and target attached, before price gets there. Positions are short: in the report below the average one lasted five minutes.
The Pivot Level
On every new bar of its working timeframe the EA builds a ZigZag from the last 300 bars and takes the two latest pivots, never counting the bar that is still forming. If the older of the two is a high, a Buy Stop is placed just below it. If the older one is a low, a Sell Stop is placed just above it. The distance is a fixed offset that belongs to the profile. No order is placed once price is within 0.10 of the level or already beyond it, and the EA keeps at most one order or position per side (per profile in portfolio mode). A pending order lives for a set number of hours, and the EA removes it by itself at the first tick after that time.
Seven Profiles
A profile fixes the working timeframe, the ZigZag depth, the entry offset, the stop, the target and the trailing. Distances are in USD per ounce of gold, that is 100 points of a two-digit quote per dollar. Scalp is the default.
- Calm: M30 bars, depth 18, entry 1.85 in front of the pivot, stop 4.25, target 17.50, trailing from 5.30 at a distance of 1.50, order lifetime 8 hours.
- Rapid: M15 bars, depth 20, entry 1.75, stop 3.00, target 15.00, trailing from 1.30 at 0.50, 8 hours.
- Scalp: M15 bars, depth 18, entry 1.60, stop 3.00, target 15.00, trailing from 1.40 at 0.50, 12 hours.
- Swing: M15 bars, depth 12, entry 0.50 beyond the pivot, stop 25.00, target 45.00, trailing from 15.00 at 5.00, no lifetime limit.
- Guarded: M15 bars, depth 18, entry 1.50, stop 3.50 and target 25.00 (doubled during the first two minutes), trailing from 1.65 at 0.40, 12 hours.
- Balanced: M30 bars, depth 18, entry 1.75, stop 3.25, target 22.50, trailing from 5.75 at 1.65, 12 hours.
- Custom: every distance is an input.
Portfolio Mode
Off by default. With the input "Run several profiles at once" switched on, the EA runs the profiles above side by side on one XAUUSD chart instead of one profile. Each profile keeps its own timeframe, ZigZag depth and distances, and its own magic number: the base magic number plus one plus the place of the profile in the list, so the orders of different profiles can be told apart in the history. Every profile has its own on/off input, the profile input of the Strategy group is not used in this mode, and Custom works on the chart timeframe.
Every profile holds at most one waiting signal per side, a slot. A slot is taken when the profile finds a pivot and is released when the order lifetime of that profile ends, so a signal that had to wait does not turn into a stale order later. The lot is fixed when the slot is taken. Orders of all profiles go through one queue: Buy Stops before Sell Stops, the order whose price is nearest to the market first, and at the same price the one that risks less.
One limit guards the queue: the risk to the stop of all open positions and pending orders of one side, measured in percent of equity. It is 3% by default and 0 switches it off. An order that would take a side over the limit stays in its slot and is sent once there is room, for as long as the slot lives. With the default risk of 1% per order about three orders per side fit under the limit. The seven profiles trade the same market, so several of them often wait for the same swing in the same direction; the limit keeps that from piling up more risk than you chose. The daily break, the Friday cut-off and the account guards act on all profiles together. The mode needs a hedging account: on a netting account the EA runs the single profile instead.
Managing A Position
Stop and target are attached to the pending order, so the broker holds both before the fill. Once the price has moved the trailing start distance from the entry in the direction of the position, the stop follows the price tick by tick at the trailing distance and never moves back. An optional rule, off by default, moves the stop to the entry plus a small lock after the price has moved 0.80 in the direction of the position in Calm, Rapid, Scalp and Custom. Nothing is added to a losing position and nothing is doubled. Optional extras, all off by default: a random shift of the entry price, a wide placeholder stop with the real stop set after the fill, and a stop measured from the fill price instead of the order price.
Daily Break And Friday Cut-Off
On the broker's server clock the EA places no orders from 21:15 to 01:15, removes its pending orders and closes its positions at 21:15. On Friday the same happens from 15:25, or five minutes before the end of the Friday trading session if that session ends earlier. Both windows are inputs and can be switched off. A close or a stop change that the broker would refuse, because the stop or target is inside the broker's freeze zone or the trading session is closed, is held back and sent again on the next tick that allows it.
Lot Size And Risk Controls
- Three ways to size the lot: by default 1% of equity risked to the stop, a fixed lot, or 0.01 lot for every 100 of balance.
- The order is skipped if free margin would not cover it. A pending order is withdrawn if the free margin falls below what it needs before it fires; a broker that reserves margin for pending orders makes this check unnecessary.
- Optional and off by default: a cap on the spread, a stop once the day's result reaches a set level, a stop after a daily loss, and a stop after a drawdown of equity within the day.
- On by default, on a live account only: a pause of new orders around scheduled US news releases, and during a speech of the Fed Chair. The tester has no calendar, so the report below does not include this pause.
- Magic number and order comment are inputs, so the EA can sit beside other robots on the same account.
Strategy Tester Figures
Strategy Tester, XAUUSD, 100% real ticks, the period 2025.01.02 - 2026.10.02 (the earliest date with real ticks on the terminal used for this test), starting deposit 1000, leverage 1:500, every input at the value it ships with:
- net result 1628.41
- gross positive divided by gross negative: 1.77
- 560 trades, 73.57% of them positive
- average positive trade 9.07, average negative trade -13.76, largest negative trade -58.10
- longest run of negative trades in a row: 6
- largest balance drawdown measured in percent: 6.70% (74.19 in USD)
- largest balance drawdown measured in USD: 103.36 (3.88%)
- largest equity drawdown measured in percent: 7.17% (79.47 in USD)
- largest equity drawdown measured in USD: 108.40 (4.06%)
The result includes the commission of the broker used for the test, taken from its specification of today for the whole period; another broker charges differently and gets a different result.
Delay And Portfolio Figures
A second test, on 100% real ticks of XAUUSD, starting deposit 1000, leverage 1:500, every input at the value it ships with, except that the portfolio input is switched off for the first group of rows and on for the second. It is three separate starts, each with a deposit of 1000: 2026.01.02 - 2026.04.01, 2026.04.01 - 2026.07.01 and 2026.07.01 - 2026.10.02. The terminal used for this second test has real ticks only from 2026.01.02, so 2025 is not in this test; the first report above was made earlier, when the terminal still had real ticks from 2025.01.02. The results of the three starts are added up, and the drawdown is the largest balance drawdown of any one start. Each mode has three rows. The first is the tester as it is, without delay. The second sets an execution delay of 300 ms in the tester and adds the entry slippage of live trades of another EA on gold at another broker, in the milder way. The third sets 1000 ms and adds that slippage in the stricter way. The slippage allowance is an order of magnitude, not a measurement of this EA. The 95% interval is the result resampled by trading days inside the three starts; it does not cover a change in the market. For the second and third rows the drawdown is the average over the draws of the slippage allowance; in 95% of the draws the largest drawdown of a start was at or below 6.00% and 10.10% for the single profile and 14.68% and 21.72% for Portfolio mode.
The single profile (Scalp), the sum of three starts, USD, interval, largest balance drawdown of a start:
- without delay: 929.50, from 610.50 to 1264.97, 3.95%
- 300 ms and the milder allowance: 1002.94, from 587.81 to 1463.44, 4.59%
- 1000 ms and the stricter allowance: 674.15, from 215.79 to 1138.18, 8.35%
- 244 trades in each row
Portfolio mode, all seven profiles at once with the default limit of 3% per side:
- without delay: 2954.51, from 1847.72 to 4000.38, 11.11%
- 300 ms and the milder allowance: 2981.01, from 1797.50 to 4253.63, 11.68%
- 1000 ms and the stricter allowance: 1803.31, from 595.65 to 3038.84, 18.20%
- 759, 750 and 753 trades in the three rows
Compared with the first row, the stricter row takes 27.5% off the single profile and 39.0% off Portfolio mode. The second row is not below the first because the delay moves entry and exit prices and, in Portfolio mode, which trades happen, not because a delay helps; do not read it as a gain. Portfolio mode made 2.7 to 3.2 times the net result of the single profile in these starts and its drawdown was 2.2 to 2.8 times larger; on the stricter row it is 18.20% against 8.35%. It is a mode of higher risk, not a better version of the same thing, and these figures are not a forecast. Portfolio mode was measured on real ticks only for 2026, because the terminal used for this test has no real ticks before 2026.01.02. On ticks the tester generated for 2025, with the delay and slippage allowance, the 95% interval of the result included zero for both modes, and in Portfolio mode the largest balance drawdown of a start was 24.87% on the milder row and 36.39% on the stricter row. Generated ticks are not real ticks, so treat that as a rough guide, not a measurement.
What The Figures Do Not Show
The Scalp profile was picked after comparing three profiles on March to September 2026, a stretch inside this period, so the period is not an independent test of the settings. The same holds for the three starts of 2026 in Delay And Portfolio Figures, and the settings of the seven Portfolio profiles were not tested on data outside 2025 and 2026. The result is uneven: 2025 added 12.97% to the balance, 2026 up to 2 October added 132.66%, and March, April and July 2026 together gave about half of the whole result. On its own, the 2025 result cannot be told apart from zero.
There is no live track record: every figure on this page comes from the Strategy Tester.
The first report above has no delay: the tester does not hold back a pending stop order, whatever execution delay is set. A stop order fills at its price, or at the first tick after a gap when price jumps over it. A real account adds a delay and slippage to that. The average trade in that report was worth about 0.59 per 0.01 lot, so a delay or slippage of that size takes away the whole result. The rows with delay in the section above lean on the live trades of another EA on gold at another broker; how large the delay and the slippage are for this EA on a live account has not been measured yet. The only comparison of live execution with the tester that exists for this way of trading was made on that account and broker, and its gap per trade was larger than this average.
The slippage allowance covers entries only: a stop order that fills worse than its price on a live account is not added, so the stricter row is not a worst case. The tester has no news calendar, so none of the figures includes the pause around news releases.
The risk of 1% is measured to the stop. When price jumps over a stop the loss is larger than that: in this report the worst trade lost 2.79% of the balance.
What It Needs
XAUUSD on a hedging account; the distances above are written for gold. With the default risk of 1% the smallest lot of 0.01 needs an equity of about 300 USD: below that the EA places no orders. Run it on a server close to the broker's and prefer a broker with a low gold spread. Check the broker's server time against the break and Friday settings. The EA works on any chart timeframe, because it builds its own bars from the profile.
Settings
The inputs are grouped as Strategy (profile), Portfolio, Position size, Custom profile, Daily break, Friday cut-off, Account guards, News guard, Order handling options, Execution and Identification.
Questions
Send a private message on mql5.com if the EA behaves differently from this description, with your broker, the server time shown in the terminal and the settings you use.
