How close orders when lost connection?

 
Hi,
I had so many troubles with my connection, some times I leave one pending order that keeps running on the Mt5 server if I lost connection, this is very dangerous, so how cancel this order if I lost my connection? Many thanks.
 
Eric Sebestyen Ferreira :
Hi,
I had so many troubles with my connection, some times I leave one pending order that keeps running on the Mt5 server if I lost connection, this is very dangerous, so how cancel this order if I lost my connection? Many thanks.

In such cases, you need to use shared hosting. Check out the help on the VPS page.

Virtual hosting for MetaTrader 5
Virtual hosting for MetaTrader 5
  • www.mql5.com
The fastest VPS server for forex trading from the MetaTrader 4/5 terminal developers
 
This is the only solution?
 
Eric Sebestyen Ferreira: This is the only solution?

VPS is best for when trading via an automated EA, but NOT necessarily for when manual trading! (Also you cannot use MQL VPS for manual trading, only for EAs).

However, using a Stop-Loss and Take-Profit will ALWAYS at least offer some protection, even if you are unable to connect. Ideally you should use a Trailing-Stop during the life of the order while still connected, which will then act as a protection Stop-Loss when the connection is lost.

Also, you can use a mobile app connection if possible, to handle the order, should you desktop not be able to connect.

 
Fernando Carreiro:

VPS is best for when trading via an automated EA, but NOT necessarily for when manual trading! (Also you cannot use MQL VPS for manual trading, only for EAs).

However, using a Stop-Loss and Take-Profit will ALWAYS at least offer some protection, even if you are unable to connect. Ideally you should use a Trailing-Stop during the life of the order while still connected, which will then act as a protection Stop-Loss when the connection is lost.

Also, you can use a mobile app connection if possible, to handle the order, should you desktop not be able to connect.

Many thanks this is some protection sure! What would be interesting is to use the symbol expiration time_specified, to change expiration every 10sec but Never found some broker that offer this. If someone know please share
 

If you have many trouble with your connection VPS will be a good solution.
But you can have there also trouble.

To prevent your account during EA Trading you should implement the SL for every Trade. TP will also be fine ;)

So your account will always be save and your definitions are clear!

In minimum the SL should be placed during EA Trading everytime.

Just my 50Cent ... Everybody can take his own risc ;)

 
Although this sounds silly, but I use my mobile app in case of connection issues at my PC/Terminal. That worked fine so far.
 
Eric Sebestyen Ferreira: one pending order …, so how cancel this order if I lost my connection? Many thanks.
There is no need to create pending orders in code.
  1. The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
  2. Don't worry about it unless you're scalping M1 or trading news.
  3. Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
Reason: