I need help with my EA pleas

 
I need help with my EA please, as you can see he has the parameters configured so that he only makes the purchase and sale, as well as closing them, I just need someone to help me and tell me how I can do so if this EA If you lose one trade, open the next one with twice the number of lots and with the same MACD parameters, and when you win, reset to the initial value of lots, which is almost always 0.01 or 0.1. Thanks in advance, I moved several options but I don't make it work as I want.  Any help is good.
// External variables
extern double LotSize = 0.1;
extern double StopLoss = 0;
extern double TakeProfit = 0;
extern double TrailingStopLimit = 0;
extern double TrailingStopStop = 0;
extern int MagicNumber = 15051;


// Global variables
int LongTicket;
int ShortTicket;
double RealPoint;



// Init function
int init()
        {
      RealPoint = RealPipPoint(Symbol());
     
        }


// Start function
int start()
        {
        //Variables
        
                
                // Long
                
                OrderSelect(LongTicket,SELECT_BY_TICKET);
                if(OrderCloseTime() != 0 || LongTicket == 0)
                {
                
                    
bool buy_condition_1 = iRVI(NULL,0,15,MODE_MAIN,0)                       >iRVI(NULL,0,15,MODE_SIGNAL,0)   ;
bool buy_condition_2 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)     > iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     ;
bool buy_condition_3 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     > 0     ;
bool buy_condition_4 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2)     < 0     ;


                                 
                if( 
                
                
                buy_condition_1&&
                buy_condition_2&&
                buy_condition_3&&
                buy_condition_4
                
                
                   )
                        {
                                                                

                                
                                
                                
                                
                                LongTicket = OrderSend(Symbol(),OP_BUY,LotSize,Ask,0,0,0,"Buy Order",MagicNumber,0,Green);
                                
                                
                                OrderSelect(LongTicket,SELECT_BY_TICKET); 
                                double OpenPrice = OrderOpenPrice();
                                
            
             
            if(StopLoss > 0) double LongStopLoss = OpenPrice - (StopLoss * RealPoint);
            if(TakeProfit > 0) double LongTakeProfit = OpenPrice + (TakeProfit * RealPoint);
            
            
                                if(LongStopLoss > 0 || LongTakeProfit > 0) 
                                {
               bool LongMod = OrderModify(LongTicket,OpenPrice,LongStopLoss, LongTakeProfit,0);
                                }
                                
                                
                        }
                
                }
                                
                //Close long
      if (OrdersTotal() > 0)
                {              
                
                    
                
                    
                    
bool close_buy_condition_1 = iRVI(NULL,0,15,MODE_MAIN,0)                       <iRVI(NULL,0,15,MODE_SIGNAL,0)   ;
bool close_buy_condition_2 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)     < iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     ;
bool close_buy_condition_3 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     < 0     ;
bool close_buy_condition_4 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2)     > 0     ;

                    
                
                 if( 
                 
                 
                 close_buy_condition_1&&
                 close_buy_condition_2&&
                 close_buy_condition_3&&
                 close_buy_condition_4
                 
                 
                    )
                        {
                                OrderSelect(LongTicket,SELECT_BY_TICKET);
                
                                if(OrderCloseTime() == 0 && LongTicket > 0)
                                        {

                                                bool Closed = OrderClose(LongTicket,OrderLots(),Bid,0,Red);
                                                
                                                
                                        }               
                    }
                }
                               
                
                // Short
                
                OrderSelect(ShortTicket,SELECT_BY_TICKET);
                if(OrderCloseTime() != 0 || ShortTicket == 0)
                {
                 
                
                                    
bool sell_condition_1 = iRVI(NULL,0,15,MODE_MAIN,0)                       <iRVI(NULL,0,15,MODE_SIGNAL,0)   ;
bool sell_condition_2 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)     < iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     ;
bool sell_condition_3 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     < 0     ;
bool sell_condition_4 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2)     > 0     ;
  
                                    
                if( 
                
                sell_condition_1&&
                sell_condition_2&&
                sell_condition_3&&
                sell_condition_4
                
                
                   )
                        {
                                        
                                
                                
                                
                                
                                
                                ShortTicket = OrderSend(Symbol(),OP_SELL,LotSize,Bid,0,0,0,"Sell Order",MagicNumber,0,Red);
                                
                                OrderSelect(ShortTicket,SELECT_BY_TICKET); 
                                OpenPrice = OrderOpenPrice();
                                
            
            
            if(StopLoss > 0) double ShortStopLoss = OpenPrice + (StopLoss * RealPoint);
            if(TakeProfit > 0) double ShortTakeProfit = OpenPrice - (TakeProfit * RealPoint);
            
                                if(ShortStopLoss > 0 || ShortTakeProfit > 0) 
                                {
               bool ShortMod = OrderModify(ShortTicket,OpenPrice,ShortStopLoss, ShortTakeProfit,0);
                                }
                                
                                
                        }
                
                
                }
                             

                
                 //Close Short
                 if (OrdersTotal() > 0)
                {
                 
                 
                                     
bool close_sell_condition_1 = iRVI(NULL,0,15,MODE_MAIN,0)                       >iRVI(NULL,0,15,MODE_SIGNAL,0)   ;
bool close_sell_condition_2 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)     > iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     ;
bool close_sell_condition_3 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)     > 0     ;
bool close_sell_condition_4 = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2)     < 0     ;

                 
                 if( 
                 
                 
                 close_sell_condition_1&&
                 close_sell_condition_2&&
                 close_sell_condition_3&&
                 close_sell_condition_4
                 
                 
                 
                    )
                        {
                                OrderSelect(ShortTicket,SELECT_BY_TICKET);
                
                                if(OrderCloseTime() == 0 && ShortTicket > 0)
                                        {

                                                 Closed = OrderClose(ShortTicket,OrderLots(),Ask,0,Red);
                                                
                                                
                                        }               
                        }
                }
       
                
                
if (TrailingStopLimit > 0 && TrailingStopStop > 0)
         {
                     double TrailingStopLimitReal = TrailingStopLimit * RealPoint;
                     double TrailingStopStopReal = TrailingStopStop * RealPoint;
                     
                     OrderSelect(LongTicket, SELECT_BY_TICKET);             
                     if (OrderType() == OP_BUY && OrderCloseTime() == 0)
                        {
                           
                           if(Bid - OrderOpenPrice() > TrailingStopLimitReal) 
                              {

                                 if(OrderStopLoss() < Bid - (TrailingStopLimitReal * 2)) 
                                    {
                                       double LongTrailingStopLoss = OrderStopLoss() + TrailingStopStopReal;
                                       OrderModify(OrderTicket(), OrderOpenPrice(), LongTrailingStopLoss, OrderTakeProfit(), 0, MediumSeaGreen);        
                                    }
                              }
                        }
                        
                     OrderSelect(ShortTicket, SELECT_BY_TICKET);   
                     if (OrderType() == OP_SELL && OrderCloseTime() == 0)
                         {
                           
                           if(OrderOpenPrice()- Ask > TrailingStopLimitReal) 
                              {

                                 if(OrderStopLoss() > Ask + (TrailingStopLimitReal * 2)) 
                                    {
                                       double ShortTrailingStopLoss = OrderStopLoss() - TrailingStopStopReal;
                                       OrderModify(OrderTicket(), OrderOpenPrice(), ShortTrailingStopLoss, OrderTakeProfit(), 0, MediumSeaGreen);       
                                    }
                              }
                          }     
                        
                
                }               
                
                return(0);
        }


// Pip Point Function
double RealPipPoint(string Currency)
        {
                int CalcDigits = MarketInfo(Currency,MODE_DIGITS);
                if(CalcDigits == 2 || CalcDigits == 3) double CalcPoint = 0.01;
                else if(CalcDigits == 4 || CalcDigits == 5) CalcPoint = 0.0001;
                return(CalcPoint);
        }
        

 
18068752 If you lose one trade, open the next one with twice the number of lots

Martingale, guaranteed to blow your account eventually. If it's not profitable without, it is definitely not profitable with.
          Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum 2015.02.11

Why it won't work: Calculate Loss from Lot Pips - MQL5 programming forum 2017.07.11

 
William the problem is That I can't configure the code. I'm not good with code.
Reason: