EA for MT4 (Rules are described in detail)

2018.06.17 Experten

Spezifikation

Hi everyone,

I need an Ea for MT4. The definitons and rules are below.


Options that I need,

  • Hidden SL and TP also orders. An Options to set this to true and false. False means not hidden! (For backtest purposes)
  • Trading session and news filter
  • Moneymanagement + FIX TP and SL also the variant written under "Exit rules" below

If you have own ideas and questions feel free to contact me!


Definitions

Take note of the following since I’ll be using them constantly when explaining the rules of the system.


  • HHHL – Higher Highs, Higher Lows candlestick pattern
  • LHLL – Lower Highs, Lower Lows candlestick pattern
  • IB – Inside Bar candlestick pattern
  • ATRH – 120-period average true range on 1H chart
  • SBar – Signal Bar or candle
  • Bar1 – the previous candlestick; the candle to the left of the signal bar
  • Bar2 – the candle previous to Bar1
  • Bar3 – the candle previous to Bar2; you get the idea…
  • SL – stop loss level
  • TP – target profit level
  • SW – small win; instead of getting out of a profitable trade at breakeven, we get out with a small win
  • SWT – small win trigger, price level the pair needs to reach before you can move your SL to SW
  • P1 – this is simply a 1-pip filter for our entries
  • RSL – reduced stop loss; basically just reduces risk by half
  • RSLT – reduced stop loss trigger;  price level when you can move your SL to RSL

Entry Rules for Long Positions

Long Entry: Type A1

  • If an LHLL Patterns Forms
  • And if all LOWS of the 12 candles prior to the SBar are higher than SBar LOW
  • And if (Bar1 HIGH – SBar Low) =< (1.5 *ATRH)
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 6 hours after SBar formed, then cancel the order
  • Moreover, if a new LHLL pattern forms after the previous one, and the SBar LOW of the new pattern is lower than SBar LOW of the original LHLL pattern, and the existing buy stop order hasn’t been triggered yet, then reset everything based on the newer LHLL pattern

Long Entry: Type A2

  • If an LHLL Patterns Forms
  • And if all LOWS of the 12 candles prior to the SBar are higher than SBar LOW
  • And if (Bar1 HIGH – SBar Low) > (1.5 *ATRH)
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 3 hours after SBar formed, then cancel the order
  • Moreover, if a new LHLL pattern forms after the previous one, and the SBar LOW of the new pattern is lower than SBar LOW of the original LHLL pattern, and the existing buy stop order hasn’t been triggered yet, then reset everything based on the newer LHLL pattern

Long Entry: Type A3

  • If an LHLL Patterns Forms
  • And if not all LOWS of the 12 candles prior to the SBar are higher than SBar LOW
  • And if all LOWS of the 4 candles prior to the SBar are higher than SBar LOW
  • And if (Bar2 Low > Bar1 Low > Sbar Low) is TRUE
  • And if (Bar2 High > Bar1 High > Sbar High) is TRUE
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 6 hours after SBar formed, then cancel the order
  • Moreover, if a new LHLL pattern forms after the previous one, and the SBar LOW of the new pattern is lower than SBar LOW of the original LHLL pattern, and the existing buy stop order hasn’t been triggered yet, then reset everything based on the newer LHLL pattern

Long Entry: Type A4

  • If an LHLL Patterns Forms
  • And if not all LOWS of the 12 candles prior to the SBar are higher than SBar LOW
  • And if all LOWS of the 4 candles prior to the SBar are higher than SBar LOW
  • And if (Bar2 Low > Bar1 Low > Sbar Low) is FALSE
  • And if (Bar2 High > Bar1 High > Sbar High) is FALSE
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 4 hours after SBar formed, then cancel the order
  • Moreover, if a new LHLL pattern forms after the previous one, and the SBar LOW of the new pattern is lower than SBar LOW of the original LHLL pattern, and the existing buy stop order hasn’t been triggered yet, then reset everything based on the newer LHLL pattern

Long Entry: Type A5

  • If an LHLL Patterns Forms
  • And if not all LOWS of the 12 candles prior to the SBar are higher than SBar LOW
  • And if not all LOWS of the 4 candles prior to the SBar are higher than SBar LOW
  • And if (Bar1 HIGH – SBar Low) =< (1.5 *ATRH)
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 2 hours after SBar formed, then cancel the order

Long Entry: Type B1

  • If an IB Patterns Forms
  • And if (Bar2 Low > Bar 1 Low) is TRUE
  • And if (Bar2 High > Bar 1 High) is TRUE
  • And if all LOWS of the 4 candles prior to Bar1 are higher than Bar1 LOW
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 4 hours after SBar formed, then cancel the order

Long Entry: Type B2

  • If an IB Patterns Forms
  • And if (Bar2 Low > Bar 1 Low) is FALSE
  • And if (Bar2 High > Bar 1 High) is FALSE
  • And if (Bar1 OPEN > Bar 1 CLOSE) is TRUE
  • Then set buy stop order @ Bar1 HIGH + P1 + spread
  • However, if buy stop order is not triggered 1 hour after SBar formed, then cancel the order

