Cancel pending orders
Forums › ProRealTime English forum › ProOrder support › Cancel pending orders
- This topic has 7 replies, 3 voices, and was last updated 6 years ago by waterofleith.
-
-
03/29/2018 at 1:57 AM #66642
Hi guys,
My code includes a QUIT instruction to be executed if certain conditions are met. If this happens when there is already a pending order (e.g. a BUY STOP order), then the system quits, but the pending order remains active. How can I avoid this? That is, how can I cancel any pending orders in the code (not manually)? I haven’t found anything.
Thanks in advance
03/29/2018 at 7:36 AM #6665003/29/2018 at 9:58 AM #66667QUIT instruction should also close all pending orders, such as STOP and LIMIT ones. However, pending orders have an expiration time of 1 bar, so if your code doesn’t renew them, they will be cancelled by themselves.
Just so I understand correctly what you have written – is it possible for a strategy to QUIT at the opening of a candle and also place orders on the market which will then be there till the close of the candle?
If so this would mean that there could possibly be open positions which are not being controlled by a strategy.
03/29/2018 at 10:07 AM #66669No, once QUIT is read by the code, all active orders at market and pending ones are closed/deleted.
2 users thanked author for this post.
03/29/2018 at 4:14 PM #66708Thanks for your answers. That’s the way I thought it should work – but apparently, it’s not how it actually works. Last night, I went to check my pending orders, only to find a pending order had been filled AFTER the system had quit, and right, it was there, without any stop loss or take profit at all (!!) Fortunately, I managed to close it at only a small loss, but it could have been a disaster.
I’ve just tried this:
123456789/// 1-MINUTE CHART ON EURUSDIF (NOT ONMARKET) THENBUY 1 SHARES AT 1.25 STOPENDIFIF (CURRENTTIME >= 161000) THENQUITENDIFNow it’s 16.12, the system has quit, but the pending order is still there, on my screen and order list, until I close it manually.
So, if this is a bug (and a dangerous one), and not my mistake, I’ll have to report it to PRT. Although, I have to say, I’ve reported other bugs before and never got any useful feedback from them.
03/29/2018 at 5:17 PM #66716I’m also reporting it now too.
2 users thanked author for this post.
04/25/2018 at 2:20 PM #69144In platform’s automatic trading settings, if “position and order status after stop of systems” is set to “Keep trading system positions(s) and pending order(s)”, your pending orders initiated by a trading program will remain on market, even if you QUIT.
1 user thanked author for this post.
04/25/2018 at 9:54 PM #69177Thank you Nicolas, I was told so by IG support. Then again, I’d like my open positions to be kept after quitting, but not my pending orders. I guess this can’t be done.
-
AuthorPosts
Find exclusive trading pro-tools on