help with a trailing stop

 

Hi guys,

I am new to the programming side of this so I thought I would much around with EAs that are already written. In this particular case, I'm having difficulty with my trailing stop function. I have attached the whole EA as I'm not sure if it's the function or the function call that is the issue. If anyone can help I would greatly appreciate as I have no idea what is wrong with it.

Files:
adcwk8.4.6.mq4  18 kb
 
fibios1: I'm not sure if it's the function or the function call that is the issue. If anyone can help I would greatly appreciate as I have no idea what is wrong with it.
  1.       OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
          OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point*TrailingStop, 0, 0, Yellow);
    
    So find out. What are Function return values ? How do I use them ? - MQL4 forum
  2. extern int TrailingStop = 20;
    
    Not adjusting for 4/5 digit broker. On a 5 digit broker your stop is only 2 pips. Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

  3. void Trailing_Stop(){
       int TrailingStop; // This declaration hides the external. So you have none.
    

  4. You "have no idea." Of course you don't. Add print statements around your IFs and Calls, dumping variable and calculation values and find out.
Reason: