Download MetaTrader 5

Simple Trailing Stop

To add comments, please log in or register
Tom Maryland
77
Tom Maryland  

Hi,I need a trailing stop function that moves the sl by a certain increment:

Sell Example:

When 10 pips down from entry price, move sl to openprice,then lock in 10 pips after price moved down 20,then lock in 20 when price moved down 30,etc..

If you have such a function or if you can point me to a page that deals with it, it would be much appreciated.Thank you.

Tjipke de Vries
6412
Tjipke de Vries  
            // check for trailing stop
            if(TrailingStop>0)  
              {                 
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
                     return(0);
                    }
                 }
              }

from MACD Sample

it is very simple to change this .......

in a way it is doing what you like to see.

Do an attempt making it inside of this code...

Tom Maryland
77
Tom Maryland  

Thank you for your reply deVries!

I am sorry for the grammar mistakes before, I've fixed my post.

Tjipke de Vries
6412
Tjipke de Vries  
Redael777:

Thank you for your reply deVries!

I am sorry for the grammar mistakes before, I've fixed my post.


Do we see your attempt also ??
Tonny Obare
1024
Tonny Obare  
Mt4 has trailing stop inbuilt or is it that you want to fully automate the process.
To add comments, please log in or register