Entry Rules for Short Positions

Short Entry: Type A1

  • If an HHHL Patterns Forms
  • And if all HIGHS of the 12 candles prior to the SBar are lower than SBar HIGH
  • And if (SBar HIGH – Bar1 Low) =< (1.5 *ATRH)
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 6 hours after SBar formed, then cancel the order
  • Moreover, if a new HHHL pattern forms after the previous one, and the SBar HIGH of the new pattern is higher than SBar HIGH of the original HHHL pattern, and the existing sell stop order hasn’t been triggered yet, then reset everything based on the newer HHHL pattern

Short Entry: Type A2

  • If an HHHL Patterns Forms
  • And if all HIGHS of the 12 candles prior to the SBar are lower than SBar HIGH
  • And if (SBar HIGH – Bar1 Low) > (1.5 *ATRH)
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 3 hours after SBar formed, then cancel the order
  • Moreover, if a new HHHL pattern forms after the previous one, and the SBar HIGH of the new pattern is higher than SBar HIGH of the original HHHL pattern, and the existing sell stop order hasn’t been triggered yet, then reset everything based on the newer HHHL pattern

Short Entry: Type A3

  • If an HHHL Patterns Forms
  • And if not all HIGHS of the 12 candles prior to the SBar are lower than SBar 
  • HIGH
  • And if all HIGHS of the 4 candles prior to the SBar are lower than SBar HIGH
  • And if (Bar2 Low < Bar1 Low < Sbar Low) is TRUE
  • And if (Bar2 High < Bar1 High < Sbar High) is TRUE
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 6 hours after SBar formed, then cancel the order
  • Moreover, if a new HHHL pattern forms after the previous one, and the SBar HIGH of the new pattern is higher than SBar HIGH of the original HHHL pattern, and the existing sell stop order hasn’t been triggered yet, then reset everything based on the newer HHHL pattern

Short Entry: Type A4

  • If an HHHL Patterns Forms
  • And if not all HIGHS of the 12 candles prior to the SBar are lower than SBar HIGH
  • And if all HIGHS of the 4 candles prior to the SBar are lower than SBar HIGH
  • And if (Bar2 Low < Bar1 Low < Sbar Low) is FALSE
  • And if (Bar2 High < Bar1 High < Sbar High) is FALSE
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 4 hours after SBar formed, then cancel the order
  • Moreover, if a new HHHL pattern forms after the previous one, and the SBar HIGH of the new pattern is higher than SBar HIGH of the original HHHL pattern, and the existing sell stop order hasn’t been triggered yet, then reset everything based on the newer HHHL pattern

Short Entry: Type A5

  • If an HHHL Patterns Forms
  • And if not all HIGHS of the 12 candles prior to the SBar are lower than SBar HIGH
  • And if not all HIGHS of the 4 candles prior to the SBar are lower than SBar HIGH
  • And if (SBar HIGH – Bar1 Low) =< (1.5 *ATRH)
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 2 hours after SBar formed, then cancel the order

Short Entry: Type B1

  • If an IB Patterns Forms
  • And if (Bar2 Low < Bar 1 Low) is TRUE
  • And if (Bar2 High < Bar 1 High) is TRUE
  • And if all HIGHS of the 4 candles prior to Bar1 are lower than Bar1 HIGH
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 4 hours after SBar formed, then cancel the order

Short Entry: Type B2

  • If an IB Patterns Forms
  • And if (Bar2 Low < Bar 1 Low) is FALSE
  • And if (Bar2 High < Bar 1 High) is FALSE
  • And if (Bar1 OPEN < Bar 1 CLOSE) is TRUE
  • Then set sell stop order @ Bar1 LOW – P1
  • However, if sell stop order is not triggered 1 hour after SBar formed, then cancel the order

-----------------------------------

Exit Rules (Trailing Variant)

If going Long

Make sure to set the following initially:

  • Then set SL @ Entry – spread – P1 – (ATRH x 1.3)

If trade is triggered and price moves up, you must reduce your risk by moving your SL to RSL as soon as possible.

  • RSL @ Entry – spread – P1 – ((ATRH x 1.3) x 0.5)

And you can only move SL to RSL if either of two conditions are met.

  • The first condition is that RSLT is hit.
  • RSLT @ Entry – spread – P1 + ATRH
  • The second condition is that three consecutive candles form with higher highs and higher lows after SBar forms.

With regard to the second condition, if it’s impossible to move SL to RSL because the third candle closed below entry and too close to SL, then you can only move SL to RSL once there’s a subsequent candle that closes above entry.

Once SL has been moved to RSL, and if price continues moving higher, move your SL to SW if SWT is hit.

  • SWT @ TP – (ATRH x 0.2)
  • SW @ Entry + (ATRH x 0.2)

If price continues moving higher still, wait until price moves higher past TP.

  • TP @ Entry – spread – P1+ (ATRH x 1.9)

If price goes above TP, then the trailing rules kick in. You can only move your SL every time there’s an HHHL pattern

  • If a new HHHL pattern forms, set new SL @ Bar1 Low of the new HHHL pattern less (ATRH x 0.2)
  • However, if  the range of the SBar (SBar High – SBar Low) is greater than or equal to (2 x ATRH), then SL = Sbar Low of the HHHL pattern less (ATRH x 0.2)

If going short:

Make sure to set the following initially:

  • Then set SL @ Entry + spread + P1 + (ATRH x 1.3)

If trade is triggered and price moves up, you must reduce your risk by moving your SL to RSL as soon as possible.

  • RSL @ Entry + spread + P1 + ((ATRH x 1.3) x 0.5)

And you can only move SL to RSL if either of two conditions are met.

  • The first condition is that RSLT is hit.
  • RSLT @ Entry + spread + P1 – ATRH
  • The second condition is that three consecutive candles form with lower highs and lower lows after SBar forms.

With regard to the second condition, if it’s impossible to move SL to RSL because the third candle closed above entry and too close to SL, then you can only move SL to RSL once there’s a subsequent candle that closes below entry.

Once SL has been moved to RSL, and if price continues moving lower, move your SL to SW if SWT is hit.

  • SWT @ TP + (ATRH x 0.2)
  • SW @ Entry – (ATRH x 0.2)

If price continues moving lower still, wait until price moves lower past TP.

  • TP @ Entry + spread + P1 – (ATRH x 1.9)

If price goes below TP, then the trailing rules kick in. You can only move your SL every time there’s an LHLL pattern

  • If a new LHLL pattern forms, then set the new SL @ Bar1 High of the LHLL pattern plus (ATRH x 0.2)
  • However, if  the range of the SBar (SBar High – SBar Low) is greater than or equal to (2 x ATRH), then SL = Sbar High of the HHHL pattern plus (ATRH x 0.2)

-----------------------------------

Exit Rules (Fixed TP)

If going long:

Make sure to set the following initially:

  • Set TP @ Entry – spread – P1+ (ATRH x 1.9)
  • Then set SL @ Entry – spread – P1 – (ATRH x 1.3)

If trade is triggered and price moves up, you must reduce your risk by moving your SL to RSL as soon as possible.

  • RSL @ Entry – spread – P1 – ((ATRH x 1.3) x 0.5)

And you can only move SL to RSL if either of two conditions are met.

  • The first condition is that RSLT is hit.
  • RSLT @ Entry – spread – P1 + ATRH
  • The second condition is that three consecutive candles form with higher highs and higher lows after SBar forms.

With regard to the second condition, if it’s impossible to move SL to RSL because the third candle closed below entry and too close to SL, then you can only move SL to RSL once there’s a subsequent candle that closes above entry.

Once SL has been moved to RSL, and if price continues moving higher, move your SL to SW if SWT is hit.

  • SWT @ TP – (ATRH x 0.2)
  • SW @ Entry + (ATRH x 0.2)

If going short:

Make sure to set the following initially:

  • Set TP @ Entry + spread + P1 – (ATRH x 1.9)
  • Then set SL @ Entry + spread + P1 + (ATRH x 1.3)

If trade is triggered and price moves up, you must reduce your risk by moving your SL to RSL as soon as possible.

  • RSL @ Entry + spread + P1 + ((ATRH x 1.3) x 0.5)

And you can only move SL to RSL if either of two conditions are met.

  • The first condition is that RSLT is hit.
  • RSLT @ Entry + spread + P1 – ATRH
  • The second condition is that three consecutive candles form with lower highs and lower lows after SBar forms.

With regard to the second condition, if it’s impossible to move SL to RSL because the third candle closed above entry and too close to SL, then you can only move SL to RSL once there’s a subsequent candle that closes below entry.

Once SL has been moved to RSL, and if price continues moving lower, move your SL to SW if SWT is hit.

  • SWT @ TP + (ATRH x 0.2)
  • SW @ Entry – (ATRH x 0.2)

Bewerbungen

1
Entwickler 1
2018.06.17
Bewertung
4.96
(1311)
Projekte
1665
62%
Schlichtung
57
37% / 16%
Frist nicht eingehalten
509
31%
Beschäftigt
2
Entwickler 2
2018.06.18
Bewertung
4.71
(163)
Projekte
291
42%
Schlichtung
115
16% / 41%
Frist nicht eingehalten
125
43%
Überlastet
3
Entwickler 3
2018.06.18
Bewertung
4.95
(19)
Projekte
23
22%
Schlichtung
15
0% / 53%
Frist nicht eingehalten
10
43%
Überlastet

Projektdetails

Budget
50 - 200 USD