Put a Trailing Stop

 
Good afternoon, I need to incorporate functionality into an EA, and not how. The problem is that I want to put a Trailing Stop with the value of the order open price and do not know how this function, can anyone help me or give me tips on how to program it?. thanks
 

Where is your code?

 
I have attached the code as it is a very extensive EA, suffice me to give me some hints or examples.
 
jugivi:
I have attached the code as it is a very extensive EA, suffice me to give me some hints or examples.
Just the part with the trailing stop.
 
For examples, you can try looking here.
 
Thanks Ubzen, I will see examples, if I can not do it, you step the code ... Thank you very much.