Executing Market Order FAILED with error "TechnicalError"
Executing Market Order FAILED with error "TechnicalError"
24 Nov 2017, 08:16
Hello,
This is snippet of ExecuteMarketOrder code
while (!Executed) { var res = ExecuteMarketOrder(TriggerType, Symbol, 1000, rnum, TriggerSL, TriggerTP, 1); if (res.IsSuccessful) { Executed = true; } }
So I encountered "TechnicalError" and because of the loop but the order is accepted resulting a lot of position opened, it kept on opening position until the res.IsSuccessful. Every single one of the position does not have SL except the last one.
Any idea why this is happening? In short the algo throw up "TechnicalError" but the order is accepted.
Replies
denn
25 Nov 2017, 03:41
Hello Panagiotis,
this is the snippet code for finding SL
L = MarketSeries.Low[index - 2]; H = MarketSeries.High[index - 2]; TriggerPip = 2; ... TriggerType = TradeType.Sell; TriggerOrder = L - TriggerPip * Symbol.PipSize; TriggerSL = Math.Round(((H + 2 * Symbol.PipSize) - TriggerOrder) * 10000, 1);
and this is snippet code for execute market order
else if (TriggerType == TradeType.Sell && MarketSeries.Close[MarketSeries.Close.Count - 1] <= TriggerOrder && TriggerOrder != 0) { bool Executed = false; while (!Executed) { var res = ExecuteMarketOrder(TriggerType, Symbol, 1000, rnum, TriggerSL, TriggerSL * 3, 1); if (res.IsSuccessful) { LabelID = rnum; Executed = true; TriggerOrder = 0; }
this is the log
24/11/2017 05:01:00.894 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:02.737 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228549 24/11/2017 05:01:02.737 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:04.800 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228551 24/11/2017 05:01:04.800 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:06.831 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228552 24/11/2017 05:01:06.831 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:08.831 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228553 24/11/2017 05:01:08.831 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:10.847 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228554 24/11/2017 05:01:10.847 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:12.878 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228555 24/11/2017 05:01:12.878 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:14.909 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228556 24/11/2017 05:01:14.909 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:16.894 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228557 24/11/2017 05:01:16.894 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:18.925 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228558 24/11/2017 05:01:18.925 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:20.972 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228559 24/11/2017 05:01:20.972 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:22.956 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228560 24/11/2017 05:01:22.956 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:24.909 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228561 24/11/2017 05:01:24.909 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:26.909 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228562 24/11/2017 05:01:26.909 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:28.925 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228563 24/11/2017 05:01:28.925 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:31.019 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228564 24/11/2017 05:01:31.019 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:32.987 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228565 24/11/2017 05:01:32.987 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:34.941 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228566 24/11/2017 05:01:34.941 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:36.972 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228567 24/11/2017 05:01:36.972 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:39.050 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228568 24/11/2017 05:01:39.050 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:40.956 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228569 24/11/2017 05:01:40.956 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:43.081 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228570 24/11/2017 05:01:43.081 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:45.050 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228571 24/11/2017 05:01:45.050 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:46.972 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228572 24/11/2017 05:01:46.972 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:49.050 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228574 24/11/2017 05:01:49.050 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:51.034 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228575 24/11/2017 05:01:51.034 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:53.034 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228576 24/11/2017 05:01:53.034 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:55.128 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228577 24/11/2017 05:01:55.128 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:57.019 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228578 24/11/2017 05:01:57.019 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:01:59.097 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228580 24/11/2017 05:01:59.097 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:01.066 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228581 24/11/2017 05:02:01.066 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:03.175 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228582 24/11/2017 05:02:03.175 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:05.097 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228583 24/11/2017 05:02:05.097 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:07.159 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228585 24/11/2017 05:02:07.159 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:09.097 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228586 24/11/2017 05:02:09.097 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:11.128 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228587 24/11/2017 05:02:11.128 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:13.175 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228588 24/11/2017 05:02:13.175 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:15.206 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228589 24/11/2017 05:02:15.206 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:17.128 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228590 24/11/2017 05:02:17.128 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:19.191 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) FAILED with error "TechnicalError", Position PID21228591 24/11/2017 05:02:19.191 | Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) 24/11/2017 05:02:20.222 | → Executing Market Order to Sell 1000 USDCAD (SL: 8, TP: 23, MR: 1) SUCCEEDED, Position PID21228592
and this is the journal log
24/11/2017 05:01:00.894 | Request to Sell $ 1k USDCAD (Price: 1.27091, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:01.722 | → Order OID35510540 is FILLED at 1.27092, position PID21228549 (23/11/2017 22:01:01.417 UTC+0) 24/11/2017 05:01:01.487 | → Request to Sell $ 1k USDCAD (Price: 1.27091, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510540 created (23/11/2017 22:01:01.201 UTC+0) 24/11/2017 05:01:02.737 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:03.784 | → Order OID35510548 is FILLED at 1.27092, position PID21228551 (23/11/2017 22:01:03.497 UTC+0) 24/11/2017 05:01:03.503 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510548 created (23/11/2017 22:01:03.222 UTC+0) 24/11/2017 05:01:04.800 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:05.831 | → Order OID35510550 is FILLED at 1.27092, position PID21228552 (23/11/2017 22:01:05.533 UTC+0) 24/11/2017 05:01:05.566 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510550 created (23/11/2017 22:01:05.291 UTC+0) 24/11/2017 05:01:06.831 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:07.816 | → Order OID35510552 is FILLED at 1.27092, position PID21228553 (23/11/2017 22:01:07.532 UTC+0) 24/11/2017 05:01:07.550 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510552 created (23/11/2017 22:01:07.271 UTC+0) 24/11/2017 05:01:08.831 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:09.847 | → Order OID35510555 is FILLED at 1.27092, position PID21228554 (23/11/2017 22:01:09.544 UTC+0) 24/11/2017 05:01:09.597 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510555 created (23/11/2017 22:01:09.314 UTC+0) 24/11/2017 05:01:10.847 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:11.862 | → Order OID35510557 is FILLED at 1.27092, position PID21228555 (23/11/2017 22:01:11.579 UTC+0) 24/11/2017 05:01:11.581 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510557 created (23/11/2017 22:01:11.303 UTC+0) 24/11/2017 05:01:12.878 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:13.894 | → Order OID35510559 is FILLED at 1.27092, position PID21228556 (23/11/2017 22:01:13.584 UTC+0) 24/11/2017 05:01:13.628 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510559 created (23/11/2017 22:01:13.322 UTC+0) 24/11/2017 05:01:14.909 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:15.878 | → Order OID35510561 is FILLED at 1.27092, position PID21228557 (23/11/2017 22:01:15.591 UTC+0) 24/11/2017 05:01:15.581 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510561 created (23/11/2017 22:01:15.307 UTC+0) 24/11/2017 05:01:16.894 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:17.909 | → Order OID35510563 is FILLED at 1.27092, position PID21228558 (23/11/2017 22:01:17.626 UTC+0) 24/11/2017 05:01:17.628 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510563 created (23/11/2017 22:01:17.349 UTC+0) 24/11/2017 05:01:18.925 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:19.956 | → Order OID35510565 is FILLED at 1.27092, position PID21228559 (23/11/2017 22:01:19.650 UTC+0) 24/11/2017 05:01:19.628 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510565 created (23/11/2017 22:01:19.357 UTC+0) 24/11/2017 05:01:20.972 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:21.941 | → Order OID35510567 is FILLED at 1.27092, position PID21228560 (23/11/2017 22:01:21.649 UTC+0) 24/11/2017 05:01:21.644 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510567 created (23/11/2017 22:01:21.370 UTC+0) 24/11/2017 05:01:22.956 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:23.894 | → Order OID35510569 is FILLED at 1.27092, position PID21228561 (23/11/2017 22:01:23.599 UTC+0) 24/11/2017 05:01:23.628 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510569 created (23/11/2017 22:01:23.365 UTC+0) 24/11/2017 05:01:24.909 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:25.894 | → Order OID35510571 is FILLED at 1.27092, position PID21228562 (23/11/2017 22:01:25.602 UTC+0) 24/11/2017 05:01:25.659 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510571 created (23/11/2017 22:01:25.390 UTC+0) 24/11/2017 05:01:26.909 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:27.909 | → Order OID35510573 is FILLED at 1.27092, position PID21228563 (23/11/2017 22:01:27.618 UTC+0) 24/11/2017 05:01:27.644 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510573 created (23/11/2017 22:01:27.363 UTC+0) 24/11/2017 05:01:28.925 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:29.691 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510575 created (23/11/2017 22:01:29.416 UTC+0) 24/11/2017 05:01:30.003 | → Order OID35510575 is FILLED at 1.27092, position PID21228564 (23/11/2017 22:01:29.714 UTC+0) 24/11/2017 05:01:31.972 | → Order OID35510577 is FILLED at 1.27092, position PID21228565 (23/11/2017 22:01:31.678 UTC+0) 24/11/2017 05:01:31.706 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510577 created (23/11/2017 22:01:31.414 UTC+0) 24/11/2017 05:01:31.019 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:32.987 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:33.925 | → Order OID35510579 is FILLED at 1.27092, position PID21228566 (23/11/2017 22:01:33.628 UTC+0) 24/11/2017 05:01:33.691 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510579 created (23/11/2017 22:01:33.417 UTC+0) 24/11/2017 05:01:34.941 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:35.956 | → Order OID35510581 is FILLED at 1.27092, position PID21228567 (23/11/2017 22:01:35.660 UTC+0) 24/11/2017 05:01:35.722 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510581 created (23/11/2017 22:01:35.413 UTC+0) 24/11/2017 05:01:36.972 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:37.722 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510583 created (23/11/2017 22:01:37.449 UTC+0) 24/11/2017 05:01:38.034 | → Order OID35510583 is FILLED at 1.27092, position PID21228568 (23/11/2017 22:01:37.735 UTC+0) 24/11/2017 05:01:39.956 | → Order OID35510585 is FILLED at 1.27092, position PID21228569 (23/11/2017 22:01:39.662 UTC+0) 24/11/2017 05:01:39.706 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510585 created (23/11/2017 22:01:39.427 UTC+0) 24/11/2017 05:01:39.050 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:40.956 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:41.753 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510587 created (23/11/2017 22:01:41.467 UTC+0) 24/11/2017 05:01:42.066 | → Order OID35510587 is FILLED at 1.27092, position PID21228570 (23/11/2017 22:01:41.766 UTC+0) 24/11/2017 05:01:43.737 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510590 created (23/11/2017 22:01:43.465 UTC+0) 24/11/2017 05:01:43.081 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:44.034 | → Order OID35510590 is FILLED at 1.27092, position PID21228571 (23/11/2017 22:01:43.748 UTC+0) 24/11/2017 05:01:45.956 | → Order OID35510592 is FILLED at 1.27092, position PID21228572 (23/11/2017 22:01:45.665 UTC+0) 24/11/2017 05:01:45.737 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510592 created (23/11/2017 22:01:45.463 UTC+0) 24/11/2017 05:01:45.050 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:46.972 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:47.784 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510595 created (23/11/2017 22:01:47.517 UTC+0) 24/11/2017 05:01:48.034 | → Order OID35510595 is FILLED at 1.27092, position PID21228574 (23/11/2017 22:01:47.758 UTC+0) 24/11/2017 05:01:49.769 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510597 created (23/11/2017 22:01:49.481 UTC+0) 24/11/2017 05:01:49.050 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:50.019 | → Order OID35510597 is FILLED at 1.27092, position PID21228575 (23/11/2017 22:01:49.729 UTC+0) 24/11/2017 05:01:51.769 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510599 created (23/11/2017 22:01:51.489 UTC+0) 24/11/2017 05:01:51.034 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:52.019 | → Order OID35510599 is FILLED at 1.27092, position PID21228576 (23/11/2017 22:01:51.714 UTC+0) 24/11/2017 05:01:53.800 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510601 created (23/11/2017 22:01:53.531 UTC+0) 24/11/2017 05:01:53.034 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:54.112 | → Order OID35510601 is FILLED at 1.27092, position PID21228577 (23/11/2017 22:01:53.823 UTC+0) 24/11/2017 05:01:55.784 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510603 created (23/11/2017 22:01:55.498 UTC+0) 24/11/2017 05:01:55.128 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:56.003 | → Order OID35510603 is FILLED at 1.27092, position PID21228578 (23/11/2017 22:01:55.706 UTC+0) 24/11/2017 05:01:57.831 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510607 created (23/11/2017 22:01:57.563 UTC+0) 24/11/2017 05:01:57.019 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:01:58.081 | → Order OID35510607 is FILLED at 1.27092, position PID21228580 (23/11/2017 22:01:57.785 UTC+0) 24/11/2017 05:01:59.800 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510609 created (23/11/2017 22:01:59.527 UTC+0) 24/11/2017 05:01:59.097 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:00.050 | → Order OID35510609 is FILLED at 1.27092, position PID21228581 (23/11/2017 22:01:59.730 UTC+0) 24/11/2017 05:02:01.847 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510612 created (23/11/2017 22:02:01.576 UTC+0) 24/11/2017 05:02:01.066 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:02.159 | → Order OID35510612 is FILLED at 1.27092, position PID21228582 (23/11/2017 22:02:01.862 UTC+0) 24/11/2017 05:02:03.816 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510614 created (23/11/2017 22:02:03.541 UTC+0) 24/11/2017 05:02:03.175 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:04.081 | → Order OID35510614 is FILLED at 1.27092, position PID21228583 (23/11/2017 22:02:03.789 UTC+0) 24/11/2017 05:02:05.847 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510619 created (23/11/2017 22:02:05.576 UTC+0) 24/11/2017 05:02:05.097 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:06.144 | → Order OID35510619 is FILLED at 1.27092, position PID21228585 (23/11/2017 22:02:05.848 UTC+0) 24/11/2017 05:02:07.831 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510621 created (23/11/2017 22:02:07.550 UTC+0) 24/11/2017 05:02:07.159 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:08.081 | → Order OID35510621 is FILLED at 1.27092, position PID21228586 (23/11/2017 22:02:07.794 UTC+0) 24/11/2017 05:02:09.878 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510623 created (23/11/2017 22:02:09.605 UTC+0) 24/11/2017 05:02:09.097 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:10.112 | → Order OID35510623 is FILLED at 1.27092, position PID21228587 (23/11/2017 22:02:09.826 UTC+0) 24/11/2017 05:02:11.847 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510625 created (23/11/2017 22:02:11.577 UTC+0) 24/11/2017 05:02:11.128 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:12.159 | → Order OID35510625 is FILLED at 1.27092, position PID21228588 (23/11/2017 22:02:11.864 UTC+0) 24/11/2017 05:02:13.894 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510627 created (23/11/2017 22:02:13.622 UTC+0) 24/11/2017 05:02:13.175 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:14.191 | → Order OID35510627 is FILLED at 1.27092, position PID21228589 (23/11/2017 22:02:13.898 UTC+0) 24/11/2017 05:02:15.878 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510629 created (23/11/2017 22:02:15.606 UTC+0) 24/11/2017 05:02:15.206 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:16.097 | → Order OID35510629 is FILLED at 1.27092, position PID21228590 (23/11/2017 22:02:15.815 UTC+0) 24/11/2017 05:02:17.941 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510631 created (23/11/2017 22:02:17.658 UTC+0) 24/11/2017 05:02:17.128 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server 24/11/2017 05:02:18.175 | → Order OID35510631 is FILLED at 1.27092, position PID21228591 (23/11/2017 22:02:17.888 UTC+0) 24/11/2017 05:02:19.894 | → Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is ACCEPTED, order OID35510633 created (23/11/2017 22:02:19.631 UTC+0) 24/11/2017 05:02:19.191 | Request to Sell $ 1k USDCAD (Price: 1.27092, SL: 8, TP: 23, MR: 1) is sent to server
@denn
PanagiotisCharalampous
27 Nov 2017, 12:00
Ηι denn,
Thanks for the additional information but it would be more helpful to have a complete cBot that reproduces the error. It doesn't need to be your cBot, just a sample cBot with all the necessary functionality to reproduce the issue. This way we will be able to debug the code and see what happens. Also let me know which broker do you use.
Best Regards,
Panagiotis
@PanagiotisCharalampous
denn
28 Nov 2017, 04:36
Hello Panagiotis,
I'm stripping down the code, it may take awhile.
I'm using Pepperstone as broker. After a closer look the technical error occur in the broker rollover time and since my execute order code is OnBar, it may try to execute the order during the of broker rollover and resulting technical error while the order is filled. Is it plausible conclusion?
Thanks.
@denn
PanagiotisCharalampous
28 Nov 2017, 14:59
Hi denn,
It could be anything, so I don't want to make any guesses at the moment. I will wait for your stripped down version to check this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
denn
29 Nov 2017, 13:44
Hello Panagiotis,
Below is the code, trigger parameter changed to simple RSI check, SL and ExecuteMarketOrder is unaltered.
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter("Trigger (in pip)", DefaultValue = 2.0)] public double TriggerPip { get; set; } [Parameter("Source")] public DataSeries Source { get; set; } public string LabelID; public int PriceMultiplier; public double TriggerOrder, TriggerSL, TriggerTP; public TradeType TriggerType; public RelativeStrengthIndex RSI14; protected override void OnStart() { RSI14 = Indicators.RelativeStrengthIndex(Source, 14); LabelID = ""; if (Symbol.Digits == 5) { PriceMultiplier = 10000; } else if (Symbol.Digits == 3) { PriceMultiplier = 100; } else { Stop(); } } protected override void OnTick() { } protected override void OnBar() { var pos = Positions.Find(LabelID); if (pos != null) { } else { double O = 0, H = 0, L = 0, C = 0; int index = MarketSeries.Close.Count; O = MarketSeries.Open[index - 2]; H = MarketSeries.High[index - 2]; L = MarketSeries.Low[index - 2]; C = MarketSeries.Close[index - 2]; if (RSI14.Result[index - 2] > 70) { TriggerType = TradeType.Sell; TriggerOrder = L - TriggerPip * Symbol.PipSize; TriggerSL = Math.Round(((H + 2 * Symbol.PipSize) - TriggerOrder) * PriceMultiplier, 1); } else if (RSI14.Result[index - 2] < 30) { TriggerType = TradeType.Buy; TriggerOrder = H + TriggerPip * Symbol.PipSize; TriggerSL = Math.Round((TriggerOrder - (L - 2 * Symbol.PipSize)) * PriceMultiplier, 1); } if (TriggerType == TradeType.Buy && MarketSeries.Close[MarketSeries.Close.Count - 1] >= TriggerOrder && TriggerOrder != 0) { bool Executed = false; Random r = new Random(); string rnum = "P" + r.Next(0, 100); while (!Executed) { var res = ExecuteMarketOrder(TriggerType, Symbol, 1000, rnum, TriggerSL, TriggerSL * 3, 1); if (res.IsSuccessful) { LabelID = rnum; Executed = true; TriggerOrder = 0; } } } else if (TriggerType == TradeType.Sell && MarketSeries.Close[MarketSeries.Close.Count - 1] <= TriggerOrder && TriggerOrder != 0) { bool Executed = false; Random r = new Random(); string rnum = "P" + r.Next(0, 100); while (!Executed) { var res = ExecuteMarketOrder(TriggerType, Symbol, 1000, rnum, TriggerSL, TriggerSL * 3, 1); if (res.IsSuccessful) { LabelID = rnum; Executed = true; TriggerOrder = 0; } } } } } protected override void OnStop() { // Put your deinitialization logic here } } }
Regards,
Denny
@denn
... Deleted by UFO ...
PanagiotisCharalampous
29 Nov 2017, 15:21
Hi denn,
Thank you for the cBot. Can you also tell the TriggerPip and the timeframe you use? Knowing your broker would also be useful.
Best Regards,
Panagiotis
@PanagiotisCharalampous
... Deleted by UFO ...
PanagiotisCharalampous
30 Nov 2017, 12:42
Hi denn,
Thanks for the information. I have been running the cBot for almost a day now but did not get the error yet. Does this still happen for you?
Best Regards,
Panagiotis
@PanagiotisCharalampous
denn
30 Nov 2017, 15:18
Hello Panagiotis,
It does happen once again at 28 Nov 2017 00:01:31.181 UTC+2, both of these occurence is when the cBot tries to execute order on my broker roll over time, but I do have prior trade open successfully at 00:01 UTC+2, thus i have suspicion it might have something to do with broker roll over time while trying to execute the order.
I had added patched my code to account for this peculiar case.
Regards,
Denny.
@denn
PanagiotisCharalampous
30 Nov 2017, 15:27
Hi denn,
I suggest that you contact Pepperstone direclty. They can track the necessary information from their backoffice and tell you why this is happening. If needed, they will contact our support team for a more formal investigation of the issue.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Nov 2017, 10:16
Hi denn,
Can you send us the full cBot code so that we can check this as well?
Best Regards,
Panagiotis
@PanagiotisCharalampous