YazanPro Session Open Scalper
- Experts
-
Yazan Adnan Ramadan Ibrahim
Algorithmic trader and MQL5 developer based in Jordan. I build Expert Advisors for MetaTrader 5 focused on gold (XAUUSD) and major FX pairs: multi-module confluence systems, short-hold scalping tools and manual trade panels. Each product is tested in the Strategy Tester on real ticks with - Version: 1.0
- Activations: 10
YazanPro Session Open Scalper is a configurable Expert Advisor for traders who want to test one specific idea: trading the first minutes after a market session opens. At each scheduled open it waits for a tick with a normal spread, takes a small fixed target, and closes after a short time limit if the target is not reached.
Please read this first. With the default settings, this idea lost money in every backtest below that placed trades, including a one-year gold test. In a separate research study, none of 1,428 pre-set variants was profitable. The results are listed below under "Tested settings you can repeat". This product is a tool for testing and adjusting the session-open idea on your own broker's data. It is not a profitable system and it does not promise any result.
How it enters
The EA trades the symbol of the chart it is attached to. It first measures the symbol's normal spread, called Q: the median spread during the New York lunch hour (12:30-13:30 New York time, the Berlin lunch hour for the DAX) over the last 20 weekdays. It needs at least 5 such days in the last 30 calendar days; otherwise it skips that day.
At each enabled open it takes the first tick, after an optional waiting time, whose spread is at or below Gate x Q (Gate = 1.0 by default). The default direction is BUY. You can switch to SELL, or to FOLLOW or FADE a move of 2 x Q from the first price of the search. No new entry is made later than 30 minutes (input) after the open.
An entry is made only on the tick where the rule triggers. If the EA cannot act on that tick (terminal not running, switched OFF, news window, not enough margin, spread cap), it skips that open instead of entering late.
How it exits
Take profit is set at the target distance from the fill price (above for a buy, below for a sell): a 1.00 price move on gold, 2 x Q on other symbols, or a fixed number of points that you choose. A time stop closes the trade at market on the first tick at or after 5 minutes (input) from the fill. A stop loss in points is optional and off by default. A safety stop loss is placed on the server at 100 x the target distance (input; 0 turns it off). If both stops are set, the nearer one is used.
Entering again
After an exit it may enter again, up to 3 entries per open (input). It does so only while activity stays high: in the 3 minutes before the exit, both the ticks per minute and the average 1-minute range must be at least 1.5 x (input) the pre-open level. The pre-open level is the 10 minutes before the open, or the most recent earlier weekday's London 05:00-06:00 hour (up to 30 days back) if those 10 minutes had fewer than 20 ticks. The first failed check ends that open. Only one position is open at a time.
Which opens it trades (AUTO setting)
- Gold and silver (symbol names starting with XAUUSD, GOLD, XAGUSD or SILVER): daily reopen after the break (Tuesday-Friday), weekly open (Monday), Tokyo 09:00, London 08:00, New York 08:30 and 09:30.
- US indices (names starting with USTEC, US30, NAS100, US100, DJ30 or WS30): New York 08:30 and 09:30.
- DAX (names starting with DE40, GER40, DE30 or GER30): Frankfurt 09:00.
- Forex and every other symbol: London 08:00 and New York 08:30.
Each open can also be forced ON or OFF. Times are local city times with the US and EU summer-time rules, converted to your broker's server time. The EA works on ticks, not on chart bars, so the chart timeframe does not change its decisions.
Broker clock
The broker's GMT offset is detected automatically from the server time and your PC clock, and the result is printed in the Experts tab of the Toolbox at start. If your broker states a different offset, set it with the inputs "Broker server winter time" and "Broker server summer-time rule". The Strategy Tester assumes GMT+2 in winter with EU summer time.
The panel
A panel on the chart shows the rule in one line, the next open with a countdown (or the open in progress and the time left), Q and the current spread against the gate, activity against the pre-open level, the entries of the current open and why the EA is waiting or has stopped, the last result, and today's result of this EA in your account currency. A status line warns when entries are blocked (for example no account connected or broker clock unknown) and when Algo Trading is off while a position is open. The ON/OFF button stops new entries; an open position keeps its take profit and time stop. The panel is in English by default; an Arabic panel is optional.
Risk controls
The lot is fixed (0.01 by default), rounded down to the volume step and capped at the symbol maximum; if it is below the symbol minimum, the minimum is used and a message in the Experts tab says so. Before each order the EA checks free margin, the broker's stops level, the symbol's volume limit, the account's order limit and the symbol's trade mode. Stop changes also respect the freeze level. An optional maximum spread in points blocks entries at wider spreads.
An optional news filter skips entries within N minutes of high-impact events of the symbol's currencies from the MQL5 economic calendar. It works live only (the Strategy Tester has no calendar) and is off by default. Fridays and Mondays can be switched off.
Rejected orders are retried a limited number of times; after that the open is skipped. State is saved in terminal global variables, so after a restart the EA finds and manages its own open position. Only one chart per symbol and magic number can run it.
Account types
Hedging and netting accounts are supported. On a netting account it does not enter while any other position is open on the same symbol.
What it does not do
No martingale, no grid, no averaging, no lot increase after a loss and no pending orders. No DLLs and no web requests. It does not learn or change its rules by itself. The time stop is executed by the EA, so the terminal must stay running (a VPS is recommended); when the terminal is off, only the server-side take profit and stop loss protect an open position. There are no guaranteed results.
Support is provided through MQL5 private messages and the product comments.
Tested settings you can repeat
Default settings lost money in every test below that placed trades. A high share of winning trades did not make them profitable: the winners are small (the target), and the trades that miss the target and close on the time stop lose more.
A. Validation runs of this product (version 1.00, all inputs at default)
Common settings: Expert YP_Open_Market, server MetaQuotes-Demo, Modelling "1 minute OHLC", Execution without delay, initial deposit 10,000 USD (test e: 1 USD), leverage 1:100, lot 0.01, all other inputs at default.
Test a: EURUSD H1, 2026.06.01-2026.10.01, 119 trades, 79.83% winning trades, net -1.21 USD, profit factor 0.80, max equity drawdown 1.99 USD (0.02%).
Test b: XAUUSD D1, 2025.10.01-2026.10.01, 1,187 trades, 79.36% winning trades, net -325.11 USD, profit factor 0.74, max equity drawdown 366.37 USD (3.66%).
Test c: GBPUSD M30, 2026.06.01-2026.10.01, 119 trades, 76.47% winning trades, net -6.71 USD, profit factor 0.49, max equity drawdown 6.92 USD (0.07%).
Test d: EURUSD M1, 2026.09.01-2026.10.01, 32 trades, 87.50% winning trades, net -0.38 USD, profit factor 0.60, max equity drawdown 0.76 USD (0.01%).
Test e: EURUSD H1, deposit 1 USD, 2026.09.01-2026.10.01, 0 trades, net 0.00 USD.
Each test: Strategy Tester backtest, hypothetical, not real trading. "1 minute OHLC" builds ticks from bars and is less accurate than real ticks for this tick-based EA; its ticks carry each bar's spread, which is usually the lowest spread of that minute, so these runs are likely to understate costs. Use real ticks to judge it.
In test b (gold, one year) the gross profit was 933.52 USD and the gross loss was 1,258.63 USD; the largest winning trade was 1.00 USD and the largest losing trade was 36.95 USD. In test e the margin check skipped every entry because 1 USD does not cover the margin for 0.01 lot.
B. Same rule on real ticks (developer's earlier build)
XAUUSD M1, 2025.11.01-2026.10.30, Modelling "Every tick based on real ticks", deposit 1,000 USD, leverage 1:100, lot 0.01, the same rule inputs as this product's defaults except the news filter input, which was 30 minutes. Result: 1,273 trades, 75.96% winning trades, net -297.13 USD, profit factor 0.79, max equity drawdown 348.41 USD (33.33%), all four quarters negative.
Strategy Tester backtest, hypothetical, not real trading. It was run with the developer's earlier build of the same entry and exit rule, so this product will give similar but not identical numbers. To repeat it with this product, use the same settings and choose "Every tick based on real ticks". Note that this product ignores the news filter in the Strategy Tester, so that run will also include the opens the news filter skipped.
C. Research study behind the product
Before the EA was built, the idea was tested in a historical tick simulation on 8 symbols (XAUUSD, XAGUSD, USTEC, US30, DE40, EURUSD, GBPUSD, USDJPY) using recorded bid and ask ticks, filling on the next tick, with slippage of 10 points on gold and half the normal spread elsewhere, and no commission.
- 1,428 variants were fixed in advance (direction, target, stop, time stop, spread gate, waiting time, repeats). On the training years none reached a profit factor of 1.2, and none was profitable even with zero slippage.
- On the hold-out period 2025-11-01 to 2026-10-29, all 16 runs (the variant chosen on the training years and the default rule on each symbol) lost money, with profit factors from 0.17 to 0.68.
- Gold, default rule, hold-out: 1,458 entries, 74.6% winning trades, profit factor 0.61, net -700 USD per 0.01 lot, no quarter positive.
Historical simulation, hypothetical, not real trading.
Disclaimer for all results above
Hypothetical or simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Since the trades have not been executed, the results may have under- or over-compensated for the impact of certain market factors, such as lack of liquidity, slippage and broker execution. Simulated trading programs are also designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
Inputs
The name in the first column is what you see in the Inputs tab.
General
Input | Default | Meaning
News filter: skip an open if high-impact news ... (InpNewsMinutes) | 0 | Skip entries within plus or minus N minutes of high-impact MQL5 calendar events of the symbol's currencies. Live only. 0 = off.
Skip Fridays (InpSkipFriday) | OFF: trading allowed | ON = no new entries on Fridays.
Skip Mondays (InpSkipMonday) | OFF: trading allowed | ON = no new entries on Mondays.
Lot per entry (InpFixedLot) | 0.01 | Fixed lot, rounded down to the volume step, at least the symbol minimum.
Magic number (InpMagic) | 26104001 | Identifies this EA's trades.
Panel language (InpArabic) | false | false = English, true = Arabic.
Broker server winter time, hours from GMT (InpServerGMT) | 99 | 99 = auto-detect. Otherwise the broker's winter offset, -14 to 14. The Strategy Tester assumes GMT+2.
Broker server summer-time rule (InpServerDST) | European summer time | European, US, or no summer time.
Write a CSV trade log (InpLogCsv) | false | Writes a trade log to MQL5\Files\YP_Open.
Entry rule
Input | Default | Meaning
Direction (InpDirection) | BUY on the first low-spread tick | BUY, SELL, FOLLOW a 2xQ move, or FADE a 2xQ move.
Entry gate (InpGateQ) | 1.0 | Enter only when the spread is at or below this x Q (Q = median New York lunch spread of the last 20 weekdays).
Minutes to wait after the open (InpWaitMin) | 0 | Delay before the first entry. Must be smaller than the window.
Target in points (InpTargetPts) | 0 | 0 = auto: a 1.00 price move on gold, 2 x Q elsewhere.
Stop loss in points (InpStopPts) | 0 | 0 = none (the safety stop still applies).
Time stop (InpTimeStopMin) | 5 | Close at market on the first tick at or after N minutes from the fill.
Maximum entries per open (InpMaxPresses) | 3 | Upper limit of entries in one open.
Enter again only while activity ... (InpActivityMult) | 1.5 | Ticks per minute and 1-minute range of the last 3 minutes must both be at least this x the pre-open level.
No new entry at or after open + N minutes (InpWindowMin) | 30 | Length of the entry window.
Safety
Input | Default | Meaning
Safety stop loss on the server (InpSafetySL_X) | 100 | Stop loss at N x the target distance from the fill. 0 = off. The nearer of this and the rule stop is used.
Maximum spread in points (InpMaxSpreadPts) | 0 | Block entries above this spread. 0 = off.
Opens (AUTO = the default set for this symbol)
Each input can be AUTO (default for this symbol), ON or OFF. All default to AUTO.
Input | AUTO trades it on
Daily reopen after the break, Tue-Fri (InpOpenReopen) | gold, silver
Weekly open, Monday's first tick (InpOpenWeekly) | gold, silver
Tokyo 09:00 (InpOpenTokyo) | gold, silver
London 08:00 (InpOpenLondon) | gold, silver, forex and any other symbol
New York 08:30 (InpOpenNY0830) | every symbol except the DAX
New York 09:30 (InpOpenNY0930) | gold, silver, US indices
Frankfurt 09:00 (InpOpenEU0900) | DAX
Journal
Input | Default | Meaning
Print each day's open times in the journal (InpPrintOpens) | false | Clock check: prints the day's open times and Q.
Quick start
- Before buying, run the demo version in your Strategy Tester with the settings above, preferably with "Every tick based on real ticks".
- Open a chart of the symbol on a demo account. Any timeframe works.
- Attach the EA, keep the defaults or set your lot, and turn on Algo Trading.
- Read the clock line in the Experts tab of the Toolbox. If your broker states another GMT offset, set "Broker server winter time" and "Broker server summer-time rule".
- Check the panel. "Q: computing" means it is still reading history. "Q: warm-up" means fewer than 5 New York lunch-hour days are available yet, and that day is skipped.
- Watch the panel at the next open: the countdown, the spread against the gate and the activity line.
- Use the ON/OFF button to stop new entries at any time. An open position keeps its take profit and time stop.
Recommended use
Use it on a demo account first, run it on a VPS so the time stop is always executed, and test any change of inputs in the Strategy Tester with real ticks before using it on a live account. Keep the lot small. Treat it as a research tool for the session-open idea.
FAQ
Does it guarantee profit?
No. With the default settings it lost money in every backtest on this page that placed trades. Past or simulated results do not guarantee future results.
Does it use martingale, grid or averaging?
No. It uses a fixed lot, market orders only, and one position at a time.
Which symbols and timeframes can I use?
Any symbol your broker allows you to trade. Gold, silver, US indices and the DAX get their own default opens; every other symbol trades London 08:00 and New York 08:30. The timeframe does not matter because the EA works on ticks.
Does it work on netting accounts?
Yes. On a netting account it does not enter while another position is open on the same symbol.
Why did it not trade today?
The panel shows the reason. Common ones: Q warm-up (fewer than 5 New York lunch-hour days of history), spread above the gate during the whole window, not enough free margin, Algo Trading off, a news window, Friday or Monday switched off, or the rule triggered while the EA was not running, in which case that open is skipped.
Does the terminal need to stay on?
Yes. The time stop is executed by the EA. The take profit and the safety stop are on the server, so they work when the terminal is off.
Can I run it on several symbols?
Yes, one chart per symbol. A second chart with the same symbol and magic number will not start.
How do I check the broker clock?
At start the EA prints the detected offset in the Experts tab of the Toolbox. Turn on "Print each day's open times in the journal" to see each day's open times in server time, also in the Experts tab.
Trading foreign exchange, metals and indices on margin carries a high level of risk and may not be suitable for all investors. You can lose some or all of your deposit. This Expert Advisor lost money with its default settings in every backtest shown on this page that placed trades, and short-term scalping is very sensitive to spread, slippage, commission and execution speed, which differ between brokers and accounts. Hypothetical results do not represent real trading. Test on a demo account first, use only money you can afford to lose, and make your own decisions; nothing on this page is investment advice.
