EventStraddleMarket
- Experts
-
Kohei Takahashi
MQL5 developer focused on verified, test-driven delivery.
I build MetaTrader 5 Expert Advisors, indicators and utilities with an
engineering-first workflow:
- Published on MQL5 Market — 6 products: a news-event risk utility, - Version: 1.10
- Activations: 10
EventStraddle - scheduled-event breakout with an ATR trailing stop
WHAT IT DOES
The EA places a two-sided stop bracket a short time before a scheduled
economic release, keeps the side that the market breaks through, cancels the
other one, and trails the winner with an ATR-based stop. It is idle the rest
of the time.
HOW IT WORKS
1. A few minutes before a release (ArmLeadSec, 15 minutes by default) the EA
reads ATR(H1,14) and places a buy stop and a sell stop at +/- 1.0 ATR.
2. The stop loss of each order is 2.0 ATR away from its entry.
3. When one side is filled the other is cancelled (OCO).
4. Once the position is 1.0 ATR in profit the stop follows the price at a
distance of 0.5 ATR.
5. The position is closed after MaxHoldHours (24 by default) at the latest.
6. Orders that are never filled are removed CancelAfterSec after the release.
EVENT SCHEDULE
The release calendar is embedded in the EA - no external file and no internet
connection are required, and nothing has to be downloaded from the seller.
It covers policy decisions of the Fed, ECB, Bank of England, Bank of Japan,
Reserve Bank of Australia, Reserve Bank of New Zealand and Bank of Canada,
plus US Nonfarm Payrolls, US CPI, US Retail Sales, US Initial Jobless Claims,
EIA crude oil inventories, US Treasury long-bond auctions, UK CPI and Swiss CPI.
Each event is matched to the chart symbol by currency, so the EA can be used
on any instrument: attach it to EURUSD and it reacts to euro and US dollar
events, attach it to XAUUSD and it reacts to US dollar events.
EventFilter narrows this down to the events you want.
When CalendarExtend is on, the EA reads the terminal Economic Calendar and
adds matching future releases once the embedded dates run out, so the product
does not expire. This is a live-trading feature; it does not change backtests,
because the Strategy Tester has no calendar history.
RECOMMENDED SETTINGS
These symbol and event combinations were the ones that survived our own
testing. Use EventFilter to select a single event.
Symbol Event Trades Profit factor Net profit
--------------------------------------------------------
GBPNZD RBNZ 38 6.49 1 194.87
EURNZD RBNZ 39 5.05 925.49
NZDCAD RBNZ 38 8.07 596.08
AUDNZD RBNZ 39 4.64 425.12
NZDCHF RBNZ 39 3.36 430.90
NZDUSD RBNZ 39 2.46 336.85
GBPUSD BOE 45 1.80 340.55
EURGBP BOE 45 2.18 316.83
EURCAD ECB 39 1.53 115.40
XAGUSD NFP 61 2.58 3 482.25
XAGUSD FOMC 31 3.63 2 093.75
XAUUSD FOMC 31 1.90 734.86
USOIL USD_JOBLESS 109 1.30 715.73
Backtest, 2021-01-01 to 2026-08-08, 1-minute OHLC model, USD 10,000 deposit, fixed 0.10 lot, 1:100 leverage, spreads and commission as supplied by the broker feed.
Past results do not predict future results. Test the settings on your own
broker feed before using real money.
Note that several of the pairs above react to the same release, so running
more than one of them at the same time is one bet, not a diversified one.
MAIN INPUTS
RunMode Off / Signal only / Trade
EventFilter Comma separated event tags, empty = every embedded event
(FOMC, NFP, US_CPI, US_RETAIL_SALES, USD_JOBLESS,
EIA_CRUDE, AUCTION_LONG, ECB, BOE, GB_CPI, BOJ, RBA,
RBNZ, BOC, CH_CPI)
CalendarExtend Extend the schedule from the terminal calendar
AlertPopup Pop-up alerts, off by default
EventFile Optional CSV in MQL5\Files to add your own dates
ArmLeadSec Seconds before the release to place the bracket
CancelAfterSec Seconds after the release to cancel unfilled orders
KDistATR / SLATR Entry distance and stop loss, in ATR
TrailStartATR / TrailDistATR Trailing trigger and distance, in ATR
MaxHoldHours Hard time exit
LotMode / FixedLot / RiskPct / MaxLot Position sizing
MaxSpreadPoints / DeviationPoints / StopBufferPoints Execution filters
ServerGMTOffsetMin Server time offset, -1 = detected automatically
REQUIREMENTS
MetaTrader 5, hedging or netting account, any broker.
The EA trades only around the events listed above, which means a handful of
trades per month at most, and none at all on quiet weeks. This is by design.
RISK
Trading around scheduled releases means wide spreads and slippage at the
moment of the release. Size positions accordingly and never risk money you
cannot afford to lose.
