Time & Range Based Pending Order EA – Specification

MQL5 Experts

Job finished

Execution time 5 minutes
Feedback from customer
The developer was highly professional and efficient throughout the project. His availability and dedication to delivering quality work were impressive. Overall, a great experience

Specification

Time & Range Based Pending Order EA – Specification

The EA is purely time-based and range-based.

It should work on any timeframe chart (M1 recommended), but all logic is based on broker server time.

Trading Session

First pending order of the day is at 02:00 server time.

Then every 30 minutes a new set of pending orders is created: 02:00, 02:30, 03:00, 03:30, … up to 21:30.

After 21:30 no new orders are created; the next cycle starts the following day.

Range Definition

For each slot time T (e.g. 02:00, 02:30, 03:00, …):

Define a 1-hour lookback range:

range_start = T - 60 minutes

range_end = T

Use all candles between range_start and range_end (inclusive of the last bar before/at T).

Calculate:

RangeHigh = highest high in this interval

RangeLow = lowest low in this interval

Order Placement at Each Slot

Exactly at time T the EA places two pending orders:

Buy Stop at RangeHigh

Sell Stop at RangeLow

Both orders:

Same lot size (from input)

Same SL and TP distance (from input)

With a unique Magic Number (from input) so the EA only manages its own orders.

Must respect a MaxSpread filter (from input); if spread is above MaxSpread at time T, skip that slot.

Order Expiration

Each pair of pending orders must have an expiry time:

expire_time = T + 55 minutes

If neither pending order is triggered before expire_time, both are automatically deleted or expire.

Example:

Slot 02:00 → Range 01:00–02:00 → orders expire at 02:55.

Slot 02:30 → Range 01:30–02:30 → orders expire at 03:25.

Slot 03:00 → Range 02:00–03:00 → orders expire at 03:55, and so on.

Overlap

It is allowed for multiple sets of pending orders to be active at the same time (e.g. 02:00 and 02:30 slots overlapping).

Each order should have a Comment or Magic-based identifier so we know which slot it belongs to (optional but useful).



Optional: allowed trading days (e.g. Monday–Friday only).

Notes

Open trades are managed only by their SL and TP (no forced daily close unless we add another input later).

EA must avoid placing duplicate orders for the same slot time T (e.g. use a global/static variable or check existing orders by Comment / Magic).

Please make each of the 39 time-slots individually configurable using input bool UseTrade1..UseTrade39 and separate time parameters (RangeStartN, EntryHourN, EntryMinuteN, ExpireTimeN). If UseTradeN == false, the EA should completely skip that slot and never calculate its range or place its pending orders.

input

datetime LicenseTime      = D'31.12.2024 23:59'; 
  int Account_Number        = 0;
  string EAComment          = "Breakout Strategy";  
input int    MN                 = 1;      // Magic
input double Lot                = 0.01;   // Lot
input double MaxSpread          = 10;     // Max. Spread        
input int    Slippage           = 1;      // Slippage
input string TrailingStopLoss   = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>";// Trailing Stop Settings ...............................................
input bool   UseTrailingStop    = 0;      // Use Trailing 
input double TrailingStart     = 15;     // Trailing Start 
input double TrailingStop       = 10;     // Trailing Distance

//--- Trade 1 settings
input bool   UseTrade1        = true;      // Enable/Disable Trade 1
input string RangeStart1      = "01:00";   // Range start time (HH:MM)
input int    EntryHour1       = 2;         // Entry hour
input int    EntryMinute1     = 0;         // Entry minute
input string ExpireTime1      = "02:55";   // Expiry time (HH:MM)

//--- Trade 2 settings
input bool   UseTrade2        = true;      // Enable/Disable Trade 2
input string RangeStart2      = "01:30";   // Range start time (HH:MM)
input int    EntryHour2       = 2;         // Entry hour
input int    EntryMinute2     = 30;        // Entry minute
input string ExpireTime2      = "03:25";   // Expiry time (HH:MM)

//--- Trade 3 settings
input bool   UseTrade3        = true;      // Enable/Disable Trade 3
input string RangeStart3      = "02:00";   // Range start time (HH:MM)
input int    EntryHour3       = 3;         // Entry hour
input int    EntryMinute3     = 0;         // Entry minute
input string ExpireTime3      = "03:55";   // Expiry time (HH:MM)

//--- Trade 4 settings
input bool   UseTrade4        = true;      // Enable/Disable Trade 4
input string RangeStart4      = "02:30";   // Range start time (HH:MM)
input int    EntryHour4       = 3;         // Entry hour
input int    EntryMinute4     = 30;        // Entry minute
input string ExpireTime4      = "04:25";   // Expiry time (HH:MM)

//--- Trade 5 settings
input bool   UseTrade5        = true;      // Enable/Disable Trade 5
input string RangeStart5      = "03:00";   // Range start time (HH:MM)
input int    EntryHour5       = 4;         // Entry hour
input int    EntryMinute5     = 0;         // Entry minute
input string ExpireTime5      = "04:55";   // Expiry time (HH:MM)

//--- Trade 6 settings
input bool   UseTrade6        = true;      // Enable/Disable Trade 6
input string RangeStart6      = "03:30";   // Range start time (HH:MM)
input int    EntryHour6       = 4;         // Entry hour
input int    EntryMinute6     = 30;        // Entry minute
input string ExpireTime6      = "05:25";   // Expiry time (HH:MM)

//--- Trade 7 settings
input bool   UseTrade7        = true;      // Enable/Disable Trade 7
input string RangeStart7      = "04:00";   // Range start time (HH:MM)
input int    EntryHour7       = 5;         // Entry hour
input int    EntryMinute7     = 0;         // Entry minute
input string ExpireTime7      = "05:55";   // Expiry time (HH:MM)

//--- Trade 8 settings
input bool   UseTrade8        = true;      // Enable/Disable Trade 8
input string RangeStart8      = "04:30";   // Range start time (HH:MM)
input int    EntryHour8       = 5;         // Entry hour
input int    EntryMinute8     = 30;        // Entry minute
input string ExpireTime8      = "06:25";   // Expiry time (HH:MM)

//--- Trade 9 settings
input bool   UseTrade9        = true;      // Enable/Disable Trade 9
input string RangeStart9      = "05:00";   // Range start time (HH:MM)
input int    EntryHour9       = 6;         // Entry hour
input int    EntryMinute9     = 0;         // Entry minute
input string ExpireTime9      = "06:55";   // Expiry time (HH:MM)

//--- Trade 10 settings
input bool   UseTrade10       = true;      // Enable/Disable Trade 10
input string RangeStart10     = "05:30";   // Range start time (HH:MM)
input int    EntryHour10      = 6;         // Entry hour
input int    EntryMinute10    = 30;        // Entry minute
input string ExpireTime10     = "07:25";   // Expiry time (HH:MM)

//--- Trade 11 settings
input bool   UseTrade11       = true;      // Enable/Disable Trade 11
input string RangeStart11     = "06:00";   // Range start time (HH:MM)
input int    EntryHour11      = 7;         // Entry hour
input int    EntryMinute11    = 0;         // Entry minute
input string ExpireTime11     = "07:55";   // Expiry time (HH:MM)

//--- Trade 12 settings
input bool   UseTrade12       = true;      // Enable/Disable Trade 12
input string RangeStart12     = "06:30";   // Range start time (HH:MM)
input int    EntryHour12      = 7;         // Entry hour
input int    EntryMinute12    = 30;        // Entry minute
input string ExpireTime12     = "08:25";   // Expiry time (HH:MM)

//--- Trade 13 settings
input bool   UseTrade13       = true;      // Enable/Disable Trade 13
input string RangeStart13     = "07:00";   // Range start time (HH:MM)
input int    EntryHour13      = 8;         // Entry hour
input int    EntryMinute13    = 0;         // Entry minute
input string ExpireTime13     = "08:55";   // Expiry time (HH:MM)

//--- Trade 14 settings
input bool   UseTrade14       = true;      // Enable/Disable Trade 14
input string RangeStart14     = "07:30";   // Range start time (HH:MM)
input int    EntryHour14      = 8;         // Entry hour
input int    EntryMinute14    = 30;        // Entry minute
input string ExpireTime14     = "09:25";   // Expiry time (HH:MM)

//--- Trade 15 settings
input bool   UseTrade15       = true;      // Enable/Disable Trade 15
input string RangeStart15     = "08:00";   // Range start time (HH:MM)
input int    EntryHour15      = 9;         // Entry hour
input int    EntryMinute15    = 0;         // Entry minute
input string ExpireTime15     = "09:55";   // Expiry time (HH:MM)

//--- Trade 16 settings
input bool   UseTrade16       = true;      // Enable/Disable Trade 16
input string RangeStart16     = "08:30";   // Range start time (HH:MM)
input int    EntryHour16      = 9;         // Entry hour
input int    EntryMinute16    = 30;        // Entry minute
input string ExpireTime16     = "10:25";   // Expiry time (HH:MM)

//--- Trade 17 settings
input bool   UseTrade17       = true;      // Enable/Disable Trade 17
input string RangeStart17     = "09:00";   // Range start time (HH:MM)
input int    EntryHour17      = 10;        // Entry hour
input int    EntryMinute17    = 0;         // Entry minute
input string ExpireTime17     = "10:55";   // Expiry time (HH:MM)

//--- Trade 18 settings
input bool   UseTrade18       = true;      // Enable/Disable Trade 18
input string RangeStart18     = "09:30";   // Range start time (HH:MM)
input int    EntryHour18      = 10;        // Entry hour
input int    EntryMinute18    = 30;        // Entry minute
input string ExpireTime18     = "11:25";   // Expiry time (HH:MM)

//--- Trade 19 settings
input bool   UseTrade19       = true;      // Enable/Disable Trade 19
input string RangeStart19     = "10:00";   // Range start time (HH:MM)
input int    EntryHour19      = 11;        // Entry hour
input int    EntryMinute19    = 0;         // Entry minute
input string ExpireTime19     = "11:55";   // Expiry time (HH:MM)

//--- Trade 20 settings
input bool   UseTrade20       = true;      // Enable/Disable Trade 20
input string RangeStart20     = "10:30";   // Range start time (HH:MM)
input int    EntryHour20      = 11;        // Entry hour
input int    EntryMinute20    = 30;        // Entry minute
input string ExpireTime20     = "12:25";   // Expiry time (HH:MM)

//--- Trade 21 settings
input bool   UseTrade21       = true;      // Enable/Disable Trade 21
input string RangeStart21     = "11:00";   // Range start time (HH:MM)
input int    EntryHour21      = 12;        // Entry hour
input int    EntryMinute21    = 0;         // Entry minute
input string ExpireTime21     = "12:55";   // Expiry time (HH:MM)

//--- Trade 22 settings
input bool   UseTrade22       = true;      // Enable/Disable Trade 22
input string RangeStart22     = "11:30";   // Range start time (HH:MM)
input int    EntryHour22      = 12;        // Entry hour
input int    EntryMinute22    = 30;        // Entry minute
input string ExpireTime22     = "13:25";   // Expiry time (HH:MM)

//--- Trade 23 settings
input bool   UseTrade23       = true;      // Enable/Disable Trade 23
input string RangeStart23     = "12:00";   // Range start time (HH:MM)
input int    EntryHour23      = 13;        // Entry hour
input int    EntryMinute23    = 0;         // Entry minute
input string ExpireTime23     = "13:55";   // Expiry time (HH:MM)

//--- Trade 24 settings
input bool   UseTrade24       = true;      // Enable/Disable Trade 24
input string RangeStart24     = "12:30";   // Range start time (HH:MM)
input int    EntryHour24      = 13;        // Entry hour
input int    EntryMinute24    = 30;        // Entry minute
input string ExpireTime24     = "14:25";   // Expiry time (HH:MM)

//--- Trade 25 settings
input bool   UseTrade25       = true;      // Enable/Disable Trade 25
input string RangeStart25     = "13:00";   // Range start time (HH:MM)
input int    EntryHour25      = 14;        // Entry hour
input int    EntryMinute25    = 0;         // Entry minute
input string ExpireTime25     = "14:55";   // Expiry time (HH:MM)

//--- Trade 26 settings
input bool   UseTrade26       = true;      // Enable/Disable Trade 26
input string RangeStart26     = "13:30";   // Range start time (HH:MM)
input int    EntryHour26      = 14;        // Entry hour
input int    EntryMinute26    = 30;        // Entry minute
input string ExpireTime26     = "15:25";   // Expiry time (HH:MM)

//--- Trade 27 settings
input bool   UseTrade27       = true;      // Enable/Disable Trade 27
input string RangeStart27     = "14:00";   // Range start time (HH:MM)
input int    EntryHour27      = 15;        // Entry hour
input int    EntryMinute27    = 0;         // Entry minute
input string ExpireTime27     = "15:55";   // Expiry time (HH:MM)

//--- Trade 28 settings
input bool   UseTrade28       = true;      // Enable/Disable Trade 28
input string RangeStart28     = "14:30";   // Range start time (HH:MM)
input int    EntryHour28      = 15;        // Entry hour
input int    EntryMinute28    = 30;        // Entry minute
input string ExpireTime28     = "16:25";   // Expiry time (HH:MM)

//--- Trade 29 settings
input bool   UseTrade29       = true;      // Enable/Disable Trade 29
input string RangeStart29     = "15:00";   // Range start time (HH:MM)
input int    EntryHour29      = 16;        // Entry hour
input int    EntryMinute29    = 0;         // Entry minute
input string ExpireTime29     = "16:55";   // Expiry time (HH:MM)

//--- Trade 30 settings
input bool   UseTrade30       = true;      // Enable/Disable Trade 30
input string RangeStart30     = "15:30";   // Range start time (HH:MM)
input int    EntryHour30      = 16;        // Entry hour
input int    EntryMinute30    = 30;        // Entry minute
input string ExpireTime30     = "17:25";   // Expiry time (HH:MM)

//--- Trade 31 settings
input bool   UseTrade31       = true;      // Enable/Disable Trade 31
input string RangeStart31     = "16:00";   // Range start time (HH:MM)
input int    EntryHour31      = 17;        // Entry hour
input int    EntryMinute31    = 0;         // Entry minute
input string ExpireTime31     = "17:55";   // Expiry time (HH:MM)

//--- Trade 32 settings
input bool   UseTrade32       = true;      // Enable/Disable Trade 32
input string RangeStart32     = "16:30";   // Range start time (HH:MM)
input int    EntryHour32      = 17;        // Entry hour
input int    EntryMinute32    = 30;        // Entry minute
input string ExpireTime32     = "18:25";   // Expiry time (HH:MM)

//--- Trade 33 settings
input bool   UseTrade33       = true;      // Enable/Disable Trade 33
input string RangeStart33     = "17:00";   // Range start time (HH:MM)
input int    EntryHour33      = 18;        // Entry hour
input int    EntryMinute33    = 0;         // Entry minute
input string ExpireTime33     = "18:55";   // Expiry time (HH:MM)

//--- Trade 34 settings
input bool   UseTrade34       = true;      // Enable/Disable Trade 34
input string RangeStart34     = "17:30";   // Range start time (HH:MM)
input int    EntryHour34      = 18;        // Entry hour
input int    EntryMinute34    = 30;        // Entry minute
input string ExpireTime34     = "19:25";   // Expiry time (HH:MM)

//--- Trade 35 settings
input bool   UseTrade35       = true;      // Enable/Disable Trade 35
input string RangeStart35     = "18:00";   // Range start time (HH:MM)
input int    EntryHour35      = 19;        // Entry hour
input int    EntryMinute35    = 0;         // Entry minute
input string ExpireTime35     = "19:55";   // Expiry time (HH:MM)

//--- Trade 36 settings
input bool   UseTrade36       = true;      // Enable/Disable Trade 36
input string RangeStart36     = "18:30";   // Range start time (HH:MM)
input int    EntryHour36      = 19;        // Entry hour
input int    EntryMinute36    = 30;        // Entry minute
input string ExpireTime36     = "20:25";   // Expiry time (HH:MM)

//--- Trade 37 settings
input bool   UseTrade37       = true;      // Enable/Disable Trade 37
input string RangeStart37     = "19:00";   // Range start time (HH:MM)
input int    EntryHour37      = 20;        // Entry hour
input int    EntryMinute37    = 0;         // Entry minute
input string ExpireTime37     = "20:55";   // Expiry time (HH:MM)

//--- Trade 38 settings
input bool   UseTrade38       = true;      // Enable/Disable Trade 38
input string RangeStart38     = "19:30";   // Range start time (HH:MM)
input int    EntryHour38      = 20;        // Entry hour
input int    EntryMinute38    = 30;        // Entry minute
input string ExpireTime38     = "21:25";   // Expiry time (HH:MM)

//--- Trade 39 settings
input bool   UseTrade39       = true;      // Enable/Disable Trade 39
input string RangeStart39     = "20:00";   // Range start time (HH:MM)
input int    EntryHour39      = 21;        // Entry hour
input int    EntryMinute39    = 0;         // Entry minute
input string ExpireTime39     = "21:55";   // Expiry time (HH:MM)


Responded

