开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

twsapi: Re: Ways of filtering bad quotes from TWS


mbluhm2001
 

I guess the first question is why do you turn off your timer. I would
think that the only issue you could have is if your processing of the
ticks would last more than 200ms and that's alot of CPU cycles. But
your program works and my has problems so I would like to understand
this better.

In my program I never turn off my Timer. In my timer routine I call
m_pClient->checkMessages(); which I assume will call the tickPrice and
tickSize events in my program for each stock that has a new tick price
& size. After that I process the stocks with the new price looking for
entry/exits/stops trades.

This is an example of the tick price I'm seeing from BRCD. I see this
on all of the stocks that I'm monitering. Here is what I saw tonight
with the times shown. Since the values are very close together I'm
assuming I must be doing something wrong.

16:44:41 BRCD Out of Range Price = -1.000009
17:05:53 BRCD Out of Range Price = -1.000016
17:10:33 BRCD Out of Range Price = -1.000018
17:18:20 BRCM Out of Range Price = -1.000099

Thanks,
Mark


--- In twsapi@y..., "Michel" <migurull@t...> wrote:
I dont know how you handle your quotes and sizes so I can't help.
The way in which I handle them is through the use of a 'one shoot'
timer of
200 ms. In my tickPrice event I update a variable LastPrice = price
and
enable the timer. In my tickSize event I update a variable LastSize
= size
and also enable the timer if it is not. Then in the Timer.Timer
event I
disable the timer and do the job with LastPrice and LastSize.
This way I allow a 200ms. time window after every price or size
event to
wait for the second event (size or price) to update the other
variable and
if the second event dont comes, simply the other variable is
unchanged when
I use them in my Timer.timer event.

Michel.

[Michel] -----Mensaje original-----
De: mbluhm2001 [mailto:mbluhm2001@y...]
Enviado el: jueves, 04 de julio de 2002 21:35
Para: twsapi@y...
Asunto: twsapi: Re: Ways of filtering bad quotes from TWS


Tbanks for the reply. Thanks what I'm doing with the 0 price
quotes,
throwing them away. I didn't mention that I'm also getting what
seems
to be quotes that non zero but incorrect. So I'm trying to filter
them
with some type of algrothrim so I don't get caught executing a bad
trade. I also wanted to make sure that its not something I'm doing
incorrectly with my interface to TWS.

Thanks,
Mark

Join [email protected] to automatically receive all group messages.