FAILED with error "Timeout" yet the position has been successfully opened
FAILED with error "Timeout" yet the position has been successfully opened
24 Aug 2018, 04:48
Hi,
Sometimes when markets are more active, the opening of positions successfully is sometimes occuring delayed (with 11 pairs active). The behavior during that moment is that you get the pending toast tile for several seconds. Often my client reports FAILED with error "Timeout", yet the position seems to be opened successfully.
Is this expected behavior? Because i should expect that when it's reported as Timeout, that the position opening is cancelled or when the position opening succeeds, that the position opening is reported successful. I currently use below snippet to check if a position opening was successful and to do additional actions afterwards. Ofcourse when the opening was reported as timeout, OnNewPositionsOpened(...) is not triggered, messing up the logic of the algo.
trrRes = ExecuteMarketOrder(tradeType, Symbol, Symbol.NormalizeVolumeInUnits(volume), String.Concat(strID, "_", strSubLabel), 0, 0, 3, strID); if (trrRes.IsSuccessful) { OnNewPositionsOpened(trrRes.Position); }
22/08/2018 12:12:53.034 | Executing Market Order to Sell 20000 USDCAD (MR: 3)
22/08/2018 12:12:53.752 | → Executing Market Order to Sell 20000 USDCAD (MR: 3) SUCCEEDED, Position PID47415020
22/08/2018 12:12:53.768 | register: INSERT USDCAD (USDCAD-Minute_636705295730340000)
22/08/2018 20:00:42.914 | Closing position PID47415020
22/08/2018 20:01:04.226 | → Closing position PID47415020 SUCCEEDED, Position PID47415020
22/08/2018 20:01:19.929 | Executing Market Order to Sell 20000 USDCAD (MR: 3)
22/08/2018 20:01:29.148 | → Executing Market Order to Sell 20000 USDCAD (MR: 3) SUCCEEDED, Position PID47436055
22/08/2018 20:01:29.179 | register: INSERT USDCAD (USDCAD-Minute_636705576799290000)
22/08/2018 20:03:10.945 | Closing position PID47436055
22/08/2018 20:04:51.273 | → Closing position PID47436055 FAILED with error "Timeout", Position PID47436055
22/08/2018 20:05:11.289 | Executing Market Order to Sell 20000 USDCAD (MR: 3)
22/08/2018 20:06:10.695 | → Executing Market Order to Sell 20000 USDCAD (MR: 3) FAILED with error "TechnicalError"
22/08/2018 20:06:10.711 | Executing Market Order to Sell 20000 USDCAD (MR: 3)
22/08/2018 20:07:28.742 | → Executing Market Order to Sell 20000 USDCAD (MR: 3) FAILED with error "Timeout"
current open position:
PID47436657 USDCAD $ 20 000 Sell 1.29932 22/08/2018 20:06:11 USDCAD-Minute_636705579707110000
Thanks in advance.
Replies
ap11
13 Sep 2018, 09:57
( Updated at: 21 Dec 2023, 09:20 )
Hi .ics,
Timeout error happens when you send a request and client app doesn't receive a response from the server. It can be a connection issue or might be caused by other errors.
Can you please check the details for this position:
22/08/2018 20:03:10.945 | Closing position PID47436055
22/08/2018 20:04:51.273 | → Closing position PID47436055 FAILED with error "Timeout", Position PID47436055
Go to History tab and find the closing deal for this position. Open details using the info button and click Positions Details button.
There you will see a history of this position.
When a position is opened, you will have: Order -> Opening Deal -> Position
When it's closed: Order -> Closing Deal -> Position Closed
You can compare closing order time with your logs. And see when it was actually closed.
Next time when you see it, please send troubleshooting information using Ctrl+Shift+Alt+T. And add a link to this post in the description.
Kind Regards,
Andrey
@ap11
.ics
01 Oct 2018, 03:09
Hi Andrey,
Hereby some additional info. Client logs are UTC+2, Txt logs are UTC+0.
Because the trade result is reporting 'Timeout' instead of 'IsSuccessful', additional processing of code like posted in the first (OnNewPositionsOpened(trrRes.Position);) post will not happen. This issue is the same for opening and closing of positions. Also sent troubleshooting information using Ctrl+Shift+Alt+T.
client log:
21/09/2018 15:07:04.566 | Executing Market Order to Buy 20000 EURGBP (MR: 3)
21/09/2018 15:08:05.926 | → Executing Market Order to Buy 20000 EURGBP (MR: 3) FAILED with error "Timeout"
txt log:
2018.09.21 13:07:04.613 | Request to Buy 0.20 Lot(s) EURGBP (Price: 0.89673, MR: 3) is sent to server
2018.09.21 13:08:05.941 | Request to Buy 0.20 Lot(s) EURGBP (Price: 0.89609, MR: 3) is sent to server
2018.09.21 13:09:15.754 | → Request to Buy 0.20 Lot(s) EURGBP (Price: 0.89673, MR: 3) is ACCEPTED, order OID79616036 created (21/09/2018 13:07:04.734 UTC+0)
2018.09.21 13:09:15.785 | → Order OID79616036 is FILLED at 0.89608, position PID48578237 (21/09/2018 13:07:04.978 UTC+0)
2018.09.21 13:09:15.785 | → Request to Buy 0.20 Lot(s) EURGBP (Price: 0.89609, MR: 3) is ACCEPTED, order OID79616377 created (21/09/2018 13:08:06.060 UTC+0)
2018.09.21 13:09:15.879 | → Order OID79616377 is FILLED at 0.89589, position PID48578345 (21/09/2018 13:08:06.308 UTC+0)
client log:
22/08/2018 20:03:10.945 | Closing position PID47436055
22/08/2018 20:04:51.273 | → Closing position PID47436055 FAILED with error "Timeout", Position PID47436055
txt log:
2018.08.22 18:03:42.586 | Request to close position PID47436055 is sent to server
2018.08.22 18:04:51.382 | → Request to close position PID47436055 is ACCEPTED, order OID77060352 created (22/08/2018 18:03:42.649 UTC+0)
2018.08.22 18:04:51.601 | → Order OID77060352 is FILLED at 1.30005, position PID47436055 closed (22/08/2018 18:03:42.910 UTC+0)
client log:
26/09/2018 20:11:31.031 | Closing position PID48772098
26/09/2018 20:12:52.719 | → Closing position PID48772098 FAILED with error "Timeout", Position PID48772098
txt log:
2018.09.26 18:11:31.030 | Request to close position PID48772098 is sent to server
2018.09.26 18:12:52.721 | Request to Buy 0.01 Lot(s) EURGBP (Price: 0.89274, MR: 3) is sent to server
2018.09.26 18:12:53.573 | → Request to close position PID48772098 is ACCEPTED, order OID80034817 created (26/09/2018 18:11:31.990 UTC+0)
2018.09.26 18:12:53.915 | → Order OID80034817 is FILLED at 0.89269, position PID48772098 closed (26/09/2018 18:11:32.243 UTC+0)
2018.09.26 18:12:53.948 | → Request to Buy 0.01 Lot(s) EURGBP (Price: 0.89274, MR: 3) is ACCEPTED, order OID80038115 created (26/09/2018 18:12:53.628 UTC+0)
2018.09.26 18:12:54.026 | → Order OID80038115 is FILLED at 0.89270, position PID48794532 (26/09/2018 18:12:53.896 UTC+0)
client log:
27/09/2018 11:19:08.884 | Closing position PID48848175
27/09/2018 11:19:08.916 | → Closing position PID48848175 FAILED with error "EntityNotFound", Position PID48848175
txt log:
2018.09.27 09:19:07.712 | Request to close position PID48848175 is sent to server
2018.09.27 09:19:08.275 | → Request to close position PID48848175 is ACCEPTED, order OID80148615 created (27/09/2018 09:19:07.761 UTC+0)
2018.09.27 09:19:08.869 | → Order OID80148615 is FILLED at 0.89275, position PID48848175 closed (27/09/2018 09:19:07.993 UTC+0)
client log:
28/09/2018 21:09:04.102 | Executing Market Order to Buy 20000 USDCHF (MR: 3)
28/09/2018 21:10:44.711 | → Executing Market Order to Buy 20000 USDCHF (MR: 3) FAILED with error "Timeout"
txt log:
2018.09.28 19:09:04.133 | Request to Buy 0.20 Lot(s) USDCHF (Price: 0.97948, MR: 3) is sent to server
2018.09.28 19:10:45.087 | → Request to Buy 0.20 Lot(s) USDCHF (Price: 0.97948, MR: 3) is ACCEPTED, order OID80413794 created (28/09/2018 19:09:04.166 UTC+0)
2018.09.28 19:10:45.180 | → Order OID80413794 is FILLED at 0.97935, position PID48959888 (28/09/2018 19:09:04.412 UTC+0)
client log:
28/09/2018 17:02:01.223 | Closing position PID48945327
28/09/2018 17:03:49.614 | → Closing position PID48945327 FAILED with error "Timeout", Position PID48945327
txt log:
2018.09.28 15:02:21.786 | Request to close position PID48945327 is sent to server
2018.09.28 15:03:49.864 | → Request to close position PID48945327 is ACCEPTED, order OID80387750 created (28/09/2018 15:02:21.836 UTC+0)
2018.09.28 15:03:50.536 | → Order OID80387750 is FILLED at 1.50152, position PID48945327 closed (28/09/2018 15:02:22.081 UTC+0)
client log:
28/09/2018 17:05:15.426 | Executing Market Order to Sell 20000 USDJPY (MR: 3)
28/09/2018 17:06:18.598 | → Executing Market Order to Sell 20000 USDJPY (MR: 3) FAILED with error "Timeout"
txt log:
2018.09.28 15:05:15.458 | Request to Sell 0.20 Lot(s) USDJPY (Price: 113.536, MR: 3) is sent to server
2018.09.28 15:06:14.286 | Request to Sell 0.20 Lot(s) EURCAD (Price: 1.50042, MR: 3) is sent to server
2018.09.28 15:06:20.223 | → Request to Sell 0.20 Lot(s) USDJPY (Price: 113.536, MR: 3) is ACCEPTED, order OID80388321 created (28/09/2018 15:05:15.509 UTC+0)
2018.09.28 15:06:20.254 | → Order OID80388321 is FILLED at 113.540, position PID48950387 (28/09/2018 15:05:15.745 UTC+0)
2018.09.28 15:06:20.270 | → Request to Sell 0.20 Lot(s) EURCAD (Price: 1.50042, MR: 3) is ACCEPTED, order OID80388490 created (28/09/2018 15:06:14.339 UTC+0)
2018.09.28 15:06:20.364 | → Order OID80388490 is FILLED at 1.50057, position PID48950429 (28/09/2018 15:06:14.549 UTC+0)
Greetings
@.ics
.ics
12 Sep 2018, 03:31
Hi Spotware,
Could you provide some feedback?
Thanks in advance.
@.ics