Fingerprint Acoustic TradeAutoPilot FX
MQL5 Expert Advisor · MetaTrader 5

AutoPilot FX EA

An ATR-based breakout straddle bot for MetaTrader 5. It brackets price with a Buy Stop and a Sell Stop sized from current volatility, follows whichever way the market breaks, cancels the other side, and re-arms once the trade closes — with an adjustable daily loss limit and built-in safety warnings.

Download AutoPilotFX_EA.mq5 Installation guide v1.51 · single file · ~23 KB

What it does

Stop-and-reverse breakout logic, driven by volatility — or by price percentage — rather than a fixed distance.

Volatility-sized straddle

Distance from price for both pending orders is ATR × multiplier by default, so the bracket widens in fast markets and tightens in quiet ones.

Breakout direction

Whichever stop order triggers first rides the breakout. Each entry carries a tight Stop Loss and Take Profit, in points or in % of price.

OCO behaviour

When one side fills, the opposite pending order is cancelled automatically. Only one straddle (two pending orders) is ever active — no grid, no martingale.

Auto re-arm & re-center

After a trade closes on SL or TP, a fresh straddle is placed around the new price. If price drifts off without triggering, the straddle re-centers.

Key features

Safety and transparency are built in, not bolted on.

Auto mode — works on anything

Default setting. SL, TP, and straddle distance are all multiples of the instrument's own live ATR, and the spread filter compares live spread to live ATR too — so nothing is a fixed number that a given instrument could outgrow. Confirm and go, on forex, crypto, metals, or an index.

Category presets, if you'd rather

Set InpPreset to Forex, Crypto, or Metals / Index for a fixed bundle tuned to that category instead of Auto's live calibration. Pick Custom to control every number by hand.

OCO straddle engine

Buy Stop above, Sell Stop below; first fill wins, the other order is pulled.

Fixed-points or %-of-price mode

Under Custom mode, calculate SL, TP, and straddle distance as raw points off an ATR reading, or as a percentage of price — useful for instruments where a fixed point count doesn't scale, like crypto pairs.

Adjustable daily loss limit

Halts trading for the rest of the day once losses hit a cap — a percentage of the day-start balance or a fixed amount. Optionally closes any open position when the limit is reached.

Spread filter

Skips placing new orders when the spread is wider than your threshold, to avoid entering during news spikes.

Optional chop/trend filter

Off by default. InpUseChopFilter pauses placing a new straddle when live ADX reads below InpMinADX — the ranging conditions this strategy tends to whipsaw in. Only delays arming a fresh straddle; never touches a trade that's already open.

Input sanity-check warnings

On load, the EA checks your settings against recommended safe ranges and raises an Alert plus a detailed log explanation for anything outside them. It still runs with your values — the warning is informational.

On-chart dashboard

Live status panel showing current state, today's P/L, and whether the daily limit has been hit.

Single self-contained file

One .mq5, no dependencies, no DLLs. Compile in MetaEditor and run.

Installation

About two minutes in MetaTrader 5.

  1. Download AutoPilotFX_EA.mq5 from the button above.
  2. In MetaTrader 5, open File → Open Data Folder.
  3. Copy the file into MQL5/Experts/. If you're updating an existing copy, delete the old .mq5/.ex5 first so MT5's Navigator doesn't end up listing two versions side by side.
  4. Back in MT5, right-click Expert Advisors in the Navigator and choose Refresh. Then right-click the EA itself → Modify → press F7 in MetaEditor to compile (confirm "0 errors, 0 warnings").
  5. Drag AutoPilotFX_EA onto a chart (tested on EURUSD) and tick Allow Algo Trading in the dialog's Common tab. You also need the global “Algo Trading” button in MT5's top toolbar switched on — both have to be enabled, or every order gets silently rejected with “auto trading disabled by client”.
  6. In the Inputs tab, InpPreset defaults to Auto — it self-calibrates to whatever chart it's on, so you can just confirm and go. Switch it to Forex / Crypto / Metals / Index for a fixed category bundle instead, or Custom to set each value yourself — see the Key Inputs table below.

Key inputs

InpPreset defaults to Auto, which works out of the box — the table below is for anyone who wants a fixed category bundle instead, or picks Custom to set every value themselves.

PresetUse forWhat it sets
Auto (default)anything — no need to know what it isATR-Relative mode: SL/TP/distance are all multiples of this instrument's own live ATR; spread filter compares live spread to live ATR too. Nothing hard-coded, nothing to outgrow.
ForexEURUSD, GBPUSD, AUDJPY, etc.Fixed Points mode, ATR × 1.0 distance, 80/120pt SL/TP, 200pt max spread
CryptoBTCUSD, ETHUSD, etc.Percentage mode, 1.5%/2.5% SL/TP, 1.0% distance, 3000pt max spread
Metals / IndexXAUUSD, US30, etc.Percentage mode, 0.5%/0.8% SL/TP, 0.3% distance, 500pt max spread
Customanything, hand-tunedUses every detailed input in the table below, unchanged

Why Auto is the default: the category presets are still a human guess about what's "typical" for forex, crypto, etc. — usually fine, but a specific pair can sit outside that norm (an unusually wide spread right now, say). Auto never hard-codes a number at all: everything recalculates from this instrument's own live ATR and spread continuously, so there's no preset to pick wrong and nothing that can quietly stop fitting later.

These are sane starting points, not tuned or guaranteed settings — validate on a demo account first, same as any default.

Input (Custom preset only, unless noted)DefaultNotes
InpCalcModeFixed PointsFixed Points (ATR distance), Percentage of Price, or Auto (ATR-Relative)
InpATRPeriod14ATR period — Fixed Points or Auto mode
InpATRTimeframeM15Timeframe used for the ATR reading — Fixed Points or Auto mode
InpATRMultiplier1.0Distance from price = ATR × this — Fixed Points or Auto mode
InpSLPoints80Stop loss, in points — Fixed Points mode
InpTPPoints120Take profit, in points — Fixed Points mode
InpSLPercent0.07Stop loss, % of entry price — Percentage mode
InpTPPercent0.11Take profit, % of entry price — Percentage mode
InpDistancePercent0.05Straddle distance, % of current price — Percentage mode
InpSLATRMultiplier0.9Stop loss = ATR × this — Auto/ATR-Relative mode
InpTPATRMultiplier1.5Take profit = ATR × this — Auto/ATR-Relative mode
InpMaxSpreadATRFactor0.25Skip placing orders if spread exceeds ATR × this — Auto/ATR-Relative mode
InpLotSize0.01Lot size
InpMagicNumber260826Unique EA identifier
InpMaxSpreadPoints200Max allowed spread (points) — Fixed Points or Percentage mode
InpUseChopFilterfalsePause new straddles when the market looks like it's ranging (ADX-based)
InpADXPeriod14ADX period — chop filter
InpADXTimeframeM15Timeframe used for the ADX reading — chop filter
InpMinADX20.0Minimum ADX to allow a new straddle; below this = treated as ranging/chop
InpUseDailyLossLimittrueEnable / disable the daily cap
InpLimitIsPercenttrue% of day-start balance vs fixed amount
InpDailyLossPercent3.0Recommended max: 5%
InpDailyLossAmount20.0Used only if InpLimitIsPercent = false
InpCloseOpenOnLimitHittrueClose open position when the limit hits

Disclaimer — read before use

  • Use a demo account first. Run the EA on a demo account until you understand its behaviour in your market and on your broker's conditions.
  • No guarantee of profit. Straddle bots whip-saw and lose repeatedly in ranging or choppy markets, and only profit on genuine breakouts. Past or simulated results do not predict future results.
  • The daily loss limit is a safety brake, not a promise. It caps losses within a single session — it does not make the strategy profitable.
  • Not financial advice. This software is provided for educational and informational purposes only. Nothing here is a recommendation to trade any instrument. Trading forex and CFDs carries a high risk of loss and is not suitable for everyone. You are solely responsible for any use of this EA and any resulting losses.
  • No warranty. The software is provided “as is”, without warranty of any kind.