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: How to get all VALID options
juxeiier
Hi Michael,
you might wanna try this little tool I have written, see /g/twsapi/topic/little_tool_for_option_chain/81408600?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,81408600 It basically frees you from doing all of this and provides a fast caching mechanism if? you reload your application. Cheers, Juergen |
Re: Help getting realtime data stream via TWS API for TICK-NYSE and TRIN-NYSE
Go into TWS and right click on any instrument (TRIN or TICK) and select Financial Instrument Info -> Description.? The correct information to put into the Contract object will be specified on the left side of the window that pops up.? In the case of TICK you get: Underlying = TICK-AMEX Security Type = IND Currency = USD Exchange = AMEX Symbol = TICK-AMEX That's what you set for TICK-AMEX. Hunter
On Thursday, March 18, 2021, 2:20:03 AM PDT, Ullas Diwakar <ullasdiwakar96@...> wrote:
Hi,
I want to get the data stream for the index TICK and TRIN. I read around the group and saw that i need to create the contract with the name TICK-NYSE and TRIN-NYSE with secType as "IND". After that, I tried to subscribe to realtime data using both reqMktData and?reqRealTimeBars but I am not getting any ticks for it. I want to know how to get the real time data stream for these two indices.? Thanks |
Help getting realtime data stream via TWS API for TICK-NYSE and TRIN-NYSE
Hi, I want to get the data stream for the index TICK and TRIN. I read around the group and saw that i need to create the contract with the name TICK-NYSE and TRIN-NYSE with secType as "IND". After that, I tried to subscribe to realtime data using both reqMktData and?reqRealTimeBars but I am not getting any ticks for it. I want to know how to get the real time data stream for these two indices.? Thanks |
Re: How to get all VALID options
Filtering on SMART when dealing with US stocks is OK, but when you deal with foreign or commodities exchanges (MONEP, GLOBEX, NYMEX...), SMART doesn't work anymore.
This is my algo, compliant with any symbol any exchange: I collect all answers from reqSecDefOptParams. If SMART is present in the answers, I only keep SMART. If SMART is NOT present, I keep all answers. |
Re: event when a stock reaches a certain price
50 messages per second do not apply to this. However, there is some other limit, based on available market data lines. But polling snapshots have another problem (at least it had a couple of years ago) - snapshot could be cached if polled too frequently. So instead of new prices, you are getting something stale. On Thu, Mar 18, 2021 at 3:16 AM <sudhin_deshpande@...> wrote: Instead of subscribing, why not poll each ticker to get the last price? --
SI: ?+386-30-315-640 |
Re: event when a stock reaches a certain price
You might have just solved that riddle for me, Bruce, why sometimes only four of the five TickByTick subscriptions succeed. I don't always subscribe to Level II data, so that seems to free up extra TickByTicks.
toggle quoted message
Show quoted text
I tried to stay with IB terminology, so when I referred to market data for the ~75 contracts it means data streams from reqTopMktData() requests. No TickByTick or Level II data. But we determine all valid tick ids for each equity type (STK, FUT, IND, ..) and request everything they are willing to give. So while there is no TickByTick or Level II for those 75, the amount of data is quite substantial. A long time ago we switched to mostly immutable objects, flow processing, and a logging strategy that favors logging complete objects over human readable text. That way we can drill down after the fact and are not limited to deciphering incomplete information in the log messages. Objects are being serialized into Json strings and saved with some rich extra context. Log files are being rolled every 15min and compressed with "gzip --best" n the background at low system priorities. That all is handled asynchronously in a couple threads and does not slow down IB API callback processing even under the heaviest of loads. I just grabbed a random day that had 35 million IB callbacks:
Processing can takes place in parallel on multi-processors and most systems have ample idle and otherwise unused CPU power for this. ´³¨¹°ù²µ±ð²Ô On Wed, Mar 17, 2021 at 08:22 PM, Bruce B wrote:
|
Re: event when a stock reaches a certain price
Instead of subscribing, why not poll each ticker to get the last price?
I think IB has a limit of 50 messages per second (correct me if I am wrong) For 800 tickers, that would be 16 seconds. So you would poll each ticker about every 16 seconds. Would that work for you? |
Re: event when a stock reaches a certain price
JR, You must have 8 market depth level 2 subscriptions. I seem to have 6 subscriptions and can pull 6 full book depth level 2 but if I use?TickByTickBidAsk?that also counts towards marketdepthlevel2. Do you see the same? By "That is *all available market data for ~75 contracts" I think you mean partial data as you do not get market depth level 2 for all 75. What you mean by "I ask for five and most of the days I get five"? Some days you intentionally dont ask for five or something is not available on some days or not worth pulling based on your strategies? Sounds like you have a good system running. I am interested to know how you store all this streaming data or if you do not see a point in storing it? - Bruce On Wed, Mar 17, 2021, 7:11 PM JR <TwsApiOnGroupsIo@...> wrote: Can you be more specific what you consider huge? Did you buy quote boosters so that you can subscribe to more than 100 contracts? |
Re: historical open interest
So I did some reverse engineering of TWS and found that the WhatToShow enum is just turned into a string in the protocol.? It seems that when open interest data is being requested, WhatToShow is set to either "Option_Open_Interest Call" or "Option_Open_Interest Put" in the protocol.? Is this a valid thing to do for reqHistoricalData (not just reqHistoricalTicks) and this is just a short coming of the Java API (that the WhatToShow enum is missing some things)?? Or is this some weird hack that shouldn't work which is why it isn't documented by IB? thanx, Hunter
On Saturday, March 13, 2021, 8:48:31 PM PST, Hunter C Payne via groups.io <hunterpayne2001@...> wrote:
Hi all, ?? I was wondering if anyone knew a way to get historical open interest data on equities from IB.? Is it buried in reqFundamentalData somewhere these days?? I know I can find it in TWS itself but I can't seem to determine which API calls return this specific data. thanx, Hunter |
Re: event when a stock reaches a certain price
I am not aware of a scanner that does what you are looking for. Please keep in mind the IB API is mostly for the support af TWS and if TWS does not need it, it's probably not there.
toggle quoted message
Show quoted text
If you are only interested in price changes, subscribing to tick id 4 (Last Price) should suffice.That tick will only be sent when the trade price changes, Take a look at . Even at 800 contracts, data volume will be quite reasonable. But your 800 contracts simultaneously will run against the data lines limitation. Take a look at the ":How Market Data is Allocated" in For 800 market lines you'd need:
´³¨¹°ù²µ±ð²Ô On Wed, Mar 17, 2021 at 07:28 PM, corneliu maftuleac wrote: I think the list of tickers is around 800 (I am using ibinsync python api, but the general idea is the same). |
Re: event when a stock reaches a certain price
corneliu maftuleac
I think the list of tickers is around 800 (I am using ibinsync python api, but the general idea is the same).
So, your suggestion is to just use regular market data (ex: reqMktData(conId, contract, 221)) and it should be fine? I was thinking there should be a more advanced solution like a scanner subscription or something, because in fact I dont need the data itself rather just a notification when price reaches certain level. |
Re: How to create a performance efficient trading app so each sub process runs smoothly in Python?
You can also think of using something like ZeroMQ as your messaging/concurency backbone. Python has a bindings module for it - pyzmq. On Wed, Mar 17, 2021 at 2:40 AM Alex Gorbachev <ag@...> wrote:
|
Re: event when a stock reaches a certain price
Can you be more specific what you consider huge? Did you buy quote boosters so that you can subscribe to more than 100 contracts?
toggle quoted message
Show quoted text
From what you are doing, I'd say you'd only need to subscribe to monitor the Last Price and Last Size ticks. So you would look at roughly 4 - 5 call backs per contract per second. You might want to review your approach and code. I am subscribing to a pretty massive amount of data (process and log them in a Json format) and my server does not break a sweat. And it's a very small server for today's standards. Just to give you some idea:
´³¨¹°ù²µ±ð²Ô On Wed, Mar 17, 2021 at 03:54 PM, corneliu maftuleac wrote:
Hi, |
event when a stock reaches a certain price
corneliu maftuleac
Hi,
I am trying to monitor a list of tickers (lets say the list is big). I want to know when one of the tickers reaches a certain price. The target price is generated by an algo so it's not just a %-change. I tried subscribing to realtime data to all of the instruments but this generates HUGE amount of network traffic to the point that my code is not really able to process all of the events. Is this possible to do with scanner subscriptions? I dont find where I can specify that scanner subscriptions to work only with a specific ticker or a list of tickers. |
to navigate to use esc to dismiss