issue: mt4 ea closing manual trades

 
Hey guys,
I have a mt4 ea which i built from the EA builder at sufx.core.t3-ism.net
The EA is running as it should on EUR/USD pair, and i have put a magic number on it in settings (1379) i have also been doing some manual trading on the same account whether it is from the same PC, or another with the same account.
It seems that the EA is closing out the manual trades of the same currency pair (EUR/USD) without me wanting it to!?!
This is very frustrating, as it is closing good trades.
Any ideas on what could be happening??
Cheers
Tim
 

Hi, i am new. I have been trading manually only for a few weeks with everything operating normal until a couple of days

ago. Now when i set my stop loss (only on usd/cad pair) it changes by itself to a different SL. sometimes it take minutes,

sometimes only a second or two. Am i doing something wrong? Other pairs seem to be ok with my SL and TP settings.

 
It doesn't do it by itself. Either you enabled trailing stop (right click on the order) or you attached an EA that moves the stop.
 
> It seems that the EA is closing out the manual trades of the same currency pair (EUR/USD) without me wanting it to!?!

Most likely the order counting and/or order closing routine is not 'safe' for magic number

Post your code & we'll soon spot it...

-BB-

 

Did they give you the source code? I pressume it does not have a magic number. Is there an external parameter in your EA called MagicNumber, or along those lines? If not, it could either be inside the code, or non existent.

If it doesn't have a magic number and you have the source code then you can modify it.

I am sure I saw an article somewhere on here that shows you how to do this: it's very easy and doesn't take a genius.

Basically, just add an external int parameter called "Magic_number", etc. Then just add "&& Magic_number == OrderMagicNumber()" to all the order select functions. Also, on all the order send functions you need to change the 3rd last parameter to "Magic_Number" See this:

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE) 

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, Magic_Number, datetime expiration=0, color arrow_color=CLR_NONE) 

This may or may not work, depending on the structure of the code, but it should do if your EA comes from a simple generic strategy builder.

If you get stuck post a reply; we will all help you.

Please try to do this yourself and don't get someone else to do it for you; or else it will not benefit you at all.

Chris

 

> it should do if your EA comes from a simple generic strategy builder

IIRC, they dont come out as 'magic number safe'

Thats why we have many requests to add magics to EA's....

-BB-

Reason: