Requirement specification: Breakout EA
Expert Advisor to be coded for Metatrader in MQL4 language
Timeframe to be used
Magic number: [magic number]
Buffer: [number of buffer pips]
SL multiplier: [a factor determining the SL size]
TP multiplier: [a factor determining the TP size]
Fixed lots: [True/false]
Lot size: [lot size to be used if fixed lots = true]
Risk percent: [maximum capital at risk per trade]
Friday close hour: [the hour that open trades done by the EA should be closed]
Find the first 4H candle if the week (it appears when selecting ctrl+y in Metatrader)
Save the High value (H) and the Low value (L) from this candle.
When this candle has closed:
Open a Long position at H + Buffer value (defined in parameters)
Set SL to: L value
Set TP to: H + Buffer value + (H-L)* TP multiplier
Open a Short position at L – Buffer value (defined in parameters)
Set SL to: H value
Set TP to: L - Buffer value - (H-L)* TP multiplier
Trades will be closed either when TP or SL is hit. If trades are open on Friday, they should be closed on the Friday close hour (user defined with parameter)
Only one Long trade and one Short trade per week and chart can be opened. Pending orders should be deleted by the end of the week.
This is a first simple EA that I would like to have coded. Successful completion of this project can result in similar but larger projects in the future.