Speed programming

 

1) When I run my program, usually sell stop and buy stop pop up. But, sometimes only one pending order pops up.When I was debugging, I noticed that one time first market tick created one pending order, and another tick created another pending order.

Strange??The market was not volatile.

2) The program also adjusts pending orders. It runs good until certain time (usually about 45 seconds) and then stops modifying some one pending order.

3)When market goes 1 tick down, then in about 1-2 seconds the pending orders go 1 tick down too.

It looks to me that the codes does not catch all market ticks.

My question is ; is there some available function (e.g. RefreshRates();) that makes the code to catch all the ticks and process them

Thank you all.