Problems with VPS service on MT4

 

Hello,


I want to test the VPS on MT4 platform, we have 24 hours to test, but I cannot make it work so far.

I watch this video and did everything on it, but is not working. I'm testing with a expert to see if is working, but I must be doing something bad.

Here is the video: https://www.youtube.com/watch?v=NGSHrX-QAOU


I'm using the code bellow to test the VPS (changing the time of course).

int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
if ( Minute() >= 50 && Minute()<=53)
int OrderTest=OrderSend(Symbol(),OP_BUY,0.1,Ask,100,0,0,"Compra de prueba para probar VPS",0,0,clrNONE);
Sleep(1000000000);   
  }
//+------------------------------------------------------------------+

Can someone help me with this?

I delete the symbols on market watch that I will not use.

Attach the expert on each graph (9 in my case) and "allow autotrading"

Then I start the process of migration and have the status started on journal. After this I close the terminal to wait for the time pass and launch the buy order on the VPS.

But after the "window" of time passed I enter the account and the Buy order is not triggered.

 

Sorry, I saw the Sleep() function was making the EA to wait too much (I was using that for a ealier version of the EA).

I use this one now, while having the terminal open in my PC is working (show the comment on the graph and keep it there after the condition is not meet). But when I start the VPS, close the terminal and check later, I don't have the Comment on the graph, meaning the VPS is not working, I don't know how.

input int low=36;
input int up=40;

int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason)
  {
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
if ( Minute() >= low && Minute()<=up)
Comment("VPS ready");  
  }
//+------------------------------------------------------------------+
Reason: