开云体育

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

Ways of filtering bad quotes from TWS


mbluhm2001
 

I have been getting a price quote of zero for some of the stock
tickers throughout the trading day. So I decided to put in a filter
and wanted to see if anyone else had any better ideas. The way I'm
trying it is the following:

IF
the current price quote is greater than or less than the previous
quote by X% and the error counter is less than Y

THEN
throw away the quote and increment the error counter

ELSE
use the price quote and clear the error counter

The idea is to set some min and max % (i'm starting with 5%) that the
quote can be outside the previous quote. But to handle gaps, if the
quote is out of range Y number of times (i'm starting with 5) then use
that new quote. Also I don't allow quotes that are a value of zero
either.

Any thoughts would be helpful.

Thanks,
Mark

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