Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: WAP value provided by 'realtimeBar' vs. that shown in the TWS quote panel
VWAP involve a duration over which the averaging is done,
Assuming what you call RT bar are 5 sec bar, What time frame is TWS bar ? if it's day then it is perfectly normal they don't show same thing. Does TWS on chart use use chart time frame ? suggestion : ask Historical Day bar for current day with keepUpToDate =true? and compare it with TWS in Tab view, or see on chart, using chart time frame with historical bar updated. |
Re: Question regarding reboot of trader workstation
When you connect you will get a call back that fire: nextValidId(OrderId orderId)
Which give you the next valid id you can use (seems more to be used as an index, so you are free to use anything higher as long as you commit yourself to be consistent in numbering. I can even guess that you can recycle old number, just a guess, it's a bad practice) So you will never reach the 'long' limit. BTW: Hypothetical case if reset did not existed, 10 call/sec non stop 24 h/days then you can run ~7 Years before you hit the limit. Not sure I understand your question about "will then all results be gone ?", yes all pending request is aborted (and that is good as it avoid to reconcile requestid), This happens around 23:00 ~adjusted to your time zone so unlikely you are doing anything critical. As per existing order/position if I understand your question there, no impact, it's unrelated, and it work as you would do it with TWS |
Re: Getting news providers code
What you get is the exhaustive list of what you are allowed to use (normally linked to what you subscribed for) +>IBK? 120: reqInitNews contractDetails: BRFG:BRFG_SMU,'Stock Market Update' |
Re: Can not get more historical data.
You are requesting data for Nasdaq only ("ISLAND") and that's probably what you get. I say "probably" because meaningful historical data are not easy to get from IBKR, at least?in terms of specifying what exactly is?required. Equities frequently change symbols and move between exchanges, and to add insult to injury perform all sorts of mergers, splits and spin-offs. Data providers need do some stock forensics to keep track of all of this so as to get all the different varieties of adjusted current data, including gluing together data from different exchanges and for different symbols, all referring to the same stock. I'm not sure IBKR is very good at this.
TLT is likely no stranger to such disruption as Blackrock moved a lot of their iShares ETF's between ARCA, BATS and NMS in the previous decade. Therefore it is completely credible that there must be no Nasdaq (NMS) data for this stock between its inception date in 2002 and some more recent date in the past. Unfortunately it doesn't get much easier from here. Generally I would suggest just using "SMART" for the exchange so that the API aggregates data from all exchanges for the equity in question. This seems to work with TLT but only partially. Indeed, with SMART we get 5 times as much volume as with ISLAND supporting the suggestion that this time it's data collected from many more venues than just NMS. However the historical period now is even shorter - we only get data from 2016 and later. I have no sensible interpretation for this other that 2016 was yet another of those years when some significant event took place in the history of this equity and IBKR probably messed up its aggregation. Usually I believe SMART should naturally yield both the biggest volume and the longest historical period. FWIW I managed experimentally to get data right from the very inception of TLT in 2002 using exchange="ARCA". I guess that was the original exchange where TLT started to trade. But even though this data is available for the whole lifespan of TLT from 2022 right to 2023, the volume is again much smaller than with SMART (when it's available) since, naturally, we only get data for a single trading venue rather than the whole market, and one that has not even been primary for some years now, suggesting that the critical EOD prices in this period may not precisely match the official consolidated tape closing prints widely used for daily price tracking. |
Getting news providers code
I tried to follow the instructions?
on how to get list of news providers codes,?but ended up only with:? NewsProviders:? NewsProvider. Code: BRFG, Name: Briefing.com General Market Columns
NewsProvider. Code: BRFUPDN, Name: Briefing.com Analyst Actions
NewsProvider. Code: DJNL, Name: Dow Jones Newsletters How can I get Reuters code for example? |
Question regarding reboot of trader workstation
Arthur
Hi all,
i read somewhere in the documentation that the trader workstation is designed to reboot every day. If this is the case, will then all results be gone ? No historical Profits ? The more important question is the variable that is incremented for every request, can it then start with value '1' again ?? Because if this isnt the case (the datatype is long ) theres a limit for the number of requests that one can send. Please clarify regards, Arthur |
Re: link with symbol that open the symbol on tws client ?
That will definitely void your warranty big time, buddy, will be a lot of work, easily breaks whenever TWS is updated, and inherits all kinds of other problems. I think @frodfrog's comment about display groups is a good one. The interface is simple but allows the TWS API client:
Beyond that, Richard King's IBC may possibly be the base for a more involved TWS/IBGW automation (Groups.io, ). It is very reliable, but Richard needs to maintain it frequently when new TWS updates arrive. And finally, there are several JavaFX automation frameworks. TWS/IBGW are built on-top of the JavaFX GUI framework which provides hooks for automation (usually for automated application testing). There are several "robot" libraries out there that can query the current structure of the display and mimic all user input (typing, mouse movement, clicking). But anything other than the TWS API display groups requests will definitely require much more effort than "a weekend and a few six packs". ´³¨¹°ù²µ±ð²ÔOn Thu, Aug 3, 2023 at 03:04 PM, buddy wrote:
|
Re: link with symbol that open the symbol on tws client ?
The IntelliJ Java de-compiler also seems to be pretty robust if you're that determined. I took a gander at the jar files and there isn't as much obfuscation going on as I expected.
So, I'm not sure you couldn't re-arrange your class path in an order such that TWS is effectively wrapped by a custom Java application. Practically speaking however, I'm not in favor of this idea... strikes me as a potentially fun academic exercise though. I'd just stick to using the API as intended. |
Re: Pairs trading: Parent vs Child order placement
You might want to read-up on the subtle differences between Bracket orders, Hedge orders, and Once Cancels All orders (OCA). A good start is the of the TWS API Guide and the I explorer..
You can combine Bracket, OCA, and Hedge orders to model quite complex order constructs that are active r pending within the IBKR system regardless of your TWS/IBGW and client application status. Below an example of an order with several generations of attached orders. This works as long as you meet the of "20 active orders per contract per side per account". The example bracket order has four layers and a total of 12 individual orders:
This was just an example and may not make sense in real trading. ´³¨¹°ù²µ±ð²Ô |
WAP value provided by 'realtimeBar' vs. that shown in the TWS quote panel
Hello,
Does anyone know the difference of?WAP value provided by 'realtimeBar' vs. the VWAP value shown by the TWS quote panel? I saw some 10+ years old post here and seems folks thought the WAP provided by 'realtimeBar' is either wrong or is using some unknown algo. I wasn't sure if it's still true? For me they do come out to be quite different. For e.g. today I checked WAP value for NFLX reported via 'realtimeBar' API as $440.22 while on TWS quote panel (which is same as drawn on chart) it showed as $437.30. I contacted IB customer support and they asked me to submit my logs, which I did.. yet to hear from them. Also, do any API provide the VWAP value shown in TWS quote panel Or is it just better to calculate it locally? Thanks. |
Re: link with symbol that open the symbol on tws client ?
An alternative is to write a CSV file according to the format that IB support for export/Import a tab. Try save a tab (export Instrument) and analyze the aspect of it.
This can be quit convenient if you need to format a tab, It allows a Header "HED" with custom content and to specify a list of symbols. start with "DES", and allow to add empty lines, ... But still need manual action (or a robot) to load it CSV contain look like: HED,GAIN DES,AIG,STK,SMART/AMEX,,,,, DES,QGEN,STK,SMART/AMEX,,,,, DES,USB,STK,SMART/AMEX,,,,, DES,CTRA,STK,SMART/AMEX,,,,, DES,MRO,STK,SMART/AMEX,,,,, |
Re: Can not get more historical data.
I don't see a way to do it because if you call HeadTimeStamp for TLT you will get: Wednesday, May 13, 2009 11:00:00 AM |
Re: Pairs trading: Parent vs Child order placement
Came across this behaviour and find it equally perplexing. Essentially - Parent orders cannot have child orders on different contracts |
Can not get more historical data.
I found that I only can get the historical data from 2009/05/13 to now from 'ISLAND'. And there is more data from 'CBOE', around 2004. How to get more historical data?
Here is my code:
-- Stock_name = "TLT"
mycontract = Contract()
mycontract.symbol = Stock_name
mycontract.secType = "STK"
mycontract.exchange = "ISLAND"
mycontract.currency = "USD"
self.reqHistoricalData(orderId, mycontract, "20230802 16:00:00 US/Eastern", "25 Y", "1 Day", "TRADES", 0, 1, 0, [])
QX [Moderator edit: Removed unrelated code] |
Re: How can I get the SPX closing price?
I don't think this is correct if today's close price is required because tick #9 always reflects previous day's close price, even after current day's liquid trading close.
This is true for stocks though I can't be certain about indexes. With stocks AFAIK there is no reqMktData tick that shows today's closing price in the API. However many workarounds exist such as requesting the last RTH price after the close (tick #57) or getting today's 1-day historical price bar limited to RTH and extracting the closing price from it. -- Best, DS ?
|
Re: What API does Sterling Trade Tech use?
But the Client Portal API still requires you to install and run an IBKR supplied small (most likely locally hosted) Java gateway. The OP wanted to avoid having to install some IBKR gateway. The REST services provided by Client Portal API do not talk with IBKR servers directly.
toggle quoted message
Show quoted text
´³¨¹°ù²µ±ð²Ô On Tue, Aug 1, 2023 at 02:31 PM, John wrote: An option not mentioned thus far is the web API which doesn't cost anything to my knowledge, and only requires an internet connection. If your trading app is simple enough and doesn't require low latency. Of course this only gives like 1% of the features available via the full fledged TWS/GW API but there are cases where that's enough to manage a portfolio. |