Hello everybody,
this user here created a very interesting trailing stop tool. It works fine when, for example, placing it on a chart in the mt4 terminal.
https://www.mql5.com/en/code/9530
Now, I'd like to integrate this functionality, if possible, into an expert adviser I've already programmed for use with the "system tester".
I've never worked with scripts or include files, so I tried to put this file in the "include" folder and inserted into my EA for example
#include <TrailingStopFrCn.mq4> but then there are messages like "start function already defined" I'm sure I made a basic mistake here.
Nevertheless if anybody knows how to simply integrate this trailing function in a EA thanks in advance.
thanks a lot RaptorUK,
I got my custom EA code now with with the function call i.e. int Start () { .... TrailingStop(); ... return(0);} after that comes the function definition of TrailingStop()
now when using in the System Tester (EA) a command (just for testing) like TicketSell=OrderSend(Symbol(),OP_SELL,0.1,Bid,20,NULL,NULL) a position is opened but the TrailingStop function apparently doesn't react/is not triggered whereas placing the original trailing function scipt on a chart it works brilliantly be recognizing automatically any open positions (of that currency!)
so do you have any idea how to get this topic working?
thanks a lot RaptorUK,
I got my custom EA code now with with the function call i.e. int Start () { .... TrailingStop(); ... return(0);} after that comes the function definition of TrailingStop()
now when using in the System Tester (EA) a command (just for testing) like TicketSell=OrderSend(Symbol(),OP_SELL,0.1,Bid,20,NULL,NULL) a position is opened but the TrailingStop function apparently doesn't react/is not triggered whereas placing the original trailing function scipt on a chart it works brilliantly be recognizing automatically any open positions (of that currency!)
so do you have any idea how to get this topic working?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everybody,
this user here created a very interesting trailing stop tool. It works fine when, for example, placing it on a chart in the mt4 terminal.
https://www.mql5.com/en/code/9530
Now, I'd like to integrate this functionality, if possible, into an expert adviser I've already programmed for use with the "system tester".
I've never worked with scripts or include files, so I tried to put this file in the "include" folder and inserted into my EA for example
#include <TrailingStopFrCn.mq4> but then there are messages like "start function already defined" I'm sure I made a basic mistake here.
Nevertheless if anybody knows how to simply integrate this trailing function in a EA thanks in advance.