Pipsgrowth EX12064 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · GBPUSD · M5
Pipsgrowth.com EX12064 GBP9AM — 9AM London breakout with Buy/Sell Stop, full 12-layer stack.
Overview
Pipsgrowth EX12064 is a 9AM London GBPUSD breakout that doesn't read a single indicator. The full source is built on a 2005 community request quoted directly in the comment block: 'I looking for system automat wich will be trade for me this 9:00 GMT look for price GBP/USD then price is 1.8230 example (bid)'. The brief was to look at the price at 9 AM London, then place a Buy Stop above and a Sell Stop below that snapshot and let the market decide which side breaks first. That request is still the soul of the EA — every parameter in the file is a knob on that single idea.
The execution model is a daily pair of pending orders. On every tick, OnTick() reads the server clock and waits for STimeCurrent.hour == InpLookPriceHour (default 10 — the input comment explicitly says 'Change for your time zone (my is +1 Hour). Should be 9AM London time') and STimeCurrent.min >= InpLookPriceMiin (default 0). When that window is reached and the boolean clear_to_send is still true, the EA first calls CloseAllPositions() and DeleteAllPendingOrders() to flush the previous day's trades, then asks m_symbol.Ask() + ExtDistanceBuy and m_symbol.Bid() - ExtDistanceSell for the two trigger prices. The two pending orders are sent through PendingBuyStop() and PendingSellStop() and clear_to_send flips to false. The two orders live as a pair with ORDER_TIME_GTC, so they don't expire at end of day — they only get cleaned up by the next morning's reset or by the cancel-opposite logic when one of them fills.
The asymmetric geometry is the most distinctive design choice. InpDistanceBuy defaults to 18 pips and InpDistanceSell defaults to 22 pips, while InpStopLossBuy defaults to 22 pips and InpStopLossSell defaults to 18 pips. The two wings are deliberately not mirrored. The Buy Stop sits closer to the snapshot (18 pips) and is given a wider stop (22 pips), while the Sell Stop sits farther from the snapshot (22 pips) and is given a tighter stop (18 pips). The 2005 community request called this out explicitly: 'open long 18pips+4pips spread at this price so will be LONG 1.8252 profit 40pips stop 22pips' and 'open short 22pips-4pipsspread so 1.8230-22-4=1.8204 so 1.8204 short profit 40pips stop 18pips'. The four-pip spread on the original 2005 GBPUSD quote is what forced the asymmetric offsets, and the EA preserved that geometry as the default. The shared take-profit, InpTakeProfit = 40 pips, applies to both wings identically — it's applied as Ask + 40 pips for the Buy Stop and Bid − 40 pips for the Sell Stop, so each filled position has a roughly symmetric reward arm of 40 pips regardless of which side triggers first.
The cancel-opposite behavior is the EA's only 'management' mechanic. After the pair is placed, every subsequent tick runs CalculatePendingOrders(count_buy_stop, count_sell_stop) to count how many of each type are still pending. The condition ((count_buy_stop==0 && count_sell_stop!=0) || (count_buy_stop!=0 && count_sell_stop==0)) checks whether exactly one wing has filled and the other is still pending. When that asymmetry appears, DeleteAllPendingOrders() fires and removes the surviving pending order so the EA isn't carrying both a filled position and a stale stop in the opposite direction. The filled position itself is left to run until it hits its 40-pip TP, its per-side SL, or the daily close-hour cut.
The clear_to_send flag governs when the next morning's snapshot is allowed to fire. It only resets under two conditions: (1) the hour is no longer the look hour, a position exists, and the minute is past InpLookPriceMiin — i.e. yesterday's trade is still open and the new day is being respected; or (2) the clock is in the 10-minute window before the next look hour (STimeCurrent.hour == InpLookPriceHour-1 and MathAbs(STimeCurrent.min - InpLookPriceMiin) < 10) — i.e. we're approaching tomorrow's snapshot. Both paths are safety nets: the first prevents double-snapshotting a day that already has an open position; the second ensures a clean reset even if the previous day's pair was never triggered. clear_to_send is intentionally a bool rather than a date stamp, which is the simplest possible state machine for a once-a-day EA.
The end-of-day exit is InpUseCloseHour (default true) combined with InpCloseHour (default 18). On any tick where STimeCurrent.hour >= InpCloseHour and the close-hour feature is on, OnTick() calls CloseAllPositions() and DeleteAllPendingOrders() and returns early — no new pending orders are placed, no further logic runs. This means an untriggered Buy Stop / Sell Stop pair from the morning does not survive overnight. If a trader wants to hold the breakout overnight, the input is a one-click toggle: set InpUseCloseHour = false and the orders remain active until the next morning's reset cycle.
The trade-execution layer is built on the MT5 standard library classes — CTrade, CPositionInfo, CSymbolInfo, CDealInfo, COrderInfo — wrapped in three retry helpers, TryClose_EX12064, TryClosePartial_EX12064, and TryModify_EX12064. Each helper attempts the trade up to three times, sleeping 200 ms between close attempts and 100 ms between modify attempts on TRADE_RETCODE_REQUOTE, TRADE_RETCODE_TIMEOUT, TRADE_RETCODE_PRICE_OFF, or TRADE_RETCODE_PRICE_CHANGED. The m_trade object is configured once in OnInit() with SetExpertMagicNumber(m_magic) (22212064), SetMarginMode(), SetTypeFillingBySymbol() to match the broker's allowed order type, and SetDeviationInPoints(10) for the 1-pip slippage tolerance. CheckVolumeValue() validates the lot size against the symbol's LotsMin, LotsMax, and LotsStep before any order is sent. The m_adjusted_point variable multiplies the MT5 point by 10 on 3- and 5-digit symbols so that the input's 'pips' (which are 1-pip units, not points) read correctly across brokers.
The 13 inputs split across two groups — === Strategy === and === Identity === — are all that the user can change. There's no spread filter input, no session input beyond the two time markers, no news filter, no indicator settings, no magic-derivatives, no money-management input other than InpLots. The InpReport input (15 seconds) drives an EventSetTimer that periodically calls ReportStrategy() from OnTimer(); ReportStrategy() walks the deal history, filters by symbol and m_magic, and writes a single Comment(...) line to the chart showing Executed X+Y trades with P+P_open = total profit and the current server and local hours. There's no graphical panel, no dashboard, no on-chart indicator drawing — the strategy is intentionally minimal because the request was for a 9AM London breakout and nothing else.
The practical constraint is spread sensitivity. With InpDistanceBuy = 18 pips, a 4-pip spread (the 2005 baseline) eats 22% of the offset to the Buy Stop; with a 6-pip spread it's 33%. The 40-pip TP is enough to absorb up to 8 pips of round-trip spread and still net 32 pips of profit, but the EA's edge is real only when the broker's typical spread is below 4-5 pips on GBPUSD. That's why the EA works best on a low-spread ECN or RAW account during the London open, when GBPUSD's typical spread is at its session minimum. Backtests on the strategy will look very different on a 3-pip broker vs a 1-pip broker — the same code, the same inputs, but the trade count and average profit-per-trade shift materially. The recommended minimum balance is $100 for a 0.01-lot micro test and roughly $1,000 for a 0.1-lot standard test, which is the file's InpLots = 0.1 default.
This EA is the right choice for a trader who wants a deterministic, time-driven breakout on a single pair, who is happy to make the entire strategy's behavior controllable from 13 inputs, and who is willing to size lots manually rather than use a percent-of-balance money manager. It's not the right choice for traders looking for a martingale, a grid, an indicator stack, a multi-symbol basket, or any of the more elaborate tactics that other EAs in the family provide. The whole file is a 2005 forum request — 'I will be glad if I see this in code' — faithfully executed.
Strategy Deep Dive
Pipsgrowth EX12064 reads only the server clock — there are no indicator handles, no moving averages, no RSI. On every tick, OnTick() compares the current server hour and minute to the look window (InpLookPriceHour=10, InpLookPriceMiin=0). When the window opens and clear_to_send is true, the EA first closes any open positions and deletes any pending orders, then sends a Buy Stop at Ask + ExtDistanceBuy and a Sell Stop at Bid − ExtDistanceSell, both with GTC expiry. After that, OnTick() counts how many stops of each type are still pending; when exactly one wing has filled, it deletes the surviving opposite. The clear_to_send flag is reset by either a position still being open on the next hour, or by a 10-minute pre-window before the next snapshot. ReportStrategy() runs on a 15-second timer and writes a single Comment line with deal count, position count, profit, and server/local hours. The trade layer is wrapped in three retry helpers (TryClose_EX12064 / TryClosePartial_EX12064 / TryModify_EX12064) that retry three times on requote/timeout/price errors with 200 ms close-sleeps and 100 ms modify-sleeps.
At server hour InpLookPriceHour (default 10, the 9AM London mark per the +1 timezone comment) and minute InpLookPriceMiin (default 0), the EA first calls CloseAllPositions() and DeleteAllPendingOrders() to flush the previous day's trades, then snapshots Ask and Bid, adds ExtDistanceBuy (18 pips) to Ask for the Buy Stop trigger and subtracts ExtDistanceSell (22 pips) from Bid for the Sell Stop trigger. The two pending orders are sent via PendingBuyStop() and PendingSellStop() with ORDER_TIME_GTC, so they sit as a pair until the market touches one.
Three exits operate in parallel. (1) When exactly one pending order fills, CalculatePendingOrders() detects the asymmetry and DeleteAllPendingOrders() removes the surviving opposite stop. (2) The filled position runs to its per-side TP (40 pips from the entry price) or per-side SL (22 pips for buys, 18 pips for sells). (3) If InpUseCloseHour is true and the server hour reaches InpCloseHour (default 18), OnTick() calls CloseAllPositions() and DeleteAllPendingOrders() and returns, liquidating the day.
Per-ticket stop losses are fixed at the entry moment: 22 pips for the Buy Stop (InpStopLossBuy, applied as Ask − 22 pips) and 18 pips for the Sell Stop (InpStopLossSell, applied as Bid + 18 pips). There is no trailing stop, no break-even ratchet, and no basket-level drawdown cap. Setting either InpStopLossBuy or InpStopLossSell to 0 disables the stop loss on that wing.
Both wings share a single 40-pip take profit (InpTakeProfit). The TP is applied as Ask + 40 pips for the Buy Stop and Bid − 40 pips for the Sell Stop, so each filled position has the same 40-pip reward arm regardless of which side triggers first. Setting InpTakeProfit to 0 disables the take profit on both wings and the position is left to ride until the close hour or an opposite cancel.
GBPUSD on M5 (or any chart timeframe — the strategy is time-driven, not bar-driven) with a $100 minimum for a 0.01-lot micro test, scaling to a $1,000 standard account for the 0.1-lot default (InpLots). Best run on a low-spread ECN or RAW broker during the 9 AM London open, where the typical GBPUSD spread drops to its session minimum and the 18/22-pip asymmetric distances stop absorbing spread drag. The strategy is deterministic, indicator-free, and fully controllable from 13 inputs, so it suits traders who want a time-based breakout without martingale, grid, or any of the more elaborate tactics — but the broker's spread is the single biggest determinant of the backtest, so a sub-2-pip broker on GBPUSD is recommended.
Strategy Logic
Pipsgrowth EX12064 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212064
Version: 2.00
BRIEF:
GBP 9AM breakout strategy that places Buy Stop and Sell Stop pending orders at configurable distances from the 9AM London price. Cancels opposite order when one triggers. Includes close-hour management and daily reset logic. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
OnTimer()OnTradeTransaction()RefreshRates()CheckVolumeValue()ReportStrategy()CloseAllPositions()DeleteAllPendingOrders()PendingBuyStop()PendingSellStop()PrintResultTrade()CalculatePendingOrders()IsPositionExists()- ...and 3 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (13 total across 2 groups):
- [=== Strategy ===]
InpLots=0.1// Lots - [=== Strategy ===]
InpLookPriceHour= 10 // Change for your time zone (my is +1 Hour). Should be 9AM London time - [=== Strategy ===]
InpLookPriceMiin= 0 // Offset in minutes when to look on price - [=== Strategy ===]
InpCloseHour= 18 // Close all orders after this hour - [=== Strategy ===]
InpUseCloseHour=true// Set it tofalseto ignore Close Hour - [=== Strategy ===]
InpTakeProfit= 40 // Buy Stop and Sell Stop: TakeProfit(in pips) - [=== Strategy ===]
InpDistanceBuy= 18 // Buy Stop: distance from current price (in pips) - [=== Strategy ===]
InpDistanceSell= 22 // Sell Stop: distance from current price (in pips) - [=== Strategy ===]
InpStopLossBuy= 22 // Buy Stop: StopLoss(in pips) - [=== Strategy ===]
InpStopLossSell= 18 // Sell Stop: StopLoss(in pips) - [=== Strategy ===]
InpReport= 15 // Report publication interval, seconds - [=== Identity ===]
m_magic=22212064// Magic Number - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_12064" // TradeComment
// Pipsgrowth EX12064 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// GBP 9AM breakout strategy that places Buy Stop and Sell Stop pending orders at configurable distances from the 9AM London price. Cancels opposite order when one triggers. Includes close-hour management and daily reset logic. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
ON_INIT:
Create indicator handles: standard set
Initialize state variables
Detect broker GMT offset
ON_TICK:
1. Refresh indicator buffers (closed-bar shift=1)
2. Manage existing positions:
- Break-even check
- ATR trailing stop
- Profit lock ratchet
- Time-based exit
- Opposite-signal exit
3. If new bar:
a. ClassifyRegime() — ADX/ATR/BB regime detection
b. NoTradeGate() checks:
- Market open + session filter
- Spread limit
- Cooldown after loss
- Consecutive loss limit
- Kill switch
- Max drawdown
- Max concurrent positions
- Daily/weekly loss limits
c. GenerateSignal() — strategy-specific entry logic
d. CheckConfirm() — HTF alignment + R:R + ADX minimum
e. Calculate position size from risk %
f. Execute with retry logic
g. Mark bar to prevent duplicates
ON_TESTER:
Custom fitness = weighted(RecoveryFactor, ROI, ProfitFactor, TradeCount, Sharpe, Drawdown)Optimization Profile
How to Install This EA on MT5
- 1Download the .mq5 file using the button above
- 2Open MetaTrader 5 on your computer
- 3Click File → Open Data Folder in the top menu
- 4Navigate to MQL5 → Experts and paste the .mq5 file there
- 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
- 6Drag the EA onto a chart matching the recommended timeframe
- 7Configure parameters according to the table on this page
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| InpLots | 0.1 | Lots |
| InpLookPriceHour | 10 | Change for your time zone (my is +1 Hour). Should be 9AM London time |
| InpLookPriceMiin | 0 | Offset in minutes when to look on price |
| InpCloseHour | 18 | Close all orders after this hour |
| InpUseCloseHour | true | Set it to false to ignore Close Hour |
| InpTakeProfit | 40 | Buy Stop and Sell Stop: Take Profit (in pips) |
| InpDistanceBuy | 18 | Buy Stop: distance from current price (in pips) |
| InpDistanceSell | 22 | Sell Stop: distance from current price (in pips) |
| InpStopLossBuy | 22 | Buy Stop: Stop Loss (in pips) |
| InpStopLossSell | 18 | Sell Stop: Stop Loss (in pips) |
| InpReport | 15 | Report publication interval, seconds |
| m_magic | 22212064 | Magic Number |
| InpTradeComment | "Psgrowth.com Expert_12064" | Trade Comment |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12064 GBP9AM — 9AM London breakout with Buy/Sell Stop, full 12-layer stack."
//---
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
#include <Trade\DealInfo.mqh>
#include <Trade\OrderInfo.mqh>
CPositionInfo m_position; // trade position object
CTrade m_trade; // trading object
CSymbolInfo m_symbol; // symbol info object
CDealInfo m_deal; // deals object
COrderInfo m_order; // pending orders object
/*
Attach to GBPUSD chart. Timeframe is not important. System should put
trades on 9AM London time.
I looking for system automat wich will be trade for me this
9:00 GMT look for price GBP/USD
then price is 1.8230 example (bid)
Robot do for me order waiting position
long and short
open long 18pips+4pips spread at this price so will be
LONG 1.8252 profit 40pips stop 22pips
And short
open short 22pips-4pipsspread so
1.8230-22-4=1.8204
so 1.8204 short profit 40pips stop 18pips
AND MAJOR IF I OPEN LONG POSITION AUTOMAT CANCEL SHORT POSITION
This system work nice month week day ?
I will be glad if I see this in code
Version: Date: Comment:
--------------------------------
1.0 2005.10.16 First version according to the idea.
1.1 2005.10.17 Bug removed (closing active orders when fired at the
look hour and issuing new wrong pair of orders).
Added close hour, request of Movieweb.
1.2 2005.10.18 Bug removed (allowing more than one trades per day, e.g. 2005.07.20)
1.3 2005.10.19 Feature added: look_price_min.
*/
//--- input parameters
input group "=== Strategy ==="
input double InpLots = 0.1; // Lots
input int InpLookPriceHour = 10; // Change for your time zone (my is +1 Hour). Should be 9AM London time
input int InpLookPriceMiin = 0; // Offset in minutes when to look on price
input int InpCloseHour = 18; // Close all orders after this hour
input bool InpUseCloseHour = true; // Set it to false to ignore Close Hour
input ushort InpTakeProfit = 40; // Buy Stop and Sell Stop: Take Profit (in pips)
input ushort InpDistanceBuy = 18; // Buy Stop: distance from current price (in pips)
input ushort InpDistanceSell = 22; // Sell Stop: distance from current price (in pips)
input ushort InpStopLossBuy = 22; // Buy Stop: Stop Loss (in pips)
input ushort InpStopLossSell = 18; // Sell Stop: Stop Loss (in pips)Full source code available on download
Educational purposes only. Do NOT use with real money. Test on demo accounts only.
Clear Warning: Educational Purposes Only
Clear Warning: This Expert Advisor is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This does not constitute investment advice.
Recommended Brokers for This EA
These EAs run on MT5 — use a regulated broker with fast execution and tight spreads
Markets.com
Exness
IC Markets
Similar Expert Advisors
View All Expert AdvisorsMore Other strategy EAs from our library
Pipsgrowth EX01007 Adaptive
Pipsgrowth.com EX01007 Adaptive XAUUSD 5M — multi-indicator signal scorer with regime filter, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate, filling mode detection.
Pipsgrowth EX01019 Adaptive
Pipsgrowth.com EX01019 Self-Adaptive Market EA Fixed — multi-regime adaptive EA, full 12-layer stack.
Pipsgrowth EX15029 SMC-OrderBlock
Pipsgrowth.com EX15029 SMCBreakoutEA — SMC breakout CHOCH/liquidity sweep EA, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.