Profile Picture

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

Posted By dnickless Last Year
Message
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;
OpenPosition(settings);


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

Thanks


Daniel
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.

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


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems