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

To add comments, please log in or register
Tony
263
Tony  

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

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

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

Chris Young
17
Chris Young  
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


Chris Young
17
Chris Young  
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.
Tony
263
Tony  

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

Brian Dee - Random Trader
1758
Brian Dee - Random Trader  

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-

To add comments, please log in or register