1
Developer 1
Rating
(15)
Projects
19
16%
Arbitration
5
40% / 40%
Overdue
0
Free
2
Developer 2
Rating
(60)
Projects
87
29%
Arbitration
24
13% / 58%
Overdue
7
8%
Working
3
Developer 3
Rating
(627)
Projects
989
47%
Arbitration
33
36% / 36%
Overdue
98
10%
Working
Published: 6 codes
4
Developer 4
Rating
(328)
Projects
510
19%
Arbitration
33
45% / 30%
Overdue
34
7%
Loaded
5
Developer 5
Rating
(432)
Projects
632
53%
Arbitration
32
53% / 22%
Overdue
6
1%
Loaded
6
Developer 6
Rating
(215)
Projects
367
32%
Arbitration
34
41% / 29%
Overdue
108
29%
Working
Published: 1 code
7
Developer 7
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
8
Developer 8
Rating
(142)
Projects
151
41%
Arbitration
3
33% / 33%
Overdue
1
1%
Working
9
Developer 9
Rating
(104)
Projects
169
24%
Arbitration
23
9% / 78%
Overdue
16
9%
Working
10
Developer 10
Rating
(4)
Projects
5
40%
Arbitration
1
0% / 0%
Overdue
0
Free
11
Developer 11
Rating
Projects
2
0%
Arbitration
4
25% / 50%
Overdue
1
50%
Free
12
Developer 12
Rating
(12)
Projects
9
33%
Arbitration
11
0% / 100%
Overdue
2
22%
Free
13
Developer 13
Rating
(80)
Projects
138
51%
Arbitration
5
80% / 0%
Overdue
6
4%
Working
14
Developer 14
Rating
(16)
Projects
20
10%
Arbitration
8
38% / 38%
Overdue
3
15%
Working
15
Developer 15
Rating
(57)
Projects
89
43%
Arbitration
4
0% / 100%
Overdue
3
3%
Working
16
Developer 16
Rating
(163)
Projects
236
32%
Arbitration
30
27% / 30%
Overdue
26
11%
Free
17
Developer 17
Rating
(635)
Projects
856
48%
Arbitration
29
38% / 17%
Overdue
63
7%
Free
18
Developer 18
Rating
(509)
Projects
977
74%
Arbitration
27
19% / 67%
Overdue
101
10%
Free
Published: 1 article, 6 codes
19
Developer 19
Rating
(162)
Projects
287
34%
Arbitration
18
22% / 61%
Overdue
42
15%
Working
20
Developer 20
Rating
(296)
Projects
475
40%
Arbitration
105
40% / 24%
Overdue
80
17%
Busy
Published: 2 codes
21
Developer 21
Rating
(77)
Projects
243
74%
Arbitration
7
100% / 0%
Overdue
1
0%
Free
Published: 1 article
22
Developer 22
Rating
(10)
Projects
19
42%
Arbitration
6
0% / 50%
Overdue
3
16%
Working
23
Developer 23
Rating
(187)
Projects
243
20%
Arbitration
22
50% / 18%
Overdue
0
Working
24
Developer 24
Rating
(6)
Projects
5
0%
Arbitration
2
50% / 50%
Overdue
2
40%
Free
25
Developer 25
Rating
(4)
Projects
5
20%
Arbitration
1
100% / 0%
Overdue
0
Free
26
Developer 26
Rating
(64)
Projects
144
46%
Arbitration
19
42% / 16%
Overdue
32
22%
Free
27
Developer 27
Rating
(271)
Projects
553
50%
Arbitration
57
40% / 37%
Overdue
227
41%
Working
28
Developer 28
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free
29
Developer 29
Rating
Projects
1
100%
Arbitration
0
Overdue
0
Free
Similar orders
I need an MT5 Expert Advisor built as a high-precision volumizer for Forex. Its core purpose is to generate controlled trading volume for rebates, while still maintaining low-risk account growth. I am not looking for aggressive profit chasing. I am looking for a stable, intelligent EA that can produce volume in a disciplined way without damaging the account. The ideal system should trade major currency pairs, avoid
1. IF price forms: - Higher highs + higher lows → TREND = BUY - Lower highs + lower lows → TREND = SELL ELSE → NO TRADE 2. IF: - Trend = BUY - Price retraces to support zone - Bullish engulfing candle forms - TDI green crosses above red (optional) THEN: - Execute BUY 3. IF: - Trend = SELL - Price retraces to resistance - Bearish engulfing forms - TDI confirms THEN: - Execute SELL 4. Risk per trade = 1% of account Lot
I need a high frequency trading robot for gold in one or 5 minute timeframe the robot should have spread filter where it should only open trades below a set spread should have news filter to allow trading during fundal news or not the robot should have input in number of minutes to close all open trades and remove pending orders before fundamental news as part of news filter. It should also have the number of minutes
Hello! I want to programm EA that uses volume profile indicator, but I am not sure if this is possible. Only experienced programmers please, I will not select a programmer who did only few jobs. Before starting I need to make sure you understand everything and that this is for sure technically possible
Hello, I am looking for a professional trading system including: 1- Trading Bot (Expert Advisor): - Good profit performance - High security and strong risk management - Works efficiently during high market volatility (news and strong movements) - Works on all pairs (Forex + Gold) 2- Signal Indicator: - Provides clear Buy and Sell signals - Includes Take Profit and Stop Loss - No repaint (signals must not change or
Hi, I’m looking for a top-tier, profit-optimized EA that has the potential to scale trading returns significantly. My goal is to maximize growth over time. Can you help develop a bespoke EA that could potentially scale to high six or seven figures
Max amount grid 30+ USD
max amount grid step for magic number do keep deleting .only when it is in negative floating .but when it is profit allow to go over the max and replays to grid step
Apply with a screen of your work . Symbol Specific Logic . Live Chart Optimization Check the Core logic . [back tests as well] Change points to pips . Create buffer for the zone
I will pay 3000+ USD (negotiable) for an EA for existing MT5 that generates a minimum of 15-20% or higher a month consistently (provide source code after final deal) Looking for a highly profitable EA Please send demo version directly subject (Buying profitable EA Budget up to $ 3000 USD), past results and optimal settings so I can test, if it performs in a strategy tester i will also need option to forward test it

Project information

Budget
30+ USD