开云体育

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

Re: Invalid symbols

bee_jay_61
 

Maybe the second method works too. I never used 40 or more symbols in
ReqMktData so I don?t know what kind of error message will appear if
the TWS checks for 40 symbols.

But maybe the TWS checks first for an invalid symbol regardless how
many symbols are in ReqMktData. Than it should allways work. You have
to try it out.

This method is easier than the first one.

BeeJay



--- In twsapi@y..., szeyu73 <no_reply@y...> wrote:
thanks BeeJay.

it seems that your first method will work and i may change to your
algorithm later.

the second one will work at the beginning. but i think there is a
limit of 40 symbols in reqMktData, as i read in other threads here.
it may fail some time later.

i'd suggest IB to raise an ErrMsg in this case.

thanks very much again from hong kong

---
dustin

--- In twsapi@y..., bee_jay_61 <no_reply@y...> wrote:
I don?t have this problem but maybe you can do this:

When you place an order with an order id 12345 and an invalid
symbol
(ex. "XYZ") than you get no error message and NO ORDERSTATUS. So
if
you don?t get an ORDERSTATUS for the order id 12345 within a
certain
time, try to cancel that order with order id 12345. Normally than
you
will get an error message "Can't find order with id 12345". This
could be an indicator that the symbol was invalid.

Or another way that could help you:

Call ReqMktData for that symbol. If the symbol does not exist you
will get an error message like "Security definition request
returned
0 items for ticker id 123". Check the error message for that
text.
That?s what I do when I call ReqMktData.

Greetings from Germany

BeeJay


--- In twsapi@y..., szeyu73 <no_reply@y...> wrote:
hello.

i found some problem in placing invalid symbols. for example,
if
i
place an order to BUY 100 shares of XYZ, which is not valid.

the TWS API won't tell my program thru the API (such as ErrMsg
and
OrderStatus), but just make a popup in the Trader Workstation
program. hence i have no no way to know that the symbol is
invalid.

my solution is to keep a list of avaliable symbols. i'll check
if
the
symbol is in the list before placing the order.

it works, but i have to update the list from time to time. is
there
any better solutions?

thanks

---
dustin


What exactly does traderguard do?

thepermuk
 

Is it just a program that creates a trailing stop?

I designed it for scalpers to profit from every
Ok

single trend change with "adaptive Automation Engine" monitoring
market tick by tick and in real time.
Your gonna have to explian this one.

You will love it.
It will automate your profit collection at the topmost
point and also auto-escape from bad point of entry. This
is what i like the most.
Automate, so how does it do this? Does it trade for me?
Whats this automation buisness.

Please explain this.

How or what is the best way to use it. How about an example

And what is your private email Mr. Traderguard.

Thanks


Java 1.4 slower?

Michel
 

I've updated to Java 1.4 from 1.3 and the trader workstation seems very much
slower (painting form, for example and returning to my application) than
previous version.
Somebody else noticed this?

Also which are the benefits of using v 1.4 for now?

Michel.


Re: Invalid symbols

szeyu73
 

thanks BeeJay.

it seems that your first method will work and i may change to your
algorithm later.

the second one will work at the beginning. but i think there is a
limit of 40 symbols in reqMktData, as i read in other threads here.
it may fail some time later.

i'd suggest IB to raise an ErrMsg in this case.

thanks very much again from hong kong

---
dustin

--- In twsapi@y..., bee_jay_61 <no_reply@y...> wrote:
I don?t have this problem but maybe you can do this:

When you place an order with an order id 12345 and an invalid
symbol
(ex. "XYZ") than you get no error message and NO ORDERSTATUS. So if
you don?t get an ORDERSTATUS for the order id 12345 within a
certain
time, try to cancel that order with order id 12345. Normally than
you
will get an error message "Can't find order with id 12345". This
could be an indicator that the symbol was invalid.

Or another way that could help you:

Call ReqMktData for that symbol. If the symbol does not exist you
will get an error message like "Security definition request
returned
0 items for ticker id 123". Check the error message for that text.
That?s what I do when I call ReqMktData.

Greetings from Germany

BeeJay


--- In twsapi@y..., szeyu73 <no_reply@y...> wrote:
hello.

i found some problem in placing invalid symbols. for example, if
i
place an order to BUY 100 shares of XYZ, which is not valid.

the TWS API won't tell my program thru the API (such as ErrMsg
and
OrderStatus), but just make a popup in the Trader Workstation
program. hence i have no no way to know that the symbol is
invalid.

my solution is to keep a list of avaliable symbols. i'll check if
the
symbol is in the list before placing the order.

it works, but i have to update the list from time to time. is
there
any better solutions?

thanks

---
dustin


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


Re: twsapi: parameter list for orderstatus?

Richard Foulk
 

This does sound a bit like a bug and should probably be reported to IB.


Richard

} Yes, not very good names for variables, but till now seems to not cause much
} problems.
}
} Michel.
} -----Mensaje original-----
} De: marinindextrader [mailto:marinindextrader@...]
} Enviado el: jueves, 04 de julio de 2002 22:25
} Para: twsapi@...
} Asunto: Re: twsapi: parameter list for orderstatus?
}
}
} the word Status is a reserved property name for certain objects
}
} When I type it into my editor it automatically caps the lead
} letter....
}
} Try changing the variable declaration to a different name, such as
} TWSstatus or something
}
} There are three and counting uses of VB keywords or propertey names
} in the standard TWS API:
}
} "right", "currencey" and Now "status"
}
} Pretty lame IMHO
}
} Scott
}
} PS please let us know if this resolves the issue
}


Re: Invalid symbols

bee_jay_61
 

I don?t have this problem but maybe you can do this:

When you place an order with an order id 12345 and an invalid symbol
(ex. "XYZ") than you get no error message and NO ORDERSTATUS. So if
you don?t get an ORDERSTATUS for the order id 12345 within a certain
time, try to cancel that order with order id 12345. Normally than you
will get an error message "Can't find order with id 12345". This
could be an indicator that the symbol was invalid.

Or another way that could help you:

Call ReqMktData for that symbol. If the symbol does not exist you
will get an error message like "Security definition request returned
0 items for ticker id 123". Check the error message for that text.
That?s what I do when I call ReqMktData.

Greetings from Germany

BeeJay


--- In twsapi@y..., szeyu73 <no_reply@y...> wrote:
hello.

i found some problem in placing invalid symbols. for example, if i
place an order to BUY 100 shares of XYZ, which is not valid.

the TWS API won't tell my program thru the API (such as ErrMsg and
OrderStatus), but just make a popup in the Trader Workstation
program. hence i have no no way to know that the symbol is invalid.

my solution is to keep a list of avaliable symbols. i'll check if
the
symbol is in the list before placing the order.

it works, but i have to update the list from time to time. is there
any better solutions?

thanks

---
dustin


Invalid symbols

szeyu73
 

hello.

i found some problem in placing invalid symbols. for example, if i
place an order to BUY 100 shares of XYZ, which is not valid.

the TWS API won't tell my program thru the API (such as ErrMsg and
OrderStatus), but just make a popup in the Trader Workstation
program. hence i have no no way to know that the symbol is invalid.

my solution is to keep a list of avaliable symbols. i'll check if the
symbol is in the list before placing the order.

it works, but i have to update the list from time to time. is there
any better solutions?

thanks

---
dustin


Invalid symbols

szeyu73
 

hello.

i found some problem in placing invalid symbols. for example, if i
place an order to BUY 100 shares of XYZ, which is not valid.

the TWS API won't tell my program thru the API (such as ErrMsg and
OrderStatus), but just make a popup in the Trader Workstation
program. hence i have no no way to know that the symbol is invalid.

my solution is to keep a list of avaliable symbols. i'll check if the
symbol is in the list before placing the order.

it works, but i have to update the list from time to time. is there
any better solutions?

thanks

---
dustin


Re: TICK DATA

Shukrainternationals
 

开云体育

This is a new subject. I do not know whether this fits into this message board.
?
I collect data for a futures symbol FEU50STO. It is a future on 50 EU Stocks index. It is traded in FSE (Frankfurt) exchange. Now, if I fail to collect the ticks from IB workstation in real time, then, where can I get this data at the end of the day?
Thanks.
?


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

Michel
 

开云体育

I see you are using C++ API, and I'm using ActiveX VB but for the purpose of this discussion this is not a problem.
?
First of all we need to understand how IB sends price and size changes:
- if price changes but not size, IB sends a tickPrice event/message with the new price.
- if size changes but not price, IB sends a tickSize event/message with the new size.
- if price AND size change, IB sends a tickPrice and a tickSize event/message with new price and new size.
- if price NOR size change, IB sends... nothing.
?
I asked IB about the timming of this events and they say:
- they send bursts of messages with new values (if any change) every 0.7 seconds.
- order in which tickPrice and tickSize are fired is not guaranteed (actually, tickPrice comes before tickSize but this can be different in new versions so we must assume there is not a defined order in this events).
?
The problem with this 'differential' approach (only changes are transmitted) is that when we receive a tickPrice (or tickSize)event/message, we never know if it will be alone or followed by a tickSize (or tickPrice).For example, as you explain the way you handle this events, when you empty the message queue (?m_pClient->checkMessages()) and find for example a newPrice (or when you receive a tickPrice event), you can't process it immediatly (assuming a new tick with newPrice and oldSize) because you dont know if it will be followed by a newSize message/event... so the only way is to WAIT A CERTAIN TIME to allow ALL messages related to a tick to reach your application.
This is the reason for the use of a 'one shoot' timer of 200 ms: every reception of a newPrice or newSize event resets this timer, allowing a time frame of 200 ms. to eventually receive other messages/events related to the same tick.
Only when this tempo had compleded, you are sure to have received all events and can begin to process the new tick.
The 200 ms. is arbitrary and based on some tets: generally tickSize, when present, comes a few milliseconds after tickPrice but you must allow some delay (for example, tickSize message could be routed differently on the net and take more time).
Also during this 200 ms, your program can complete other pending tasks related to the precedent tick (for example archiving it in a file). The idea behind it is, assuming a new tick every 0.7 second, to allow 200 ms to complete the tick and 500 ms to process it. This 500 ms is more than sufficient: I make lots of tests and?displays (including a real time graph of the last 15 minutes ticks) in less than 50 ms in Visual Basic with an Athlon 700 MHz on WinXP.
?
The reason why I turn off the timer is now obvious: I only need it AFTER a tickPrice or tickSize event to define a time slot during which I consider all messages pertaining to the same tick. The timer can be off for minutes if no new tickPrice nor tickSize events are received. Dont confuse this timer with the timer needed in the API to poll the message queue.
?
Hope this can help and also interessed in other ways to implement it.
?
Michel.
?
?

-----Mensaje original-----
De: mbluhm2001 [mailto:mbluhm2001@...]
Enviado el: viernes, 05 de julio de 2002 7:15
Para: twsapi@...
Asunto: twsapi: Re: Ways of filtering bad quotes from TWS

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" 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.


Re: Ways of filtering bad quotes from TWS

marinindextrader
 

TriPak44...

Can you contact me via email outside of the discussion board?

Thanks

Scott

--- In twsapi@y..., tripack44 <no_reply@y...> wrote:
I filter for zero last price, ask and bid price in both the data
source and the data client. I haven't had problems with other
quotes
being off but I'm only essentially dealing with the Minis and I
understand stocks have had some quote problems.

As I view it, there are 2 kinds of bad ticks that happen - single
bad
ticks and clumps of bad ticks. To get rid of single bad ticks, just
make sure that if you get a tick that is outside your tolerance
range, like greater than +/- 2% or 5%%, and if the next tick is
back
inside your desired range, you have a high probability that it was
a
bad tick.

You can make the assumption that clumps of bad ticks are actually
good ticks. Or you could pop up a dialog that would warn of
possible
bad ticks and whether or not to filter. It is not an exact science
with stocks because if you get a harmonic alignment between the
exchange and a market maker or other large influential party who
made
a mistake, hundreds of trades can be busted, thus leading to "bad
ticks". But in this case you will only find out after the fact that
they were indeed bad ticks. So instead of tick filtration you will
need tick correction.

--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
I guess I will reply to myself and ask a different question:

Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS
interface. If not, it seems I must be doing something wrong.

Thanks,
Mark


--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
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


Re: Ways of filtering bad quotes from TWS

mbluhm2001
 

Yes, this is exactly what I'm trying to accomplish. Thanks for the
confirmation. What I'm using today is 5% range and if I see 5 prices
in a row in that new range then I assume that they are correct, i.e.
in your language, clumps of bad ticks are actually good ticks. The
only problem with this method is that you will be behind by 5 ticks
in time since I was waiting to verify them. I think this may work OK
for stocks but, as you know, in Futures, this could cost you a lot of
money. Just look bad at any of the days when Greenspan made suprise
rate cuts/hikes. I wish I could do something for the busted trades
issue but I think that may just be part of the game.

Thanks,
Mark


--- In twsapi@y..., tripack44 <no_reply@y...> wrote:
I filter for zero last price, ask and bid price in both the data
source and the data client. I haven't had problems with other quotes
being off but I'm only essentially dealing with the Minis and I
understand stocks have had some quote problems.

As I view it, there are 2 kinds of bad ticks that happen - single
bad
ticks and clumps of bad ticks. To get rid of single bad ticks, just
make sure that if you get a tick that is outside your tolerance
range, like greater than +/- 2% or 5%%, and if the next tick is back
inside your desired range, you have a high probability that it was a
bad tick.

You can make the assumption that clumps of bad ticks are actually
good ticks. Or you could pop up a dialog that would warn of possible
bad ticks and whether or not to filter. It is not an exact science
with stocks because if you get a harmonic alignment between the
exchange and a market maker or other large influential party who
made
a mistake, hundreds of trades can be busted, thus leading to "bad
ticks". But in this case you will only find out after the fact that
they were indeed bad ticks. So instead of tick filtration you will
need tick correction.

--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
I guess I will reply to myself and ask a different question:

Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS
interface. If not, it seems I must be doing something wrong.

Thanks,
Mark


--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
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


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


AW: twsapi: Grabbing past fill prices...

 

开云体育

I think that you can only get an execution report once, after that this executions are "deleted" or invisible, you can`t get them any more.
?
For this thing, the demo and the live account work similar.
?
An other problem is, that the executions have other order id?s than when you placed the order. At least this was a problem when I looked into it.
?
You get the average fill price when the order get?s executed through orderstatus.
?
Marcus

-----Ursprüngliche Nachricht-----
Von: cyberbri_2000 [mailto:no_reply@...]
Gesendet: Thursday, July 04, 2002 11:56 PM
An: twsapi@...
Betreff: twsapi: Grabbing past fill prices...

I'm trying to get fill prices on orders placed prior to the current
session.? When I do a Tws1.reqExecutions as the demo user when I
first start a session, it returns the full execution report (there's
dozens of entries here, I'm assuming from other demo users).? If I
place one or more orders and do another Tws1.reqExecutions I get only
the info from the orders I just placed, and it only works once in the
current session.

Perhaps the demo user works differently than a live account?

Tws1.reqAccountUpdates only returns the current market price and
market value.?

Ideally I want the average fill price of each stock from the
portfolio.

Any ideas?

Thanx!,
Brian



To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


Re: twsapi: parameter list for orderstatus?

cyberbri_2000
 

Works fine now, thanx for the help! I had price as double instead of
single, which you pointed out.

Private Sub tws1_orderStatus(ByVal id As Long, ByVal Status As
String, ByVal Filled As Long, ByVal Remaining As Long, ByVal price As
Single)

the word Status is a reserved property name for certain objects

When I type it into my editor it automatically caps the lead
letter....

Try changing the variable declaration to a different name, such as
TWSstatus or something

There are three and counting uses of VB keywords or propertey names
in the standard TWS API:

"right", "currencey" and Now "status"

Pretty lame IMHO

Scott

PS please let us know if this resolves the issue


Grabbing past fill prices...

cyberbri_2000
 

I'm trying to get fill prices on orders placed prior to the current
session. When I do a Tws1.reqExecutions as the demo user when I
first start a session, it returns the full execution report (there's
dozens of entries here, I'm assuming from other demo users). If I
place one or more orders and do another Tws1.reqExecutions I get only
the info from the orders I just placed, and it only works once in the
current session.

Perhaps the demo user works differently than a live account?

Tws1.reqAccountUpdates only returns the current market price and
market value.

Ideally I want the average fill price of each stock from the
portfolio.

Any ideas?

Thanx!,
Brian


Re: Ways of filtering bad quotes from TWS

tripack44
 

I filter for zero last price, ask and bid price in both the data
source and the data client. I haven't had problems with other quotes
being off but I'm only essentially dealing with the Minis and I
understand stocks have had some quote problems.

As I view it, there are 2 kinds of bad ticks that happen - single bad
ticks and clumps of bad ticks. To get rid of single bad ticks, just
make sure that if you get a tick that is outside your tolerance
range, like greater than +/- 2% or 5%%, and if the next tick is back
inside your desired range, you have a high probability that it was a
bad tick.

You can make the assumption that clumps of bad ticks are actually
good ticks. Or you could pop up a dialog that would warn of possible
bad ticks and whether or not to filter. It is not an exact science
with stocks because if you get a harmonic alignment between the
exchange and a market maker or other large influential party who made
a mistake, hundreds of trades can be busted, thus leading to "bad
ticks". But in this case you will only find out after the fact that
they were indeed bad ticks. So instead of tick filtration you will
need tick correction.

--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
I guess I will reply to myself and ask a different question:

Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS
interface. If not, it seems I must be doing something wrong.

Thanks,
Mark


--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
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


Re: twsapi: Re: Help! Cancel order

 

开云体育

Jaba,
?
Your program has put me 2 weeks ahead, but being a tinkerer at heart I must always improve things.
?
That explains why I had the need to replace the straight 6 in my 74 260Z with a 289 V8.
?
Bruce

----- Original Message -----
From: jaba_z
Sent: Thursday, July 04, 2002 8:32 AM
Subject: twsapi: Re: Help! Cancel order

Hey Bruce, and I thought that the project I put on my pitiful website
was good enough... :)

regards
Jaba

--- In twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote:
> "Flyin an airplane is really simple too if you know how to do it. LOL"
>
> Yep....its the landings that are tricky....
>
> Scott
>
>
>
> --- In twsapi@y..., "Bruce Hawkins" wrote:
> > Flyin an airplane is really simple too if you know how to do it. LOL
> >
> > Thanks for pointing me in the right direction I will see if I can
> figure this out.
> >
> > Have a safe holiday.
> >
> > Bruce
> >?? ----- Original Message -----
> >?? From: mk_trading_911
> >?? To: twsapi@y...
> >?? Sent: Thursday, July 04, 2002 7:00 AM
> >?? Subject: twsapi: Re: Help! Cancel order
> >
> >
> >?? Bruce, it's really simple.
> >
> >?? existingId = Cells(ActiveCell.row, 13).value
> >
> >?? it means that existingId get's loaded with whatever there is in
> the
> >?? column 13 of the active row on the spreadsheet. then it passes
> that
> >?? number to tws1.cancelOrder, and it cancels it.
> >
> >?? Since you don't have spreadsheet, you need to store that ID
> number
> >?? when you send your buy/sell order for execution. Or, a bit more
> >?? complicated, request open orders, get their IDs and use one of
> them
> >?? to cancel that order.
> >
> >?? MK
> >
> >?? --- In twsapi@y..., "Bruce Hawkins" wrote:
> >?? > First of all thanks for the response, here is the code in Excel
> >?? >
> >?? > Sub cancelOrder()
> >?? >???? clearError
> >?? >????
> >?? >???? ' get existing id
> >?? >???? Dim existingId As Long
> >?? >???? existingId = Cells(ActiveCell.row, 13).value
> >?? >
> >?? >???? ' cancel order
> >?? >???? Sheet5.Tws1.cancelOrder (existingId)
> >?? > End Sub
> >?? >
> >?? > Maybe I did not make it clear but I am trying to come up with a
> >?? stand alone program, that being said in the code above there
> >?? > is references to sheets and cells which don't exist in my prog.
> I
> >?? am not sure what to put in there place.
> >?? >
> >?? > Thanks,
> >?? >
> >?? > Bruce
> >?? >?? ----- Original Message -----
> >?? >?? From: mk_trading_911
> >?? >?? To: twsapi@y...
> >?? >?? Sent: Thursday, July 04, 2002 6:21 AM
> >?? >?? Subject: twsapi: Re: Help! Cancel order
> >?? >
> >?? >
> >?? >?? Open the workbook, and press Alt-F11. Visual Basic for
> >?? Applications
> >?? >?? should appear. All the code for cancelling an order is on
> sheet2
> >?? >?? (Orders).
> >?? >
> >?? >?? What part of the code do you have a problem with, exactly?
> >?? >?? MK
> >?? >
> >?? >?? --- In twsapi@y..., "Bruce Hawkins" wrote:
> >?? >?? > Thanks for the response, and if I was a little more savy
> >?? regarding
> >?? >?? VB what you sent would be helpful.
> >?? >?? >
> >?? >?? > I have looked at user's guide and Excel code trying to come
> up
> >?? with
> >?? >?? what I need and I can't figure it out.
> >?? >?? >
> >?? >?? > But thanks anyway.
> >?? >?? >
> >?? >?? > Bruce
> >?? >?? >?? ----- Original Message -----
> >?? >?? >?? From: mk_trading_911
> >?? >?? >?? To: twsapi@y...
> >?? >?? >?? Sent: Thursday, July 04, 2002 6:04 AM
> >?? >?? >?? Subject: twsapi: Re: Help! Cancel order
> >?? >?? >
> >?? >?? >
> >?? >?? >?? Either: store in your application's globals the ID number
> of
> >?? the
> >?? >?? >?? orders you are sending, and their status, or extract them
> >?? from
> >?? >?? TWS
> >?? >?? >?? (Tws1.reqOpenOrders). Once you know the ID, then use:
> >?? >?? >?? Tws1.cancelOrder (orderId). It's all in the Excel
> spreadsheet
> >?? VBA
> >?? >?? >?? Macros, and user's manual.
> >?? >?? >?? I hope this helps.
> >?? >?? >
> >?? >?? >?? MK
> >?? >?? >
> >?? >?? >
> >?? >?? >?? --- In twsapi@y..., "Bruce Hawkins"
> wrote:
> >?? >?? >?? >? I have been struggling with this for 2 days, does
> anyone
> >?? have
> >?? >?? VB
> >?? >?? >?? code for canceling a pending order. I 've tried 6
> >?? >?? >?? > ways from Sunday to make it work and I am totally lost.
> >?? >?? >?? >
> >?? >?? >?? > Thanks,
> >?? >?? >?? >
> >?? >?? >?? > Bruce
> >?? >?? >
> >?? >?? >
> >?? >?? >???????? Yahoo! Groups Sponsor
> >?? >?? >?????????????? ADVERTISEMENT
> >?? >?? >?????????????
> >?? >?? >???????
> >?? >?? >
> >?? >?? >?? To unsubscribe from this group, send an email to:
> >?? >?? >?? twsapi-unsubscribe@y...
> >?? >?? >
> >?? >?? >
> >?? >?? >
> >?? >?? >?? Your use of Yahoo! Groups is subject to the Yahoo! Terms
> of
> >?? >?? Service.
> >?? >
> >?? >
> >?? >???????? Yahoo! Groups Sponsor
> >?? >??????????
> >?? >
> >?? >?? To unsubscribe from this group, send an email to:
> >?? >?? twsapi-unsubscribe@y...
> >?? >
> >?? >
> >?? >
> >?? >?? Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> >?? Service.
> >
> >
> >???????? Yahoo! Groups Sponsor
> >?????????????? ADVERTISEMENT
> >?????????????
> >???????
> >
> >?? To unsubscribe from this group, send an email to:
> >?? twsapi-unsubscribe@y...
> >
> >
> >
> >?? Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.




To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


Re: twsapi: parameter list for orderstatus?

Michel
 

开云体育

Yes, not very good names for variables, but till now seems to not cause much problems.
?
Michel.

-----Mensaje original-----
De: marinindextrader [mailto:marinindextrader@...]
Enviado el: jueves, 04 de julio de 2002 22:25
Para: twsapi@...
Asunto: Re: twsapi: parameter list for orderstatus?

the word Status is a reserved property name for certain objects

When I type it into my editor it automatically caps the lead
letter....

Try changing the variable declaration to a different name, such as
TWSstatus or something

There are three and counting uses of VB keywords or propertey names
in the standard TWS API:

"right", "currencey" and Now "status"

Pretty lame IMHO

Scott

PS please let us know if this resolves the issue