# Candle Pattern Logic - Base libary

285

Hi is there a spot here on mql4 where I can access candle pattern logic similar to the why I have identified some candle patterns in my previous code writing efforts:
```double O=(Open[1]);
double O1=(Open[2]);
double O2=(Open[3]);
double H=(High[1]);
double H1=(High[2]);
double H2=(High[3]);
double L=(Low[1]);
double L1=(Low[2]);
double L2=(Low[3]);
double C=(Close[1]);
double C1=(Close[2]);
double C2=(Close[3]);
//---
//Bullish Patterns
double BullishEngulfing=((O1>C1) && (C>O) && (C>=O1) && (C1>=O) && ((C-O)>(O1-C1)));
double BullishHarami=((O1>C1) && (C>O) && (C<=O1) && (C1<=O) && ((C-O)<(O1-C1)));
//Bearish Patterns
double BearishEngulfing=((C1>O1) && (O>C) && (O>=C1) && (O1>=C) && ((O-C)>(C1-O1)));
double BearishHarami=((C1>O1) && (O>C) && (O<=C1) && (O1<=C) && ((O-C)<(C1-O1)));```
2842

If you are asking if MetaTrader analyses or detects candle patterns, then the answer is "No". It is up to the coder to develop his own methods, whether that be in an Indicator, which can then be checked via "iCustom()" or coded directly in the EA logic.

If you are asking if there is a list of candle patterns here on the forum, then I would suggest you do a search and see, but I doubt that such a list exists. There might be a "Code Base" submission of an Indicator or EA that does detect various patterns, but you will have to do a search and see what is available.

5454

mickeyferrari:
Hi is there a spot here on mql4 where I can access candle pattern logic similar to the why I have identified some candle patterns in my previous code writing efforts:

2842

Your link is for MQL5 code, not MQL4! Besides, the OP needs to learn to use the search facility himself instead of relying on the goodwill of forum members to do his research for him.
5454

FMIC:
Your link is for MQL5 code, not MQL4! Besides, the OP needs to learn to use the search facility himself instead of relying on the goodwill of forum members to do his research for him.

Apologies for the invalid link earlier, my link gave both MQL4 code and MQL5 results

As you can see it's not totally trivial to search for code here and get the right link due to the two code base sections being resident in the same site (MQL5.com)

https://www.mql5.com/en/search#!keyword=candle%20pattern&module=all_mql4_modules&source=mql4

Due to the ambiguity of the search pages I think it is appropriate to give newer users a link to the search pages.

2842

jamescater:

Apologies for the invalid link earlier, my link gave both MQL4 code and MQL5 results

As you can see it's not totally trivial to search for code here and get the right link due to the two code base sections being resident in the same site (MQL5.com)

https://www.mql5.com/en/search#!keyword=candle%20pattern&module=all_mql4_modules&source=mql4

Due to the ambiguity of the search pages I think it is appropriate to give newer users a link to the search pages.

OK! Point taken!