Trailing Stop code (using the Metaquote class)

 

I have this code to buy:

CTrade* trader=new CTrade;
   trader.SetExpertMagicNumber(eamagic);
  
   trader.Buy(Lot,ins,Ask(),stloss,tprofit); 

Once it buy I want to have a trailing stop loss? I saw the Trailing Stop classes, but I don't know how to implement them. Any code, lead, suggestion, help, advice, etc?