Why ea not open position?

 
Hello,
idk why my ea work perfectly from my PC but also don't open any position if it run on a vps. MT5 terminals have the same settings, algo trading enabled etc...
Anyone can help me please?
 

If you click the "experts" and "journal" tabs on the bottom, are there any errors?

 
James McKnight #:

If you click the "experts" and "journal" tabs on the bottom, are there any errors?

Nothing... I've put Print function in the code for seeing whats happens, the terminal print the 'opened' position but really it don't open nothing
 
Bull Club #:
Nothing... I've put Print function in the code for seeing whats happens, the terminal print the 'opened' position but really it don't open nothing

Then the EA is likely working, can you manually open a trade with the VPS?

 
James McKnight #:

Then the EA is likely working, can you manually open a trade with the VPS?

Yes, its possible to open
 

Are you trying to use the EA on the same account/broker on both terminals? If not, check if you need permission from your broker to enable algo trading - also check if the window title bar shows your account is 'read-only' mode. If it is, ask your broker for support.

Instead of just printing 'opened', try to call ResetLastError exactly before you call OrderSend or any equivalent function you call to open a position. Right after, call Print with GetLastError. If it returns 0, there's a problem with your EA that we cannot help you fix because we lack a lot of information about it or with your terminal settings.

 
Emanuel Cavalcante Amorim Filho #:

Are you trying to use the EA on the same account/broker on both terminals? If not, check if you need permission from your broker to enable algo trading - also check if the window title bar shows your account is 'read-only' mode. If it is, ask your broker for support.

Instead of just printing 'opened', try to call ResetLastError exactly before you call OrderSend or any equivalent function you call to open a position. Right after, call Print with GetLastError. If it returns 0, there's a problem with your EA that we cannot help you fix because we lack a lot of information about it or with your terminal settings.

Nothing to do...