Jump to content
Sign in to follow this  
smironov

When I delete one of OCO orders, would second one be deleted automatically?

Recommended Posts

Here is ListActiveStopLimitOrders response for account XX381270: {

"ActiveStopLimitOrders" : [{
        "Applicability" : 2,
        "Currency" : "CHF",
        "Direction" : "sell",
        "ExpiryDateTimeUTC" : null,
        "LastChangedDateTimeUTC" : "\/Date(1304592236612)\/",
        "LimitOrder" : null,
        "MarketId" : 400481112,
        "MarketName" : "AUD\/CHF",
        "OcoOrder" : {
            "OrderId" : 450053866,
            "Quantity" : 10000,
            "TriggerPrice" : 0.9186
        },
        "OrderId" : 450053867,
        "ParentOrderId" : 450053865,
        "Quantity" : 10000,
        "Status" : 11,
        "StopOrder" : null,
        "TradingAccountId" : 400197672,
        "TriggerPrice" : 0.91507,
        "Type" : 2
    }, {
        "Applicability" : 2,
        "Currency" : "CHF",
        "Direction" : "buy",
        "ExpiryDateTimeUTC" : null,
        "LastChangedDateTimeUTC" : "\/Date(1304601886611)\/",
        "LimitOrder" : null,
        "MarketId" : 400481112,
        "MarketName" : "AUD\/CHF",
        "OcoOrder" : null,
        "OrderId" : 450054098,
        "ParentOrderId" : null,
        "Quantity" : 10000,
        "Status" : 2,
        "StopOrder" : null,
        "TradingAccountId" : 400197672,
        "TriggerPrice" : 0.5,
        "Type" : 3
    }
]
}

The first order (#450053867) is a ‘rest’ of stop-limit pair. It has status=Triggered, but trade it is attached to, isn’t closed and I can’t delete the order. The second order (#450054098) is a ‘piece’ of OCO pair and it has normal OrderStatus=2. After I deleted other OCO leg, the order is still listed in the response and I can’t delete it too. I get either HTTP 500 or all seems OK (HTTP 200) but the order isn’t get deleted.

So, it seems other OCO order isn’t get deleted after I delete one of them. How do I delete it?

Share this post


Link to post

It looks like order 450053867 was triggered (status 11), it’s now sitting in the approval console waiting for a dealer to approve it (in this case the order has exceeded the gap tolerance for that market). In the live system this order would either be rejected or filled by the dealer, but because this is in a preprod environment there are no dealers. The oco order 450053866 is now set to suspended (status 6). You won’t be able to delete this order now.

The second order is not the oco of the first, but is in fact a separate order. You can delete this order if you like.

Share this post


Link to post
Guest sky.sanders

Here is ListActiveStopLimitOrders response for account XX381270: {

"ActiveStopLimitOrders" : [{
        "Applicability" : 2,
        "Currency" : "CHF",
        "Direction" : "sell",
        "ExpiryDateTimeUTC" : null,
        "LastChangedDateTimeUTC" : "\/Date(1304592236612)\/",
        "LimitOrder" : null,
        "MarketId" : 400481112,
        "MarketName" : "AUD\/CHF",
        "OcoOrder" : {
            "OrderId" : 450053866,
            "Quantity" : 10000,
            "TriggerPrice" : 0.9186
        },
        "OrderId" : 450053867,
        "ParentOrderId" : 450053865,
        "Quantity" : 10000,
        "Status" : 11,
        "StopOrder" : null,
        "TradingAccountId" : 400197672,
        "TriggerPrice" : 0.91507,
        "Type" : 2
    }, {
        "Applicability" : 2,
        "Currency" : "CHF",
        "Direction" : "buy",
        "ExpiryDateTimeUTC" : null,
        "LastChangedDateTimeUTC" : "\/Date(1304601886611)\/",
        "LimitOrder" : null,
        "MarketId" : 400481112,
        "MarketName" : "AUD\/CHF",
        "OcoOrder" : null,
        "OrderId" : 450054098,
        "ParentOrderId" : null,
        "Quantity" : 10000,
        "Status" : 2,
        "StopOrder" : null,
        "TradingAccountId" : 400197672,
        "TriggerPrice" : 0.5,
        "Type" : 3
    }
]
}

The first order (#450053867) is a ‘rest’ of stop-limit pair. It has status=Triggered, but trade it is attached to, isn’t closed and I can’t delete the order. The second order (#450054098) is a ‘piece’ of OCO pair and it has normal OrderStatus=2. After I deleted other OCO leg, the order is still listed in the response and I can’t delete it too. I get either HTTP 500 or all seems OK (HTTP 200) but the order isn’t get deleted.

So, it seems other OCO order isn’t get deleted after I delete one of them. How do I delete it?

smironov – you should edit the question and append this information, it is kinda out of context as an answer.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×