Profile Picture

IB: Unable to send TIF:DAY - orders are always GTC

Posted By dnickless 3 Years Ago
Posted Tuesday July 19 2016
Hi there

Using RE 57 and IB Gateway 952.2j, I do not seem to be able to send DAY orders. My trading system is set to "Daily (1D)" bars (I get the same behavior using "Automatic", too) and I use the following code to send the orders:

PositionSettings settings = new PositionSettings();
settings.BarsValid = 1;
settings.PositionType = PositionType.Long;
settings.OrderType = OrderType.Limit;
settings.LimitPrice = KBuyDown.Current;

The orders do get sent to IB but always as GTC. What could I be missing?


Posted Friday August 05 2016
The BarsValid property is used by RightEdge to cancel the order after the specified number of bars, but doesn't affect the order that is sent to the broker.  By default all orders RightEdge sends will be GTC.  You can change that for the order to open a position like this:

settings.OpenOrder.GoodTillCanceled = false;

It looks like it's not currently possible to specify whether orders for existing positions (ie those sent via Position.SubmitOrder()) are GTC or not.  For the next build, I've added a GoodTillCanceled property to OrderSettings to allow this to be specified.

Posted Wednesday September 14 2016
Thanks, I'll give it a try very soon.

Similar Topics

Reading This Topic

2005-2019 © RightEdge Systems