# Candlestick Patterns

79

I've been playing with some code to create a custom indicator on MT4 that shows candlestick patterns but I'm not sure it is working properly... here is the logic

if(doji==true && iOpen(NULL,0,i)==iClose(NULL,0,i)){   // Doji
IND[i]=iHigh(NULL,0,i)+(200*Point);
}
if(harami==true && iOpen(NULL,0,i+1)>iClose(NULL,0,i+1)   // Harami
&& iOpen(NULL,0,i)<iClose(NULL,0,i)
&& iHigh(NULL,0,i)<iOpen(NULL,0,i+1)
&& iLow(NULL,0,i)>iClose(NULL,0,i+1)
){
IND[i]=iHigh(NULL,0,i)+(200*Point);
}
if(harami==true && iOpen(NULL,0,i+1)<iClose(NULL,0,i+1)   // Harami
&& iOpen(NULL,0,i)>iClose(NULL,0,i)
&& iHigh(NULL,0,i)<iClose(NULL,0,i+1)
&& iLow(NULL,0,i)>iOpen(NULL,0,i+1)
){
IND[i]=iHigh(NULL,0,i)+(200*Point);
}
if(dragonfly==true && iOpen(NULL,0,i)==iClose(NULL,0,i)     // Dragonfly
&& iOpen(NULL,0,i)==iHigh(NULL,0,i)
){
IND[i]=iHigh(NULL,0,i)+(200*Point);
}
if(gravestone==true && iOpen(NULL,0,i)==iClose(NULL,0,i)     // Gravestone
&& iOpen(NULL,0,i)==iLow(NULL,0,i)
){
IND[i]=iHigh(NULL,0,i)+(200*Point);
}
if(hammer==true && iOpen(NULL,0,i)==iHigh(NULL,0,i)   // Hammer
&& iOpen(NULL,0,i)>iClose(NULL,0,i)
&& (iClose(NULL,0,i)-iLow(NULL,0,i))>(iOpen(NULL,0,i)-iClose(NULL,0,i))
){
IND[i]=iHigh(NULL,0,i)+(200*Point);
}