How to enter trailing stop loss programmatically?

 
During manual trading, I am able to go to order, select trailing stop in the menu, and this trailing stop will become automatic and will be stored on the server.

However, I don't see any such function in the MQ4 in metaeditor. I see
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)

which allows to specify only initial stop loss, not trailing stop loss. The same with
bool OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)


Yes, I have seen examples how to make trailing stop loss in the code. While this may be usable, I would really like to be able to enter the "automatic" trailing stop (so that it works even after logging out). If the user interface allows it, then the MQ code should allow it as well.

How to do that? Did I miss any function in MQ4?

Thanks.
 
Automatical trailing stops set from expert advisor are impossible.
Use OrderModify function but not frequently. See https://www.mql5.com/en/forum/45157
 
OK, thanks for clarification.
I heard that MetaTrader has some sort of API - I never played with it, but before I eventually go to it (just because of this small problem) - is it possible to enter automatical trailing stop using API?

Just a suggestion - you might want to add such a function to some of the future releases of MetaTrader/MQ4, maybe others would also welcome it.
 
Client API is not available.
Automatical trailing stop is client terminal only feature.
 
I understand - thanks for fast responses.
 
marobi wrote >>
During manual trading, I am able to go to order, select trailing stop in the menu, and this trailing stop will become automatic and will be stored on the server.

However, I don't see any such function in the MQ4 in metaeditor. I see

which allows to specify only initial stop loss, not trailing stop loss. The same with


Yes, I have seen examples how to make trailing stop loss in the code. While this may be usable, I would really like to be able to enter the "automatic" trailing stop (so that it works even after logging out). If the user interface allows it, then the MQ code should allow it as well.

How to do that? Did I miss any function in MQ4?

Thanks.

Hi,

Unfortunately I can't help you fix yours but I found a great little very reasonably priced and flexible and effective commercial utility that has a 2 stage Trailing Stop Loss that you can use either on its own or in conjunction with other AEs (it overrides the TSL in other AEs). It is from PipBoxer.Com: look for PBTS. Like all Trailing Stop Losses (TSL), you have to have a profit that is equal to or greater than the amount of your TSL before it kicks in. Being a commercial product it is only available in compiled format of course.

Good luck with it.

…………………(8 >) Prosperous Trading (< 8)

DougRH4x

.

PS: I’m looking for someone to splice an adjustable (Trailing &) Stop Loss into the Martingale based program: PipMaker. Overcoming this one downfall of this program will make it VERY profitable!

 
DougRH4x wrote >>

Hi,

Unfortunately I can't help you fix yours but I found a great little very reasonably priced and flexible and effective commercial utility that has a 2 stage Trailing Stop Loss that you can use either on its own or in conjunction with other AEs (it overrides the TSL in other AEs). It is from PipBoxer.Com: look for PBTS. Like all Trailing Stop Losses (TSL), you have to have a profit that is equal to or greater than the amount of your TSL before it kicks in. Being a commercial product it is only available in compiled format of course.

Good luck with it.

…………………(8 >) Prosperous Trading (< 8)

DougRH4x

.

PS: I’m looking for someone to splice an adjustable (Trailing &) Stop Loss into the Martingale based program: PipMaker. Overcoming this one downfall of this program will make it VERY profitable!

 
it's almost 2010 and people still don't understand that FORUMS HATE SPAMMERS?
 
Who now or use FAPTURBO EA please help me.I need more information and direct testimoni before buy this EA
 

DougRH4x wrote >> I found a great little very reasonably priced and flexible and effective commercial utility that has a 2 stage Trailing Stop Loss that you can use either on its own or in conjunction with other AEs

Or just use the free Swiss Army EA v1.51

 

I have understod that Trailing Stop Loss never is on Server side. It is only on cliente, thus if you close your terminal the Stop Loss never changes again.


Check it by yourself in the client terminal documentation to avoid problems.

Reason: