VPS error 4109

 

Looking for some suggestions on things I might troubleshoot.  I wrote an EA that is running as expected in my MT4 terminal.  When I upload the EA to the VPS virtual server, buy and sell orders are placed, but it will "forget" that automated trading is allowed and throw error 4109 when it tries to OrderModify() the SL.   In the image below, the VPS is trying to submit the SL and failing.  Between 9:41 and 10:10 I hit the "AutoTrading" button on the terminal, switching the EAs to run locally, and it succeeds on its next adjustment attempt.

error

eatab

Because the code works without throwing 4109 when ran locally on my terminal, and stops are modified as they should be, I think I'm sending the OrderModify() correctly.  Just in case I'm not, here is the snippet:

if(OrderModify(OrderTicket(),NULL,Bid-(trail_stop*base_digits),NULL,clrNONE))
        {                                               
                Alert("Adjusting SL for ", _Symbol, " up. SL is now ",Bid-(trail_stop*base_digits));
        }   
else
        {
                Alert("Stop loss modification failed, error # ", GetLastError() );

        }           
             


I'm somewhat new to MQL and EAs, so it's possible I've missed something simple, but it seems like a VPS issue to me.  Failed SL modifications will destroy this EA's strategy.  Any ideas on where to start looking?  Thanks in advance.

Reason: