开云体育

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

Re: twsapi: Re: Ways of filtering bad quotes from TWS


Carl Erikson
 

Hey Mark,

I don't know what is causing your problem. However, I
just wanted to mention that in my programs,

m_pClient->checkMessages()

is called everytime there is an event and is not
associated with any timer. If you check out the
latest SocketClient source from IB, they do this too
(they changed this from earlier versions where the
checkMessages() was on a timer). On the latest TWS,
check out:

SocketClient/src/EclientSocket.cpp, line 647

Seems like this shouldn't help (and probably won't),
but I haven't had bad quote problems like the ones you
are experiencing. Are these bad quotes coming from
the demo TWS or the real thing (or both)?

Good luck,
Carl

--- mbluhm2001 <mbluhm2001@...> wrote:
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

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

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