"invalid ticket for OrderModify function" AND "OrderModify error 4051" when trying to modify order

 

I am a MQL4 novice and have spent hours trying to solve this.  Please help!  I would really appreciate it.

Here it is:

      {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,0,12345,0,Green);
         if(ticket>0)
        {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
               Alert("BUY order opened : ",OrderOpenPrice());
        }
         else
            Alert("Error opening BUY order : ",GetLastError());
         return;
      }
      
      //--- modifying the order
      
      if(Close[1]>1.10001)
      
         Alert("Modifying the order");
      
         bool buyres;
         buyres=OrderModify(ticket,0,0,Ask+TakeProfit*Point,0);
      
         if(buyres==false)
         {
            Alert("Error modifying BUY order : ",GetLastError());
         }
         else
         {
            Alert("Order modified successfully");
         }
      

Thank you!

Reason: