I really need some advice or help on how to do this

 
What I want to add is a Trailing Stop, and a input to lock in pips if
the market reverses and doesn't hit the TS. And then an input for
amount of pips to activate the lock in pips once I have the code for
the buy then I can modify the sell and quick reverse. I just don't
know alot about programming to get the first one done. I also includid
the rest of the scripts in case tou need them
Thank You
Mike
fxtrading24
//+-------------------------------------------------------------------------+
//|                                                    IBFX - Quick Buy.mq4 |
//+-------------------------------------------------------------------------+
#property copyright "Copyright © 2008, IBFX.com"
#property link      "www.ibfx.com"
//----
int start()
{
      /*+-------------------------------------------------------------------------+
         Because these scripts are meant to execute fast there are no user 
         external inputs. Make sure to modify the settings below, then compile 
         the script before assigning a hot key to it and using it.
         The magicNumber HAS TO TO BE THE SAME ON ALL SCRIPTS if you change it 
         here make sure to change it on all scripts!!!
         Do not forget to click on COMPILE once your changes have been made!!!
      +-------------------------------------------------------------------------+*/
         int   MagicNumber = 901; 
      double          Risk = 2.0;       
         int      StopLoss = 0;     // Number in Pips ie: 50 for 50 pips.
         int  ProfitTarget = 5;     // Number in Pips ie: 50 for 50 pips.
         int      Slippage = 1;
        bool      MiniLots = True;  // Does your broker offer mini micro lots such as 0.01 lot?
      string    Commentary = " IBFX - Quick Buy ";
      string      FontName = "Arial";
         int      FontSize = 12;
      
      //+-------------------------------------------------------------------------+
      //|               DO NOT MODIFY ANYTHING BELOW THIS LINE!!!                 |
      //+-------------------------------------------------------------------------+
      //---- A few checks before we get started
      if( !IsConnected()   ) { Alert( Commentary + " - No Connection!!" );               return(0); }
      
      //---- Specific Vars
      int        Action = OP_BUY;
      double  InitPrice = Ask;
      
      //---- Global Vars
        bool      Done = False;
      string   Symbole = Symbol();
         int    Ticket = 0; 
         int ErrorCode = 0;
      double   MaxLots = MarketInfo( Symbole, MODE_MAXLOT );
      double      Lots =MM( Symbole, Risk, MiniLots );
      
      
      //---- Let's place the order.  
      while( !Done )
      {     
         double FillPrice = Ask;
         double StopPrice = Bid;
                   
         if( MathAbs( InitPrice - FillPrice ) > Slippage * Point ) { Done = true; }  
         Comment( "IBFX - QuickBuy | Placing Long Order, please wait ..." );    
         Wait();
         Ticket = OrderSend( Symbole, Action, Lots, FillPrice, Slippage * Point, StopLong( StopPrice, StopLoss ), TakeLong(FillPrice, ProfitTarget), Commentary, MagicNumber, 0, CLR_NONE );
         if( Ticket >= 0 )   { Done = true; }
         else 
         {
            ErrorCode = GetLastError();
                 if( ErrorCode == 4109 ) { Alert( Commentary + " - You did not allow live trading!" ); Done = true; }
            else if( ErrorCode ==  134 ) { Alert( Commentary + " - Not enough Money!" );               Done = true; }
            else if( ErrorCode ==  138 || ErrorCode ==  136 || ErrorCode ==  135 ) { Alert( Commentary + " - Requote/Slippage, run the script again" ); Done = true; }
            else                         { Alert( Commentary +  " Error: " + ErrorCode ); }
         }
      }
      Comment("");
       
   //----
   return(0);
}
//+-------------------------------------------------------------------------+

//+-------------------------------------------------------------------------+
//+                               Wait                                      +
//+-------------------------------------------------------------------------+
void Wait() { while( IsTradeContextBusy() ) { Sleep(50); } }
//+-------------------------------------------------------------------------+

//+-------------------------------------------------------------------------+
//| Calculate Stop Short                                                    |
//+-------------------------------------------------------------------------+
double StopLong(double price,int stop)
{
if(stop==0) { return(0); }
else        { return(price-(stop*Point)); }
}
//+-------------------------------------------------------------------------+
//| Calculate Profit Target Long                                            |
//+-------------------------------------------------------------------------+
double TakeLong(double price,int take)
{
if(take==0) {  return(0);}
else        {  return(price+(take*Point));}
}
//+-------------------------------------------------------------------------+

//+-------------------------------------------------------------------------+
//|                      Money Managment                                    |   
//+-------------------------------------------------------------------------+   
double MM( string Sym, double Risk, bool BrokerAllowsFractionalLots )
{
double MinLots = MarketInfo(Sym,MODE_MINLOT);
double MaxLots = MarketInfo(Sym,MODE_MAXLOT);
double Leverage = AccountLeverage();
double LotSize = MarketInfo(Sym,MODE_LOTSIZE);
double LotStep = MarketInfo(Sym,MODE_LOTSTEP);

double FinalAccountBalance =  MathMin( AccountBalance(), AccountEquity() );
int NormalizationFactor = 0;
double Lots = 0.0;

if(LotStep == 0.01) { NormalizationFactor = 2; }
if(LotStep == 0.1)  { NormalizationFactor = 1; }
   
if( BrokerAllowsFractionalLots == true)
{
   Lots = (FinalAccountBalance*(Risk/100.0))/(LotSize/Leverage);
   Lots = StrToDouble(DoubleToStr(Lots, NormalizationFactor));
   if (Lots < MinLots) { Lots = MinLots; }
   if (Lots > MaxLots) { Lots = MaxLots; }
}
else if(BrokerAllowsFractionalLots == false)
{
   Lots = (FinalAccountBalance*(Risk/100.0))/(LotSize/Leverage);
   Lots = MathRound(Lots);
   if (Lots < MinLots) { Lots = MinLots; }
   if (Lots > MaxLots) { Lots = MaxLots; }
}
return( Lots );
}
 

You posted a IBFX script. Scripts only run once and then exit.

There is no way to post a trailing SL in MT4/MQL4. It must be done programmatically, either MT4 option or a EA.

Just get a copy of swiss army EA, it's free. You can configure it to always have a trailing SL.