Of these 26 days, NT has successfully executed the command to initiate exit-on-close orders at 120 seconds before market close on twelve occasions; for the remaining fourteen exit-on-close handling first begins no earlier than 4:28 PM.
The logs of these twenty-six market days suggest three inferences:
a) The problem has nothing to do with setting the session clock since the strategies are run from a platform in NYC where market-time and local time are the same.
b) The problem has nothing to do with "Connectionlost" since, on the rare occasion when this occurs, the connection is restored long before 1538 when exit-on-close handling is programmed to initiate.
c) This is a NT and not an IB problem since the fault occurs in the timing of the initiation of the exit-on-close orders, that is on NT initiative, and not in their execution by the broker.
Other than these there are no obvious clues. If the 12 days of timely exits orders were sequential and followed by fourteen days of late orders, then one could search for anomalies on day thirteen to explain the error.
But the distribution of "bad" days seems arbitrary. Eight days is the longest run of timely exits, otherwise "good" days are scattered among the bad.
Have others using IB, or any other broker for that matter, experienced a similar problem?
To diagnose the problem I plan the following:
a) Replace NT in live trading with TS connected to IB through TradeBullet;
b) introduce the following code into OnBar in some strategies to see if they behave differently at market close :
if (ToTime(Time[0]) >= 155800) // your time here
{
ExitShort();
ExitLong();
}
c) link NT to IB through TradeBullet API to isolate the order sending problem.
I would most appreciate any comments or suggestions on this problem and/or plan to diagnose it.
Thanks in advance,
Comment