Tâche terminée
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Spécifications
Attention: I need the Source Code. This order is only valid if the Source Code File(s) are included.
Name of the EA: "WeekdaySeason"
The EA has to trade fixed time blocks (time periods) per week.
Four (4) time blocks (Block1,Block2,Block3,Block4) can be defined with appropriate input parameters.
For each time block we need the input parameters as listed here for Block1:
parametername: Block1Action type: String values: {"Flat" "Long" "Short"} default: "Flat"
parametername: Block1DayIndex type: Integer values: {1 2 3 4 5} default: 1
parametername: Block1StartHour type: Integer values: {0 1 2 3 ... 22 23} default: 15
parametername: Block1StartMinute type: Integer values: {0 1 2 3 ... 58 59} default: 35
parametername: Block1EndHour type: Integer values: {0 1 2 3 ... 22 23} default: 21
parametername: Block1EndMinute type: Integer values: {0 1 2 3 ... 58 59} default: 55
We need this set of parameters for each of the remaining time blocks Block2, Block3,Block4.
Therefore we will have 6 * 4 = 24 input parameters in total for the definition of the four blocks.
Trading Logik:
Example. Assume the input parameters for Block1 and BLock2 are set to the following values:
Block1Action value: "Long"
Block1DayIndex value: 2
Block1StartHour value: 14
Block1StartMinute value: 30
Block1EndHour value: 16
Block1EndMinute value: 35
Block2Action value: "Short"
Block2DayIndex value: 5
Block2StartHour value: 10
Block2StartMinute value: 15
Block2EndHour value: 21
Block2EndMinute value: 59
Block3Action value:"Flat"
.....
Block4Action value:"Flat"
Explanation:
The Block1Action is set to "Long", the EA has to place long trades. (The default value "Flat" means the whole block is not used. No trade for that block).
The Block1DayIndex is set to 2. The weekday of the block is Tuesday. (1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday , 5 = Friday)
The Time when the trade has to be opened is 14:30 (SERVERTIME) as defined by Block1StartHour and Block1StartMinute.
The Time when the trade has to be closed is 16:35 (SERVERTIME) as defined by Block1EndHour and Block1EndMinute.
Therefore for Block1 the EA has to open a Long trade each Tuesday at 14:30 and close the trade at 16:35. (SERVERTIME)
The Block2Action is set to "Short, the EA has to place short trades.
The Block2DayIndex is set to 5. The weekday of the block is Friday.
The Time when the trade has to be opened is 10:15 (SERVERTIME) as defined by Block2StartHour and Block2StartMinute.
The Time when the trade has to be closed is 21:59 (SERVERTIME) as defined by Block2EndHour and Block2EndMinute.
Therefore the EA for Block2 has to open a Short trade each Friday at 10:15 and close the trade at 21:59. (SERVERTIME)
Block3 and Block4 have the BlockAction set to "Flat", so they are not in use.
Orders:
All trades are openend and closed using market orders.
When the StartTime has come to open a trade or the EndTime has come to close a trade the corresponding market order has to be submitted quickly within a few seconds,
at least within 30 seconds. Thus the EA must not rely on a certain timeframe and wait for Bar Closes. It must work both in the M15 and H1 timeframe.
Lot size:
The fixed Lotsize can be set with an input parameter:
parametername: Lotsize type: Integer default: 1