Time & Range Based Pending Order EA – Specification

MQL5 Experts

Tâche terminée

Temps d'exécution 5 minutes
Commentaires du client
The developer was highly professional and efficient throughout the project. His availability and dedication to delivering quality work were impressive. Overall, a great experience

Spécifications

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)


Répondu

1
Développeur 1
Évaluation
(15)
Projets
19
16%
Arbitrage
5
40% / 40%
En retard
0
Gratuit
2
Développeur 2
Évaluation
(60)
Projets
87
29%
Arbitrage
24
13% / 58%
En retard
7
8%
Travail
3
Développeur 3
Évaluation
(627)
Projets
989
47%
Arbitrage
33
36% / 36%
En retard
98
10%
Travail
Publié : 6 codes
4
Développeur 4
Évaluation
(328)
Projets
510
19%
Arbitrage
33
45% / 30%
En retard
34
7%
Chargé
5
Développeur 5
Évaluation
(432)
Projets
632
53%
Arbitrage
32
53% / 22%
En retard
6
1%
Chargé
6
Développeur 6
Évaluation
(215)
Projets
367
32%
Arbitrage
34
41% / 29%
En retard
108
29%
Travail
Publié : 1 code
7
Développeur 7
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
8
Développeur 8
Évaluation
(142)
Projets
151
41%
Arbitrage
3
33% / 33%
En retard
1
1%
Travail
9
Développeur 9
Évaluation
(104)
Projets
169
24%
Arbitrage
23
9% / 78%
En retard
16
9%
Travail
10
Développeur 10
Évaluation
(4)
Projets
5
40%
Arbitrage
1
0% / 0%
En retard
0
Gratuit
11
Développeur 11
Évaluation
Projets
2
0%
Arbitrage
4
25% / 50%
En retard
1
50%
Gratuit
12
Développeur 12
Évaluation
(12)
Projets
9
33%
Arbitrage
11
0% / 100%
En retard
2
22%
Gratuit
13
Développeur 13
Évaluation
(80)
Projets
138
51%
Arbitrage
5
80% / 0%
En retard
6
4%
Travail
14
Développeur 14
Évaluation
(16)
Projets
20
10%
Arbitrage
8
38% / 38%
En retard
3
15%
Travail
15
Développeur 15
Évaluation
(57)
Projets
89
43%
Arbitrage
4
0% / 100%
En retard
3
3%
Travail
16
Développeur 16
Évaluation
(163)
Projets
236
32%
Arbitrage
30
27% / 30%
En retard
26
11%
Gratuit
17
Développeur 17
Évaluation
(635)
Projets
856
48%
Arbitrage
29
38% / 17%
En retard
63
7%
Gratuit
18
Développeur 18
Évaluation
(509)
Projets
977
74%
Arbitrage
27
19% / 67%
En retard
101
10%
Gratuit
Publié : 1 article, 6 codes
19
Développeur 19
Évaluation
(162)
Projets
287
34%
Arbitrage
18
22% / 61%
En retard
42
15%
Travail
20
Développeur 20
Évaluation
(296)
Projets
475
40%
Arbitrage
105
40% / 24%
En retard
80
17%
Occupé
Publié : 2 codes
21
Développeur 21
Évaluation
(77)
Projets
243
74%
Arbitrage
7
100% / 0%
En retard
1
0%
Gratuit
Publié : 1 article
22
Développeur 22
Évaluation
(10)
Projets
19
42%
Arbitrage
6
0% / 50%
En retard
3
16%
Travail
23
Développeur 23
Évaluation
(187)
Projets
243
20%
Arbitrage
22
50% / 18%
En retard
0
Travail
24
Développeur 24
Évaluation
(6)
Projets
5
0%
Arbitrage
2
50% / 50%
En retard
2
40%
Gratuit
25
Développeur 25
Évaluation
(4)
Projets
5
20%
Arbitrage
1
100% / 0%
En retard
0
Gratuit
26
Développeur 26
Évaluation
(64)
Projets
144
46%
Arbitrage
19
42% / 16%
En retard
32
22%
Gratuit
27
Développeur 27
Évaluation
(271)
Projets
553
50%
Arbitrage
57
40% / 37%
En retard
227
41%
Travail
28
Développeur 28
Évaluation
(574)
Projets
945
47%
Arbitrage
309
58% / 27%
En retard
125
13%
Gratuit
29
Développeur 29
Évaluation
Projets
1
100%
Arbitrage
0
En retard
0
Gratuit
Commandes similaires
SMC ORDER BLOCK 30 - 60 USD
I want already build FULLY AUTOMATED order block MT5 XAUUSD HTF H4 ENTRY LTF M15 - Show result on live account. m15 ob entry in the direction of h4 ob bias the developper to provide source code in the end
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

Informations sur le projet

Budget
30+ USD