Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Stable dockerized TWS version, anyone?
I know this is a long shot, but did you resolve this issue by any chance? Facing the same issue with TWS freezing when any audio is triggered (or going to Sound Manager in Global Settings.)
On another machine, it's running fine, so I think it has to do with Docker host configuration.... |
Historical Forex ratio - BRL (Brazilian Real)
I tried to use IDEAPRO to get the forex ratio for the BRL (Brazilian Real). ? I got the classic error code 200: ? Error. Id: 100 Code: 200 Msg: No security definition has been found for the request ? I tried to reverse the contracts "symbol" and "currency" between USD and BRL - as the IDEALPRO exchange only returns some forex pairs if the symbol/currency is set up in a particular way. ? In fact, IBKR's material doesn't list the BRL in the IDEALPRO exchange: https://www.interactivebrokers.com/en/index.php?f=2222&exch=ibfxpro&showcategories=FX&p=&ptab=&cc=&limit=100&page=1 ? I was surprised, however - Brazil is a big economy, and I thought having its currency forex ratio would be helpful for IBKR's clients. ? Can someone suggest any other contract or approach to get the historical forex ratio for the Brazilian Real? ? Thank you |
Re: backtesting versus forward testing
No, that's too far off of their core business as a brokerage. Their data services are merely an ecosystem add-on, of limited utility if you ask me, and certainly devoid of any computational sophistication.
There exist a few online services that offer server-side data feeds and programmable back-testing. I'm not sure though about the quality of data they offer either. Also, what has always bothered me is you're giving away a ready to use algorithm to a company whose employees can potentially screen and deploy everyone's algos with the same readily available computational power as their creators (I even conversed on Reddit with a founder of one of such services once, bringing up the privacy concern, and I wasn't I offered a reasonable solution - I guess there can't be one, really). -- Best, DS |
backtesting versus forward testing
I've been able to "forward test" my client app on my TWS paper account using live data during regular trading hours. However, is it possible to do backtesting on historical data? It would be useful if I could test and modify code outside of regular trading hours.
I see that?reqHistoricalTicks() will provide the data, but all of the data is dumped into historicalTicks() as a std::vector<> in a one-off way. I have to loop through all of it to look at it, and when I do, I can't go off and call my other methods. Has anyone heard of IBKR (or atleast TWS locally) being able to process my orders against a historical data set? |
Re: Fee to pay TWS
Never tried (So I shouldn't answer) but I guess 3 things that make me thinking: don't waist too much time on that: |
Re: Can API or DDE get the fundamental data?
Hmmm |
Re: TWS API messages delay
TWS/IBGW logs are stored in the root of the "account" folder for the account that TWS/IBGW was logged into. That is a folder in "~/Jts" with 40 or so random looking characters. The log file for API messages is called something like "api.1697984914.20231022.092837.ibgzenc" But all log files are encrypted so that the actual file does not help you. You'd go to Help->Troubleshooting->Diagnostics->APILogs in TWS/IBGW to decrypt los for the time you are interested in. You'll provide a file name of your choice for the decrypted logs. ´³¨¹°ù²µ±ð²Ô On Sun, Oct 22, 2023 at 03:42 PM, <bespalex@...> wrote:
Hi Jurgen, I will definitely analyze this. Where are the actual logs located? I don't see any in the \jts directory. |
Re: TWS API messages delay
I'd suggest you enable "Create API message log file" in TWS File->Global Configuration->API->Settings and check what is going on from TWS's point of view. The log file shows each message received from or sent to your client with a time stamp in 1ms resolution:
toggle quoted message
Show quoted text
execDetails messages will only occur once an order actually fills (partially or completely). Depending on the order, that may take a while (for example if you place a limit order with a target price far away from the current bid/ask prices) but you should get openOrder/orderStatus callbacks immediately after placing the order and likely while the order is active. ´³¨¹°ù²µ±ð²Ô On Sun, Oct 22, 2023 at 09:10 AM, <bespalex@...> wrote:
Hi, does anyone have any idea if there is some kind of queue on IB's side? |
TWS API messages delay
Hi, does anyone have any idea if there is some kind of queue on IB's side?
I have experienced a substantial delay in getting orderStatus, openOrder, and execDatails messages, in the most extreme cases of up to 5 minutes. I am wondering if this can be a problem on IB's side or is it a race on my side that deadlocking delivery. At the same time, orders get submitted and executed, but the position is coming back unchanged. |
Re: Can API or DDE get the fundamental data?
Don't know about DDE (but I don't see how it would work as it is too rich for DDE, anyway they are not Real time data so you might be able to script it in Python and use it as a CSV)
Look at the code in exemple?? m_pClient->reqMktData(1004, ContractSamples::USStockAtSmart(), "233,236,258", false, false, TagValueListSPtr()); The Tick type you need is 258, AKA TIK_FundamentalRatios??? "258" You will get an answer trough call back ::tickString(TickerId reqId, TickType tickType, const string& value) this deliver a somewhere cryptic CSV with of a lot of information, alike what is below Sorry but I don't remember where I did get the information about Tag contents, however that reasonably easy to guess and find also read Do not expect IBK to be able to deliver 100% of all theses values for every stocks, use it as a free lunch. In general they get more fundamentals than other feeds, so major stocks are reasonably filled up and up to date. Tick String. ReqId Id: 111, Type: 47, Value: TTMNPMGN=-0.782;NLOW=5.48;ACFSHR=1.268463;ALTCL=0;TTMPRCFPS=27.30529;TTMCFSHR=0.49519;ASFCF=-188;AEPSNORM=-0.97418;TTMRECTURN=3.99795;AATCA=-99999.99;QCSHPS=4.38838; TTMFCF=-2033; LATESTADATE=2021-03-31; APTMGNPCT=6.52734;IAD=0.04;TTMNIAC=-1063;EV_Cur=-99999.99;QATCA=-99999.99;PR2TANBK=-99999.99;TTMFCFSHR=-0.23197; NPRICE=13.49;ASICF=20045;REVTRENDGR=-7.11523;QSCEX=-1037;PRICE2BK=3.52672;ALSTD=1457;AOTLO=3596;TTMPAYRAT=-99999.99;QPR2REV=-99999.99;; TTMREVCHG=-17.6063;TTMROAPCT=-0.23502;QTOTCE=35551;APENORM=-99999.99;QLTCL=0;QSFCF=21;TTMROIPCT=-0.37286;DIVGRPCT=-65.3319;QOTLO=3633;TTMEPSCHG=-120.554; YIELD=-99999.99;TTMREVPS=8.69612;TTMEBT=-1040;ADIV5YAVG=0.488;Frac52Wk=-99999.99;NHIG=14.415;ASCEX=-3403;QTA=253452;TTMGROSMGN=25.5409; QTL=217901;AFPRD=-19016;QCURRATIO=1.96248;TTMREV=76215;TTMINVTURN=3.54825;QCASH=36630;QLSTD=1457;TTMOPMGN=-1.13232;TTMPR2REV=1.55488;QSICF=0; TTMNIPEREM=-3425.287; EPSCHNGYR=-99.64437;TTMPRFCFPS=-99999.99;TTMPTMGN=-1.36456;AREVPS=9.08789;AEBTNORM=-15995;ASOPI=9809;NetDebt_I=32834;PRYTDPCTR=12.05931; TTMEBITD=8373;AFEEPSNTM=0.244;EPSTRENDGR=34.32537;QTOTD2EQ=212.4698;QSOPI=1135;QBVPS=3.82576;YLD5YAVG=3.1943;PR13WKPCT=-99999.99;PR52WKPCT=-99999.99;AROAPCT=2.205816; QTOTLTD=70288;TTMEPSXCLX=-0.12229;QPRCFPS=7.632914135403047;QTANBVPS=-0.12872;AROIPCT=2.218938;QEBIT=1525;QEBITDA=2812;TTMINTCOV=-99999.99;TTMROEPCT=-3.08756; MKTCAP=118504.9; TTMREVPERE=438017.3; AEPSXCLXOR=0.5995891;QFPRD=-4599;REVCHNGYR=-12.16521;AFPSS=-99999.99;CURRENCY=USD;EV2EBITDA_Cur=-99999.99;PEEXCLXOR=-99999.99;QQUICKRATI=1.67591; ASINN=-99999.99;QFPSS=-99999.99; BETA=1.08957; ANIACNORM=-8534.8;PR1WKPCT=-99999.99;QLTD2EQ=199.1663;QSINN=-99999.99;PR4WKPCT=-99999.99;AEBIT=7803 where AEPSNORM??? EPS Normalized AFEEPSNTM??? Analyst Forecast of EPS - N12 MKTCAP??? ??? Market capitalization PRICE2BK??? Price to Book TTMFCF??? ??? Free Cash Flow - TTM TTMNIPEREM??? Net Income/Employee - TTM TTMREVPERE??? Revenue/Employee - TTM TTMREVPS??? RevenuePerShareTTM TTMREV??? ??? RevenueTTM TTMREV??? ??? RevenueTTM TTMPR2REV??? PriceToSalesTTM??? QEBITDA??? ??? EBITD - MRQ BETA??? ??? Reuters Beta is the slope of the 60 month regression line of the percentage price change of the stock relative to the percentage price change of the local index.? Beta values are not calculated if less than 40 months of pricing is available AREVPS??? ??? RevenuePerShare AEPSNORM??? epsdiluted AFEEPSNTM??? AnalystForecastOfEPS??? EV_Cur??? ??? CurrentEnterpriseValue MKTCAP??? ??? marketCap NHIG??? ??? yearHigh NLOW??? ??? yearLow QEBITDA??? ??? EBITDA etc ... |
Re: LMT + MKT combo orders versus REL + MKT combo orders
Here's a good explanation of REL + MKT:
To use their example, Stock ABC - Stock XYZ is the spread and you want to buy it. ABC is 9.00 x 9.02? and XYZ is 5.01 x 5.02. That means the spread is 3.98 x 4.01. Suppose you send a LMT + MKT with a limit of 4.00. My guess is IBKR will wait around for the ask of the spread to drop below 4 and do it's thing. I'm just not really clear on what that is. For instance, the order isn't immediately marketable, but let's say ABC and XYZ move to 9.02x 9.03 and 5.00x 5.01, then the spread is 4.01 x 4.03. What I imagine is that IBKR sends out its limit orders at 9.02 and 5.01. Either one leg fills and they do market on the other, or both legs fill and they make even more profit. But how much does the spread bid have to drop below my limit for me to get a fill? Which strategy is more aggressive? |