need help to put a trailing stop works

 
hello. excuse me for English I speak French and I used google translation. 1 EA here which I wanted to add one trailing stop. compiling all goes well and does not work. Can you tell me why and especially what I need to change to make it work. thank you very much for your help
Files:
nouveau.mq4  9 kb
 

if someone' broker is in 5 Digits, the trailing stop can not be under 50 points, try 55 point

input double TrailingStop =30;

 

Or add a line to avoid a trailing stop too low :

   if(TrailingStop>0 && TrailingStop > MarketInfo(Symbol(), MODE_STOPLEVEL)  )
              {
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     //--- modify order and exit
                     OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
                     return;
                    }
                 }
}
 

And add an alert :


 if( TrailingStop < MarketInfo(Symbol(), MODE_STOPLEVEL)
                                             Alert(" Trailing stop too low");

Or Print(" Trailing stop too low", (string) TrailingStop  );


 

ffoorr, you just need to click edit and edit your post. No need to post new one if you are the last poster.

Your effort is appreciated though, thank you for that.

 
It don't work,
 
ddee:
Il ne fonctionne pas,

actually trailing sop does not work
 
KANABA :

Pas Effectivement fuite sop ne de FONCTIONNE

thank you for your help I just move the location of my trailing stop orders and I will always work attached file thank you again
Files:
nouveau_1.mq4  9 kb
Reason: