# Simple technique to recognize BREAKOUT and RETEST pattern with market noise

I have develop and EA which trades breakout and retest of price level.

Resume how the EA works:

Requirements:

- The EA know by user input which price level to trade

Conditions to trade (logic on 15 min candle):

- 1. Breakout: valid if price breaks the price level and closes 3 candles above price level.

- 2. Retest: valid if price comes back, touches price level but closes above.

- 3. Buy Candle Pattern: if breakout and retest valid, the EA waits for a buy candle pattern to finaly set the trade.

MY PROBLEM:

All my conditions are bases on candle information,see code:

This conditions expect a very clean breakout and retest pattern. But reality is that there are a lot of market noise.

After testing this EA several month I notice that having conditions base on candles are a suboptimal approach, because there will allways be a market situation where with is not regonise by the logic I have.

I need a technique/indicador/approach with wich I can determinate my breakout and retest pattern with market noises.

Check Resistance:

```void checkBreakOutResistance()
{
MqlRates breakOutBars[];
ArraySetAsSeries(breakOutBars, true);
CopyRates(_Symbol, EntryCandlePeriod, 0, 4, breakOutBars);
double O1 = breakOutBars[3].open;
double C1 = breakOutBars[3].close;
double O2 = breakOutBars[2].open;
double C2 = breakOutBars[2].close;
double O3 = breakOutBars[1].open;
double C3 = breakOutBars[1].close;

if(O1 < Resistance && C1 > Resistance && O2 > Resistance && C2 > Resistance && O3 > Resistance && C3 > Resistance)
{
BreakOutResistance = true;
}
}```

Check Retest

```   double O1=NormalizeDouble(iOpen(_Symbol,EntryCandlePeriod,2),_Digits);
double H1=NormalizeDouble(iHigh(_Symbol,EntryCandlePeriod,2),_Digits);
double L1=NormalizeDouble(iLow(_Symbol,EntryCandlePeriod,2),_Digits);
double C1=NormalizeDouble(iClose(_Symbol,EntryCandlePeriod,2),_Digits);
//---- Candle2 OHLC
double O2=NormalizeDouble(iOpen(_Symbol,EntryCandlePeriod,1),_Digits);
double H2=NormalizeDouble(iHigh(_Symbol,EntryCandlePeriod,1),_Digits);
double L2=NormalizeDouble(iLow(_Symbol,EntryCandlePeriod,1),_Digits);
double C2=NormalizeDouble(iClose(_Symbol,EntryCandlePeriod,1),_Digits);
//---- Candle3 OHLC - MOST RECENT CANDLE or CURRENTLY FORMIN CANDLE
double O3=NormalizeDouble(iOpen(_Symbol,EntryCandlePeriod,0),_Digits);
double H3=NormalizeDouble(iHigh(_Symbol,EntryCandlePeriod,0),_Digits);
double L3=NormalizeDouble(iLow(_Symbol,EntryCandlePeriod,0),_Digits);
double C3=NormalizeDouble(iClose(_Symbol,EntryCandlePeriod,0),_Digits);

if(O2 > (Resistance + RetestRange) && L2 <= (Resistance + RetestRange) && C2 > Resistance)
{
hitResistance=1;
return;
}```

Check Candle Pattern

```   if(hitResistance==1 && C1 > O1 && C2 > O2 && C2 > C1 && C1 > Resistance && C2 > Resistance)
{
tradeBuy();
}```

dsmanyp:

I have develop and EA which trades breakout and retest of price level.

Resume how the EA works:

Requirements:

- The EA know by user input which price level to trade

Conditions to trade (logic on 15 min candle):

- 1. Breakout: valid if price breaks the price level and closes 3 candles above price level.

- 2. Retest: valid if price comes back, touches price level but closes above.

- 3. Buy Candle Pattern: if breakout and retest valid, the EA waits for a buy candle pattern to finaly set the trade.

MY PROBLEM:

All my conditions are bases on candle information,see code:

This conditions expect a very clean breakout and retest pattern. But reality is that there are a lot of market noise.

After testing this EA several month I notice that having conditions base on candles are a suboptimal approach, because there will allways be a market situation where with is not regonise by the logic I have.

I need a technique/indicador/approach with wich I can determinate my breakout and retest pattern with market noises.

Check Resistance:

Check Retest

Check Candle Pattern

Instead of invent every thing new would it be not possible to use an existing breakout EA like
daily HL EA
fibonacci V1
hiloBars EA
horizontal break V1.1
Il Outbreak EA
level_trading 123 EA
LondonBreakout EA

WHERE they are already dealing with BO from levels, or  parallel channel, or Asian/London open or close price Box, from Pivot etc... all are with source code and they also dealing already with the pending order sending matter, like limit, SL, TP; type of Broker digits, ECN STP etc

Now if you could implement your method and technically improve those EA with your way of "break and retest'"  technique, to improve the odd that the breakout we intend to trade we dont have got a fake breakout, that would it be great code

Hope you will have soon success, not being a programmer I have searched and  waited for the break and retest for a long time ...

there is one more tips, there is a scanner for fibo pivot level where the check near, bounced off the level already implemented, with source code available, if you need to clarify some coding tricks
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
• www.mql5.com
Calculations of technical indicators require price values and/or values of volumes, on which calculations will be performed. There are 7 predefined identifiers from the ENUM_APPLIED_PRICE enumeration, used to specify the desired price base for calculations. If a technical indicator uses for calculations price data, type of which is set by...

dsmanyp:

I have develop and EA which trades breakout and retest of price level.

Resume how the EA works:

Requirements:

- The EA know by user input which price level to trade

Conditions to trade (logic on 15 min candle):

- 1. Breakout: valid if price breaks the price level and closes 3 candles above price level.

- 2. Retest: valid if price comes back, touches price level but closes above.

- 3. Buy Candle Pattern: if breakout and retest valid, the EA waits for a buy candle pattern to finaly set the trade.

MY PROBLEM:

All my conditions are bases on candle information,see code:

This conditions expect a very clean breakout and retest pattern. But reality is that there are a lot of market noise.

After testing this EA several month I notice that having conditions base on candles are a suboptimal approach, because there will allways be a market situation where with is not regonise by the logic I have.

I need a technique/indicador/approach with wich I can determinate my breakout and retest pattern with market noises.

Check Resistance:

Check Retest

Check Candle Pattern

Nice code! I am using Python for my statistical analysis but your code for the retest and bounce is helpful.

One question though, why take up memory with ohlc(3) in retest check? It is not used in the code you show...

IT's a TURNCOAT on SHVED SUPPLY and DEMAND. SOURCE CODE IS AVAILABLE

dsmanyp: I need a technique/indicador/approach with wich I can determinate my breakout and retest pattern with market noises.

Until you can state your requirements in concrete terms, it can not be coded.