Can trailing stop in the client terminal be set from in an EA?

 

Hi


I'm trying to write a simple EA to manage an entry. When the entry order is placed I would like to add a trailing stop in the same way that you can by right-clicking on the order in the client terminal. (I understand that the Client Terminal handles the trailing stop, not the server.) This way the EA does not need to run all the time the position is open.


I've looked in the documentation, but I can't find a function that allows an EA to set it. Is there such a function?


Thanks

Jellybean

 
If it is a basic trailing stop you want then it is available by right click in the terminal
 

Thanks gazza


It is a basic trailing stop I want, but I would like to be able to set it from within an EA. I have a simple EA to place / modify a pending order and if it gets triggered when I'm not present, I'd like the basic MT4 trailing stop to be in place.

I haven't found any function in MQL4 that can do this. I was wondering if I have missed it.


Cheers

Jellybean

 
Jellybean:

Hi


I'm trying to write a simple EA to manage an entry. When the entry order is placed I would like to add a trailing stop in the same way that you can by right-clicking on the order in the client terminal. (I understand that the Client Terminal handles the trailing stop, not the server.) This way the EA does not need to run all the time the position is open.


I've looked in the documentation, but I can't find a function that allows an EA to set it. Is there such a function?


Thanks

Jellybean


 
I don't know if it's good, bad, or indifferent but what I do is store that trailing value in a variable, and have the EA check to see if the OpenPrice has hit OpenPrice + trailing value, then use OrderModify to change the stop within the EA.
 

Thanks, Scooby Due, for your comments . Of course, I can program a trailing stop into my EA, so that's what I'll do.


Cheers

Jellybean

 

JB

>> I've looked in the documentation, but I can't find a function that allows an EA to set it. Is there such a function?

IMHO... No :(

The brokers really do not want the server overhead of handling trailing stops...

Many brokers even have server side trailing stops 'off' by default, so you have to ask for them to be made available to your account

Good Luck

-BB-

Reason: