Author |
Topic: Order Clearing (3 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
NVerner2 Posts: 12 Joined: Apr 17, 2012 |
Hello,
I am creating a trading algorithm, and I want it to have a method that offsets all existing orders, so that I can shut off the program and not have to worry. I believe I have figured out what to do for old market orders that I sent, but I'm not sure what I should do about filled stop orders. If a stop order is triggered, its state goes from Held to Accepted and it becomes a market order. After that, the state becomes Completed when the market order is filled, right? I have references to my orders saved using the Order class. When a stop order becomes a market order, will my old reference work? Additionally, after the stop order becomes a market order and the market order is filled, how can I find that order to offset it? Will my original Order reference work or is there some better way to do this? Thanks. Nathan verner & Fred isabelle |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
After login to the server OECAPI doesn't contain completed/cancelled/rejected orders from previous trading sessions.
Order ID is a persistent value even after modifications from stop to market order type. You can find out state diagram here: http://www.openecry.com/api/api/OEC.Data.OrderState.html Victor Vins Lead Software Developer |
||||
NVerner2 Posts: 12 Joined: Apr 17, 2012 |
OK, thanks a lot Victor!
Nathan verner & Fred isabelle |
||||