EA seems not to run

 

I am newbie and have follow this site for period with good articles, then have started self learning for a while and done exercise my own EA (pull pieces from everywhere in here), following are the conditions that I expected the EA to work;

(1) This is reverse signal EA that will close all open orders, after successfully closing all order then send new opposite side order, i.e., from close SHORT and open LONG, or vice versa.

(2) There are options to open lots by assigning lot on EA setting or base on risk percentage when turn "MoneyManagement" to true,

(3) The EA can partial close the lots ans left last partial lot remaining, which can be as assigned in EA setting or tell the EA to equal scale out (left last equal split remaining), the last remaining partial lot then will be close when there is reversal signal, then go back to step 1 again.

I have compiled and passed with no error, but when I tested it in Strategy Tester, there is no activity produced from the EA. May be the logic is wrong somewhere? or any mistake, thank you for your advise. hope solution for this can be benefit to others...

Thanks,

Tutor539

Files:
kt_ea.mq4  23 kb
 

Broker

Hi Tutor

Which broker are you using?

If you are using a broker with ECN style execution then this could be the problem. Pending orders have to be sent to the broker instead of market orders.

If this is the case, you will need a programmer to modify the code for you - for ECN platform.

I recommend Nick Bilak. I have used him many times to fix my EA's for use with MT4 ECN brokers.

His website is here;

mql4.info - Home

Contact him for a quote. He is very reasonable and does excellent work.

Cheers

Spy

 

...

The EA you are testing is "designed" to be the only one trading on an account.

In short, it assumes that nothing and no-one else can trade on the account it works on. If you have any trade opened by any other EA or you have a position opened manually, this EA is not going to open any new orders. As an example this is one part of code that prevents opening orders in the described cases (code starting at line 218) :

openTrades = OrdersTotal();

if(openTrades==0 && IsSpreadTooWide==false)

{

openOrder();

}

OrdersTotal() returns the number of all orders on the account not just the ones opened by this EA

_________________________

PS: did not check the rest of the code, so the rest should be checked too ...

regards

mladen

 
spymez:
Hi Tutor

Which broker are you using?

If you are using a broker with ECN style execution then this could be the problem. Pending orders have to be sent to the broker instead of market orders.

If this is the case, you will need a programmer to modify the code for you - for ECN platform.

I recommend Nick Bilak. I have used him many times to fix my EA's for use with MT4 ECN brokers.

His website is here;

mql4.info - Home

Contact him for a quote. He is very reasonable and does excellent work.

Cheers

Spy

Hi SpyMez,

I have demoed on AlpariUK, I might program wrongly but not try to open pending order, the EA's intention is to close all open trade whenever reversal signal is triggered, otherwise it will justify the stop or scale out the lots partially when rech target profit.

Thanks,

Tutor

 
mladen:
The EA you are testing is "designed" to be the only one trading on an account.

In short, it assumes that nothing and no-one else can trade on the account it works on. If you have any trade opened by any other EA or you have a position opened manually, this EA is not going to open any new orders. As an example this is one part of code that prevents opening orders in the described cases (code starting at line 218) :

openTrades = OrdersTotal();

if(openTrades==0 && IsSpreadTooWide==false)

{

openOrder();

}

OrdersTotal() returns the number of all orders on the account not just the ones opened by this EA

_________________________

PS: did not check the rest of the code, so the rest should be checked too ...

regards

mladen

Thanks Mladen,

The intention of EA is can operate independently for each chart it is attached to, just only calculate freemargin from the account. My newbie knowledge did not aware of that.

Appreciate for further comment.

Thanks,

Tutor