Job finished
Specification
Hi,
i need a simple Break Out Expert Advisor.
With the following settings.
Logic
The EA is executed on the 1 minute time frame.
The time period DailyBoxStartTime to DailyBoxEndTime is scanned to Identify the candle range highest and lowest values (wicks included).
At session start time a pending Buy Stop order is placed at the highest value and a pending Sell Stop is placed at the lowest value of the DailyBoxTime High and low range. If an EntryBuffer value greater than 0 is entered the pending order will be placed further away from the DailyBoxTime High and low by the entered pip value.
Within the SessionStartTime if market price activates the buy or sell pending order it is activated with set SL and TP. The opposite pending order that is not hit is deleted. The trade will continue until SL or TP is met or CloseAllTradesBy is reached.
If market price does not activate any pending order by SessionStopTime all pending orders are deleted and the EA session is over for the day.
If a value greater than 0 is entered into MoveSLToBEWhenPipsInProfitBy then once this pip amount is reached in an open trade the SL will be moved to entry.
User Settings
DailyBoxStartTime_(HH:MM:SS) – 08:00:00 (beginning of breakout range zone)
DailyBoxEndTime_(HH:MM:SS) – 09:59:50 (end of breakout range zone)
SessionStartTime_(HH:MM:SS) – 10:00:05 (pending order execution beginning)
SessionStopTime_(HH:MM:SS) – 10:20:00 (un-executed pending orders deleted, EA will not execute new trade until next new fresh day session)
EntryBuffer_Pips – 200 (add/subtract pips from breakout range so that pending order is located slightly further from range). Can be set to zero for no buffer.
SendAsMarketIfDiffSmallerThan_Pips – 50 (i’m not sure technically what this means but one EA I use has it, Perhaps a pending order wont get executed if price is right close to entry when set? But I understand it sends as market order if difference between entry price and bid/ask is smaller than) Your feedback and experience welcomed here.
TradingDaysActive_(Mon1/Tues2/Wed3/Thu4/Fri5/Sat6/Sun7) – 1,2,3,4,5 (EA will only operate on entered days, if a public holiday is on Wednesday for the working week I would enter 1,2,4,5 so that Wednesday is not traded) Or if you can enter the days instead of numbers even better!
CloseAllTradesBy_(HH:MM) – 14:00(Any open trade not hitting TP or SL by this time will be closed)
SL_Pips – 6500
TP_Pips – 6500
MoveSLToBEWhenPipsInProfitBy_Pips – 700 (If set to 0 SL will not be moved in Trade)
LotSize – 300 (Typically I will trade 1-700 Lots, high lots in Japanese currency, low lots in GBP)
Notes
Only 1 pending order executed in the SessionTime, the first pending order that is triggered i.e. buy or sell but not both, the other pending order is deleted when the first is executed. EA will not set any further pending orders or execute any further trades until SessionStartTime is reached for the next fresh trading day.
Display
Top Left of chart screen, display History of last 2 closed trades from EA date and time stamped:
19/05/21 10:05:32 Sell 6.00 P/L 6.54 GBP
20/05/21 10:03:24 Buy 6.00 P/L -7.23 GBP
Display: ‘Trading Enable: ON’ if in SessionStart/StopTime i.e. orders can be placed by EA
Display: ‘Trading Enable: OFF’ if outside of SessionStart/StopTime i.e. orders cannot be executed by EA
The EA should calculate in a fixed time the highest and the lowest price. On the basis of the given settings there should placed a buy and sell stop. (As you can see in the attached picture)
My broker is 5digibroker MQL4
Many thanks