Trade.mqh

 

Hi

 is it not possible to use Trade.mqh in EA on VPS?

I migrated some they are not doing anything...

Or should I do something special to make it work?

Thanks

 
grobbrecht:

Hi

 is it not possible to use Trade.mqh in EA on VPS?

I migrated some they are not doing anything...

Or should I do something special to make it work?

Thanks

What does the log say abou the migration?

 

It doesnt give any error whatsoever. All EA are migrated.

Manually and in strat tester the EA works, but in VPS nothing happens..


thanks

 
grobbrecht:

It doesnt give any error whatsoever. All EA are migrated.

Manually and in strat tester the EA works, but in VPS nothing happens..


thanks

Forum on trading, automated trading systems and testing trading strategies

EA not trading on live account

Vladimir Karputov, 2020.10.05 12:47

And where are the errors? You must analyze the result of a trade and analyze whether there is an error or not.

Example of actions: sent a Buy trade order and printed the result:

ResultRetcode

Gets the code of request result

ResultRetcodeDescription

Gets the code of request result as a string


 
Thanks for the reply allthough not sure what to do with it; no trades are occurring so impossible to analyze them...
 
grobbrecht :
Thanks for the reply allthough not sure what to do with it; no trades are occurring so impossible to analyze them...

Have you inserted these lines into your code?

*** trade order and printed the result:

ResultRetcode

Gets the code of request result

ResultRetcodeDescription

Gets the code of request result as a string


Are you sure you looked into the log files of the virtual platform? Are you generally asking about MQL5 VPS or third-party hosting?

Be aware that if something does not work, then this is your mistake and you should look for where you made a mistake (the most common mistake is clumsy and oblique code).
Documentation on MQL5: Standard Library / Trade Classes / CTrade / Buy
Documentation on MQL5: Standard Library / Trade Classes / CTrade / Buy
  • www.mql5.com
Successful completion of the Buy(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using ResultRetcode() and value returned by ResultDeal().
 

Hi

could someone confirm that it is supposed to work? 

Anybody  uses trade.mqh in his EA on VPS?

Thanks

 
grobbrecht:

Hi

could someone confirm that it is supposed to work? 

Anybody  uses trade.mqh in his EA on VPS?

Thanks

Don't blame trade.mqh. Your coding skill is the issue. It's like a carpenter blaming a hammer for missing nails.
 
Thats not what I'm asking.
The question is quite simple: has anybody got a EA on VPS with trade.mqh.
 

I think I found why its not openong positions.I only want open 1 position at a time so I check with PositionsTotal() if position is allready opened.
I want it to check for this EA , but I guess PositionsTotal() goes for the complete tradingaccount.

Whats would be the easiest way to achieve this?

Reason: