This morning (8/19/09) about 11:52 AM there was a sudden rise in trading volume (equities). I was testing (Sim account) using Barchart data feed in real time. Everything went wonky. Fortunately I had been recording the session so I was able to go back. I inserted a ton of print commands in my somewhat simple script. I am using "CalculateOnBarClose = false" because my logic evaluates on the tick. It looks like the ticks were coming in so fast that the simulator was unable to keep up with the rapid fire orders being demanded.
As it happened, I went short on a crossover at 11:51:51. I printed my position on the next statement; it showed flat, 0 qty.
Three ticks later at the same time stamp (11:51:51) my crossover reversed, my position showed 334 short (right) and I entered an "ExitShort", followed by an "EnterLong". My position still showed short 334. Notwithstanding, I should be long 334 at this point.
14 ticks later at 11:52:39 my crossover reversed again and my program called for an exit of my long position. I printed the market position at that time (before executing the "ExitLong") and eureka, it was long 668 shares. Not right.
Program fails to execute properly from this point on.
As I am just about ready to go live with IB this whole scenario is somewhat disconcerting.
I found a few other posts that related to execution speed, but they usually related to users PCs. I have a dual core with 3GB running Vista Home 64.
Any suggestions?
How do I insert a window with my code in it?
I am a new member and appreciate the quick and generally enlightening responses I have received from a few posts where I needed clarification to get things going. Thx
Comment