EngulfingEA

tkaboris
31
tkaboris  

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:
sangmane
38
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

Files:
Cross
105
Cross  

Be careful

Hi

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

tkaboris
31
tkaboris  
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.