API Support Forum
OEC API > New Feature Requests > Implement Market to Limit Order Type
Author Topic: Implement Market to Limit Order Type
(3 messages, Page 1 of 1)
Moderators: VPfau
Posts: 226
Joined: Apr 24, 2012

Posted: Apr 26, 2018 @ 10:09 PM             Msg. 1 of 3
Hi Gain support and devs,

We have a real account customer that likes to trade Oil GCL. He has an issue with large order quantities occasionally eating him up with fees and price increases as the MKT order fills due to illiquidity (i.e. it fills at MKT, but the MKT price rises for each partial fill because there's not many offers in the DOM at the market price or tiers just above it.)

We'd like to use the MarketToLimit order type to help him, but it is not implemented in the api: "Unsupported order type".

Until then we'll use StopLimit, but it has a few drawbacks:
1) It will reject if the market price passes by the selected stop price. So if the market is moving he loses out on the trade completely.
2) It doesn't immediately fill at the market price, because the stop must be set to a bit higher than the market to assist it to not be rejected. He loses some profit there.

Clearly the MarketToLimit is his best option, unless you have a price tolerance or range on the backend for MKT order fills we can set for this customer.

Posts: 332

Posted: Jun 20, 2018 @ 10:14 AM             Msg. 2 of 3
We do not offer a Market to Limit order type in our API and I don't believe this is an exchange-supported order as well. I'll send your inquiry to our Trade Desk.
Chris M
Posts: 226
Joined: Apr 24, 2012

Posted: Jun 20, 2018 @ 06:27 PM             Msg. 3 of 3
In https://gainfutures.com/api/index.html#, in OECAPI Reference, see OrderType Enumeration.

The MarketToLimit order type is listed: "MarketToLimit 5 When partially filled, remaining part filled as limit order by partial fill price".

It's listed in the api, and I agree, its not available when I try to use it.

We would hope that a MarketToLimit order would fill thusly:
- Place a Buy MarketToLimit order of qty 5 and its limit price as either 5 tics above the current market price when processing the order or (not as good) some set final limit price
- As the order fills, the current market price rises 6 tics above the market price when the order started filling.
- The order stops filling when the limit ticks/limit price has been reached.

Some apis use a range of acceptable fill price for MKT orders. They place a "price tolerance level" on a MKT order for that range. This would be an alternative implementation that provides the same great results as MarketToLimit orders.