MT4 VPS problem.

 

I've tried to use MQL5 VPS in the past and it missed majority of trades or seemed slow, but obliviously it is appealing for automation. So recently I tested the VPS versus desktop speed, and I'm confused by the results. Both were running exactly the same then I migrated one to VPS.

Trades on Desktop:

Desktop Trades

Trades on VPS:


you can see even though the VPS made a few pips it missed 3 trades. What could cause the VPS to be so slow or am I missing something entirely? 

 

Is this an EA or a signal subscription?

Is your MQL5 VPS latency fast enough?

Sometimes for some brokers with servers in hard to reach places, MQL5 VPS has very slow latency.

MQL5 VPS and any VPS has a point when you are making your connection to your broker faster and not slower.

In my computer for example my terminal's latency is 150-200ms but when I use MQL5 VPS, I have a 2-5ms connection.

I suggest you to check your MQL5 VPS Journal for any disconnection messages or errors.

 

It is a EA.

The VPS latency is 1.64ms versus 41.57ms on desktop.

Logs show no errors at all on desktop or VPS, and in theory VPS connection should be superior.

 
Jesse Phipps #:

It is a EA.

The VPS latency is 1.64ms versus 41.57ms on desktop.

Logs show no errors at all on desktop or VPS, and in theory VPS connection should be superior.

That doesn't make sense, with these facts you should have no missed trades or delays at all.

The only remaining thing to check is the EA itself.

 

My whole point is it doesn't make sense.

I've tried different EAs and reprogrammed it multiple times just too see, still the same problems.

It always run consistent on my PCs(I've actually tested on two desktops before).

Every time the market moves rapidly the VPS appears to miss hundreds of ticks.

Are you saying VPS has specific rules for how it should be programmed?

 

I only know that MQL5 VPS doesn't allow dll calls, but if your EA uses them wouldn't have migrated onto it in the first place.

Maybe someone else can think of any other reason for this.

 
Jesse Phipps:

I've tried to use MQL5 VPS in the past and it missed majority of trades or seemed slow, but obliviously it is appealing for automation. So recently I tested the VPS versus desktop speed, and I'm confused by the results. Both were running exactly the same then I migrated one to VPS.

Trades on Desktop:

Trades on VPS:


you can see even though the VPS made a few pips it missed 3 trades. What could cause the VPS to be so slow or am I missing something entirely? 

Same trading account?
or different trading account?
I mean: trades on desktop is for one trading account, and trades on VPS is on the other trading account?
So, it may be the reason (different ticks etc).

But I think that the main reason is about how EA was programmed.
Because MQL5 VPS is Metatrader in cloud running all the time without interruption.

It is difficult to compare some trades. I remember old Firebird EA which is performing differently all the time - because it was coded to get the signal on high/low of the bar, close bar and open bar on the same time (so it may be related to how many tick in history and so on).
And as I see from desktop trades: one your trade (desktop trades) was closed and an other trade was opened in almost immediately (15:30:01 and 15:30:05) ...

Theoretically speaking - I do not see any other reason than the coding reason.

Besides, there are some limitations such as the following:
dll is prohibited, Ea is using some text file or any other file (it should be coded as " #property tester_file "<file_name>",
Ea is using custom indicator which should be coded as a resource (#resource) , and may be more.
 
Sergey Golubev #:

Same trading account?
or different trading account?
I mean: trades on desktop is for one trading account, and trades on VPS is on the other trading account?
So, it may be the reason (different ticks etc).

But I think that the main reason is about how EA was programmed.
Because MQL5 VPS is Metatrader in cloud running all the time without interruption.

It is difficult to compare some trades. I remember old Firebird EA which is performing differently all the time - because it was coded to get the signal on high/low of the bar, close bar and open bar on the same time (so it may be related to how many tick in history and so on).
And as I see from desktop trades: one your trade (desktop trades) was closed and an other trade was opened in almost immediately (15:30:01 and 15:30:05) ...

Theoretically speaking - I do not see any other reason than the coding reason.

Besides, there are some limitations such as the following:
dll is prohibited, Ea is using some text file or any other file (it should be coded as " #property tester_file "<file_name>",
Ea is using custom indicator which should be coded as a resource (#resource) , and may be more.

This makes sense, I was sure I must be missing something about how the EA interacts on VPS. I will try adding the #resource part next week and it will probably work.

Thank you.

 
The main issue for me using an VPS is slow loading speed. A slight delay in my order processing while buying or selling a position can end up causing a massive loss.
 
Ricky991 #: A slight delay in my order processing while buying or selling a position can end up causing a massive loss.

Then you are not controlling your risk.

Risk depends on your initial stop loss, lot size, and the value of the symbol. It does not depend on margin and leverage. No SL means you have infinite risk (on leveraged symbols). Never risk more than a small percentage of your trading funds, certainly less than 2% per trade, 6% total.

  1. You place the stop where it needs to be — where the reason for the trade is no longer valid. E.g. trading a support bounce, the stop goes below the support.

  2. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/PIP, but it takes account of the exchange rates of the pair vs. your account currency.)

  3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
              MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum (2017)
              Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum (2018)
              Lot value calculation off by a factor of 100 - MQL5 programming forum (2019)

  4. You must normalize lots properly and check against min and max.

  5. You must also check Free Margin to avoid stop out

  6. For MT5, see 'Money Fixed Risk' - MQL5 Code Base (2017)

Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.

 

A low-cost VPS can only guarantee shoddy security; any unauthorised user or hacker can enter your server and cause Distributed Denial-of-Service (DDOS).

Hackers will exploit this vulnerability by sending unsolicited traffic to the server, causing it to slow down or lose connection.

Reason: