MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Update to MetaTrader 4 build 735 and Test the VPS for Free

Trailing Stop

Back to topics list To post a new topic, please log in or register
avatar
22
maymay 2007.05.30 08:35
 

I would like to ask about Trailing Stop of MT4.
In MT4, Trailing Stop doesn`t function as long as the position doesn`t gain
as much profit as the number of Trailing Stop ( 15pips, 20pips...) first of all.
Is it possible to make Trailing Stop function from the open price of position ?
(In softwares of FX broker I traded before in , it was possible .)
Is it possible to resolve this problem by EA?

 
Trading Plan
Trading Plan
Abbas Makki | 23 October 2014, 12:35 | Views: 31
The best plan is to find a strategy that fits you and master it. Whatever this trading strategy may be, whether it is price action or something else, you need to study the heck out of it and learn everything you can about it. Once you finally settle on a trading strategy and master it, you will BE A PROFESSIONAL TRADER and start to make money.
avatar
231
fireflies 2007.05.31 05:56 #
 
if( OrderSelect(ticket,SELECT_BY_TICKET) && OrderCloseTime()==0 ) {
    if( OrderType()==OP_BUY ) {
        OrderModify(OrderTicket(),OrderOpenPrice(),Open[0]-Point*TrailingStop,OrderTakeProfit(),0);
    }
    else if( OrderType()==OP_SELL ) {
        OrderModify(OrderTicket(),OrderOpenPrice(),Open[0]+Point*TrailingStop,OrderTakeProfit(),0);
    }
}
Look at the OrderModify documentation for more explanation and sample.
avatar
22
maymay 2007.05.31 14:38 #
 
fireflies wrote:
if( OrderSelect(ticket,SELECT_BY_TICKET) && OrderCloseTime()==0 ) {
    if( OrderType()==OP_BUY ) {
        OrderModify(OrderTicket(),OrderOpenPrice(),Open[0]-Point*TrailingStop,OrderTakeProfit(),0);
    }
    else if( OrderType()==OP_SELL ) {
        OrderModify(OrderTicket(),OrderOpenPrice(),Open[0]+Point*TrailingStop,OrderTakeProfit(),0);
    }
}
Look at the OrderModify documentation for more explanation and sample.
Thank you firefiles.
But it may be difficult for me to use it because it is a script ,not EA.
I don`t know where to write the number of Trailing Stop and how to edit this script in Meta edit .
I am a beginer.
But I try.
 
avatar
231
fireflies 2007.06.01 05:38 #
 
maymay wrote:

Thank you firefiles.
But it may be difficult for me to use it because it is a script ,not EA.
I don`t know where to write the number of Trailing Stop and how to edit this script in Meta edit .
I am a beginer.
But I try.

It's not a script or EA, just a snippet of codes that may solve your problem.
If you're not yet familiar with programming, MQL4 in particular, you better try to use and tweak some existing EAs.
Look in CodeBase tab above for the repository.

 
avatar
22
maymay 2007.06.01 08:54 #
 
fireflies wrote:
maymay wrote:

Thank you firefiles.
But it may be difficult for me to use it because it is a script ,not EA.
I don`t know where to write the number of Trailing Stop and how to edit this script in Meta edit .
I am a beginer.
But I try.

It's not a script or EA, just a snippet of codes that may solve your problem.
If you're not yet familiar with programming, MQL4 in particular, you better try to use and tweak some existing EAs.
Look in CodeBase tab above for the repository.


Thank you , firefiles.
But I could not find EA which mached to my desire in CodeBase tab.
In fact , I could find such EA in the different forum of MT4.
http://www.forex-tsd.com/metatrader-4/7861-possible-make-trailing-stop-function-open-price-position. html
It may be  precious for many FX traders. 
 
avatar
1
anup1965 2008.12.30 07:38 #
 

The correct thread is

Trailing Stop EA

http://www.forex-tsd.com/expert-advisors-metatrader-4/4844-help-needed-making-perfect-trailing-stop-ea-2.html


Really a very nice trailing stop EA.

 
avatar
1
insanitysnake 2012.12.10 23:15 #
 

Thanks.... Very nice useful script...

My EA very good now... I testing others configs now... Thanks a Lot! 

 
Back to topics list  

To add comments, please log in or register