Cancel pending orders

Forums ProRealTime English forum ProOrder support Cancel pending orders

Viewing 8 posts - 1 through 8 (of 8 total)
  • #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

    #66650

    QUIT 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.

    #66667

    QUIT 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.

    #66669

    No, 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.
    #66708

    Thanks 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:

    Now 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.

    #66716

    I’m also reporting it now too.

    2 users thanked author for this post.
    #69144

    In 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.
    #69177

    Thank 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.

Viewing 8 posts - 1 through 8 (of 8 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login