EngulfingEA

 

I am developing and EA that is based on Enqulfing Candle Pattern. Also trying other patterns. At the moment i have problem with EA, its currently opens many orders per candle. It only should open one order per candle, per pattern occurrence. Please help me to solve it.

I have added a function called NumberOfBarOpenLastPos which prohibits from making another trade on the same bar, but it still opens several positions on the one bar

Files:
 

hi,

pls find the attached code. i record the bar shift ( xBar = iBars(NULL,0) ) after OrderSend(). then before opening new position, check if xBar==iBars(NULL,0).

hth,

stephen

Files:
 

Be careful

Hi

Be careful. It's configured for 0.1 lot and an order of 5 lots was oppened

 
sangmane:
hi,

pls find the attached code. i record the bar shift ( xBar = iBars(NULL,0) ) after OrderSend(). then before opening new position, check if xBar==iBars(NULL,0).

hth,

stephen

Thank you Stephen,

It works properly now. I am playing with patterns now. Just trying to figure out the pattern that will work with formula where 20 pips TP and 20 Pips SL and TP occurrence is greater.

Reason: