Specification
Based on zulufx_HHLHLLHL indi
cator and below requirements, converting it into an EA.
(Please see all files: https://drive.google.com/drive/folders/1WNy2nmFqLmOIQk3TCZEUuokWduuwJ6tM?usp=sharing)
Input:
1. CallBackRatioLowerBound(CBlb): (Default=0.2)
2. CallBackRatioUpperBound(CBub): (Default=0.9)
3. SL(SLxx): in pip (Default=0)
4. TP(TPxx): in pip (Default=0)
5. TREnable: True or False - True if turn on trailing stop function
6. TRStart: Trailing Start (pip) x - the trailing stop can only be activated only if the market reaches x pips in profit
7. TRStop: Trailing Stop (pip) y - set SL at (CurrentPrice-y or CurrentPrice+y) after trailing start is activated and delete all other SL
8. CloseOrderTimeEnable: True or False - True if turn on closing all orders function
9. CloseOrderTime: time (23:59) - close all open orders at specific time
10. RestrictedTradingTime(RTT): time (integer:0-23) - e.g. if value=0,1,2,3 then cannot open order during 0:00 to 3:59
11. LotSizeFactor(LSF): (1 to 100) (Default=1)
Rule 1:
Find LL-HH-HL Pattern (see the attached chart)->
-> between LL-HH: no HL, LL
-> between HH-HL: no LH, HH
-> between HL-BT: no HL, LL
Open Buy Order when:
-> if current time is not in RTT
-> upward break through BT(Order Open Price = the close price of the candle that breaking through BT)
-> CallBackRatio: (HH-LL)/(HH-HL) >= CBlb and (HH-LL)/(HH-HL) <= CBub
Set SL at: Mininum(LL,OrderOpenPrice-SLxx)
Set TP at: OrderOpenPrice+TPxx if TPxx is provided
Rule 2:
Find LL-LH-HL Pattern (see the attached chart)
-> between LL-LH: no HL, LL
-> between LH-HL: no LH, HH
-> between HL-BT: no HL, LL
Open Buy Order when:
-> if current time is not in RTT
-> upward break through BT(Order Open Price = the close price of the candle that breaking through BT)
-> CallBackRatio: (LH-LL)/(LH-HL) >= CBlb and (LH-LL)/(LH-HL) <= CBub
Set SL at: Mininum(LL,OrderOpenPrice-SLxx)
Set TP at: OrderOpenPrice+TPxx if TPxx is provided
Rule 3:
Find HH-LL-LH Pattern (see the attached chart)
-> between HH-LL: no LH, HH
-> between LL-LH: no HL, LL
-> between LH-BT: no LH, HH
Open Sell Order when:
-> if current time is not in RTT
-> upward break through BT (Order Open Price = the close price of the candle that breaking through BT)
-> CallBackRatio: (HH-LL)/(LH-LL) >= CBlb and (HH-LL)/(LH-LL) <= CBub
Set SL at: Maximum(HH,OrderOpenPrice+SLxx)
Set TP at: OrderOpenPrice+TPxx if TPxx is provided
Rule 4:
Find HH-HL-LH (see the attached chart)
-> between HH-HL: no LH, HH
-> between HL-LH: no HL, LL
-> between LH-BT: no LH, HH
Open Sell Order when:
-> if current time is not in RTT
-> upward break through BT (Order Open Price = the close price of the candle that breaking through BT)
-> CallBackRatio: (HH-HL)/(LH-HL) >= CBlb and (HH-HL)/(LH-H0L) <= CBub
Set SL at: Maximum(HH,OrderOpenPrice+SLxx)
Set TP at: OrderOpenPrice+TPxx if TPxx is provided
Notes:
*Above mentioned HH,LL,HL,LH are assumed the close price of that candle
*Lot size of new open order = account balance * 0.000165 * LSF
*This EA can attach on all symbol, timeframe and offline chart
*Draw a box when pattern occur (see the attached charts)
*Fail Safe checking:
-
check if order is created successfully
-
check if order is closing successfully
-
check if order is modified successfully
-
check if order is opening in opposite direction of existing order