Can anybody help me correct this code?

 
I'm new to this code writing so there might be some things wrong with this code. However, what I'm trying to do is modify stop orders (long and shorts) that can move at the same time regardles of where price is going. As of right now on the open of the candle if will change both. But say, when it goes up one pip it will adjust above only and when it goes down past the open it will adj below and so on. Is there a way make it change and keep the same distance above and below regarldes of where the price is going? I hope I'm making sense.


Any help greatly appreciated


int start()
  {
   
   int    cmd,total,error;
   
   double h,l,ho,lo,sp;
   
   
   h=iHigh(NULL,PERIOD_M1,0);
   l=iLow(NULL,PERIOD_M1,0);
   sp=Ask-Bid;
  
   
   
//----

   total=OrdersTotal();
   
//----
   for(int i=0; i<total; i++)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         //---- print selected order
         OrderPrint();
         cmd=OrderType();
         //---- buy or sell orders are considered
         if(cmd==OP_BUYSTOP || cmd==OP_SELLSTOP)
           
             
               if(cmd==OP_BUYSTOP)  ho=h+sp+10*Point;
                 { 
                  OrderModify(OrderTicket(),ho,0,0,0,Red);
                  error=GetLastError();
                  Print("error(",error,"): ",ErrorDescription(error));
                  Sleep(1000);
                 }
              
               if(cmd==OP_SELLSTOP) lo=l-10*Point;
                 { 
                  OrderModify(OrderTicket(),lo,0,0,0,Red);
                  error=GetLastError();
                  Print("error(",error,"): ",ErrorDescription(error));
                  Sleep(1000);
                 }
                 
        }
            
     }
//----
   return(0);
  }



 
Can anyone point me in the right direction?
 
There is special forum for MQL4 programmers https://www.mql5.com/forum/en
 
Thank you
 
you must add the include :
#include <stdlib.mqh>