API Support Forum
OEC API > Advanced Order Management > Get Flat / Flatten
Author Topic: Get Flat / Flatten
(3 messages, Page 1 of 1)
Moderators: VPfau
WBetts
Posts: 19
Joined: May 29, 2008


Posted: Jun 04, 2008 @ 02:44 PM             Msg. 1 of 3
Just curious if there was a "get flat" or "flatten" function in the API.

In other words, Let's Say I'm long 3 contracts in the ES. I would sell 3 contracts at market to get out as quickly as possible.


I know I can track the open markets / positions and then create orders to exit the market accordingly. Was just hoping there was one nice function to call.

Thanks,
-TraderBetts
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 04, 2008 @ 05:25 PM             Msg. 2 of 3
No, there's no such nice function. If you want to flatten a position, before sending market order do not forget to look for any executing orders for this contract, either extending position or closing it. If you do not cancel these orders, you risk to end up with partially closed or even reversed position.
WBetts
Posts: 19
Joined: May 29, 2008


Posted: Jun 04, 2008 @ 10:41 PM             Msg. 3 of 3
Thanks Serge.

Yes, I do know to check for any working / executing orders before sending the market order. There are a few complexities there which is why I was hoping your servers would do it.

No problem, I'll take care of it on my side.

Thank again,
-TraderBetts