Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Twsapi
- Messages
Search
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.if text.you don?t get an ORDERSTATUS for the order id 12345 within acertaintime, try to cancel that order with order id 12345. Normally thanyouwill get an error message "Can't find order with id 12345". Thisreturned ifThat?s what I do when I call ReqMktData. iifandplace an order to BUY 100 shares of XYZ, which is not valid. thetheresymbol is in the list before placing the order. |
What exactly does traderguard do?
thepermuk
Is it just a program that creates a trailing stop?
I designed it for scalpers to profit from everyOk single trend change with "adaptive Automation Engine" monitoringmarket tick by tick and in real time. Your gonna have to explian this one. You will love it.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 |
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:symbol (ex. "XYZ") than you get no error message and NO ORDERSTATUS. So ifcertain time, try to cancel that order with order id 12345. Normally thanyou will get an error message "Can't find order with id 12345". Thisreturned 0 items for ticker id 123". Check the error message for that text.i andplace an order to BUY 100 shares of XYZ, which is not valid. invalid.OrderStatus), but just make a popup in the Trader Workstation therethe any better solutions? |
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 __________________________________________________ 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.the symbol is in the list before placing the order. |
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.
?
?
|
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 dataquotes being off but I'm only essentially dealing with the Minis and Ibad ticks and clumps of bad ticks. To get rid of single bad ticks, justback inside your desired range, you have a high probability that it wasa bad tick.possible bad ticks and whether or not to filter. It is not an exact sciencemade a mistake, hundreds of trades can be busted, thus leading to "badthat thethequote can be outside the previous quote. But to handle gaps, ifthenquote is out of range Y number of times (i'm starting with 5)usezerothat new quote. Also I don't allow quotes that are a value ofeither. |
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 databad ticks and clumps of bad ticks. To get rid of single bad ticks, justmade a mistake, hundreds of trades can be busted, thus leading to "badthat thethequote can be outside the previous quote. But to handle gaps, ifthenquote is out of range Y number of times (i'm starting with 5)usezerothat new quote. Also I don't allow quotes that are a value ofeither. |
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.timer of 200 ms. In my tickPrice event I update a variable LastPrice = priceand 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.Timerevent I disable the timer and do the job with LastPrice and LastSize.event to wait for the second event (size or price) to update the othervariable and if the second event dont comes, simply the other variable isunchanged when I use them in my Timer.timer event.quotes, throwing them away. I didn't mention that I'm also getting whatseems to be quotes that non zero but incorrect. So I'm trying to filterthem with some type of algrothrim so I don't get caught executing a bad |
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
|
Re: twsapi: parameter list for orderstatus?
cyberbri_2000
Works fine now, thanx for the help! I had price as double instead of
toggle quoted message
Show quoted text
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 |
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:filter I'mand wanted to see if anyone else had any better ideas. The way previoustrying it is the following: thequote by X% and the error counter is less than Ythe thenquote is out of range Y number of times (i'm starting with 5) usezerothat new quote. Also I don't allow quotes that are a value of either. |
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
|
Re: twsapi: parameter list for orderstatus?
Michel
开云体育Yes,
not very good names for variables, but till now seems to not cause much
problems.
?
Michel.
|
to navigate to use esc to dismiss