Jump to content
Sign in to follow this  
Vincent

ApiOrderDTO OcoOrder

Recommended Posts

Hello!

 

The OcoOrder property is only used if you are entering a One Cancels the Other (OCO) order. The OcoOrder property contains the details for the second order.

 

 

What are OCO Orders?

 

One Cancels Other (OCO) order is comprised of two separate entry orders “linked” together and requested as a single order. When one of the two orders is executed, the other order is cancelled. OCO orders must be requested on the same market.

This means that you can leave two separate new orders in a market so that if one of the orders is triggered and filled, the other is automatically cancelled, leaving you with one open position.

The only restriction is that the entry orders that form the OCO order must be on opposite sides of the current market price.

Share this post


Link to post

Hi, @Physicsman,

I am also interested in this field. My issue is the following:

Assume that the Bitcoin's current price is 7900$. I post a newstoplimitorder with the following properties:

  • TriggerPrice: 7950$
  • IfDone: [ Stop: 7900$, Limit: 8200$ ]

Now I want to have an additional condition: If the price does not increases as I expected (there's a chance :D) but decreases below 7900$, the order should be canceled before it is triggered. Is there a way to do this simply, if I know the parameters at the time I post the newstoplimitorder?

Thanks,
Adam

Share this post


Link to post

Hi @horvathady,

If I understand your query correctly, you are worried that the stop order at 7900 would be triggered if the market should fall to 7900 or below before it goes up to 7950 and triggers that order?

I am happy to put your mind at ease that this will NOT happen. The pair of If/Done orders at 7900 and 8200 are only entered into the order book IF the entry order at 7950 is triggered (ie. "Done"). Hence the name "If/Done". 

Essentially they work as follows.

If the market moves up to 7950, then your entry order is triggered and you now have a trade (open position) buying BitCoin at 7950. A stop is then put in at 7900 and a take profit limit at 8200.

Should the market fall before hitting 7950 and triggering your entry order, the 7900 and 8200 orders are never put into the order book so they won't trigger. They only become active (exist) if the entry 7950 order triggers.

Kind Regards, PM

 

 

Share this post


Link to post

Hi, @Physicsman,

The situation is not exactly what you mean. Regardless of the fact that the order will not be triggered, I want to cancel the order if the price goes below 7900$. My plan is exactly to avoid triggering (which is now possible later) if the price falls below that value.

Thanks,
Adam

Share this post


Link to post

Hi Horvathady,

No, we do not support advanced conditional orders of the type you describe. That is, cancelling an entry order if the market price moves to a certain level - below 7900 in this case.

A possible solution since you are using the API is to write code in your program to check the market price, and send an order cancellation should the price drop below 7900. 

Kind Regards, PM

 

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  
×