//+------------------------------------------------------------------+ //| | //| Copyright : ROMA_START | //| | //+------------------------------------------------------------------+ //------- ROMA------------------------------------------ extern bool ProfitTrailing = True; extern int Start = 20; extern int TrailingStop = 8; extern int TrailingStep = 2; extern bool UseSound = True; extern string NameFileSound = "expert.wav"; //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ void start() { for (int i=0; i ((Start + TrailingStop)*pp)) { if (OrderStopLoss() ((Start + TrailingStop)*pp)) { if (OrderStopLoss()>pAsk+( TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0) { ModifyStopLoss(pAsk+TrailingStop*pp); return; } } } } //+------------------------------------------------------------------+ //| | //| STOPLOSS | //| | //+------------------------------------------------------------------+ void ModifyStopLoss(double ldStopLoss) { bool fm; fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE); if (fm && UseSound) PlaySound(NameFileSound); } //+------------------------------------------------------------------+