Author |
Topic: switch from short to long in one operation (5 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
YBar Posts: 24 Joined: Dec 01, 2008 |
Hello,
I'm interested in implementing a switch from short to long (and vice versa) in one operation. is it doable using the API? currently, i'm using the following code to send an order. Is it correct, or am I missing some steps? ////////////////////////////////////////////////////////// d.Side = OEC.Data.OrderSide.Buy; d.Quantity = 1;// (int)nQty.Value; d.Contract = oecClient1.Contracts["ESZ9"]; d.Type = OEC.Data.OrderType.Market; OEC.API.OrderParts res = d.GetInvalidParts(); if (res != OEC.API.OrderParts.None) throw new Exception(string.Format("Invalid values in {0}", res)); OEC.API.Order order = oecClient1.SendOrder(d); ////////////////////////////////////////////////////////// Best regards, YBar |
||||
SergeK -Developer- Posts: 475 Joined: Jan 26, 2007 |
Yes, you can reverse your position using one order.
|
||||
YBar Posts: 24 Joined: Dec 01, 2008 |
Thanks SergeK, could you please send an example of how to do so?
YBar |
||||
SergeK -Developer- Posts: 475 Joined: Jan 26, 2007 |
you need to set the order quantity to 2 to reverse from short 1 to long 1.
|
||||
YBar Posts: 24 Joined: Dec 01, 2008 |
of course... thanks a lot for your quick help.
|
||||