Please help to put trailing stop in EA

 
Hello everyone,

I need to put trailing stop in simple MA EA. Please see attached code (I think it is there when you download MT4).

I would be very grateful.

Thanks,

Dmitry
Files:
 
That is not a particularly simple EA. Since you evidently have little/no experience with MQL4 I suggest you start with an easier EA and at least try modifying it yourself.
Reason: