开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Contract is closed for trading
Hi all, I was trying to place an order to buy a stock and got an error message stating that a contract has closed for trading. What does this mean? Has the exchange stopped trading in this
By Pranav Lal · #322 ·
Re: Is averageCost for the entire portfolio or per security unit price
Hi Mel, Here is my rough and ready code to see my account and my positions. Pranav import sys from ib_async import * from getClientId import get_client_id def get_cash() -> float:
By Pranav Lal · #321 ·
Re: Is averageCost for the entire portfolio or per security unit price
It should be the average cost of the stock you specified in your call.If you provide some code I can have a look.I'm pretty sure it includes commissions in the avg cost, but for some reason I think it
By Mel · #320 ·
Is averageCost for the entire portfolio or per security unit price
Hi all, Just a clarification which I hope I am able to ask coherently. I have a portfolio of stocks. What does the averageCost property show me? Is the averageCost per unit price of the stock or is
By Pranav Lal · #319 ·
Re: reqCurrentTimeAsync() mystery
I added some code so that my code calls reqCurrentTimeAsync every few seconds. I use it to make sure the network is properly connected, so this should be fine. Yeah, my code was locking up
By Frank Bernett · #318 ·
Re: reqCurrentTimeAsync() mystery
This did bit me a few years ago, this was a change by IB about the semantics for reqCurrentTime().? For unknown reasons, IB decided that if you requested the time more than once in the same second to
By mdelvaux2 · #317 ·
Re: reqCurrentTimeAsync() mystery
Although I can't find it in the document, I believe IB may has restrictions no to have two calls within a second, similar to this: https://interactivebrokers.github.io/tws-api/matching_symbols.html
By Frank Bernett · #316 ·
reqCurrentTimeAsync() mystery
I am having some very strange problems with reqCurrentime(). Look at the below script, which simply gets the current time and the remote time, compares them, waits for a little bit, and then tries
By Frank Bernett · #315 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
Yeah, this does seem new. This thread seems to have a similar symptom: /g/twsapi/topic/88795216#msg48912 . It doesn't feel that fields are missing randomly. In the most recent
By Frank Bernett · #314 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
I have the same problem. Its been happening for months now, i just havent tried to figure out what is wrong. I follow the same steps as you outline, and atleast 50% of the time some stocks (usually 2
By in_woolloomooloo · #313 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
Sorry for the multipe email (as I can't edit my response). Just want to add that currently the output of the script is: ``` Retrying... 1 Retrying... 2 Retrying... 3 Failed to get data after 3
By Frank Bernett · #312 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
The sequence is simply: 1. Connect to TWS 2. reqMktData() 3. Give it some time to get data. 4. If some fields are NaN or None, cancelMktData(), and retry. Below is a minimal example. When the problem
By Frank Bernett · #311 ·
Re: ib.reqTickers() conflicts with ib.reqTickByTickData()
Looking for this: https://ib-api-reloaded.github.io/ib_async/api.html#ib_async.util.patchAsyncio ?
By biney59@... · #310 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
Can you outline the steps that reproduce the problem like; * Connect TWS. * Connect client. * Subscribe reqMktData * ... Only because original post had two issues, so I'm confused since it was
By biney59@... · #309 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
I tested it. It does seem that type 2 will give me the most recent quote and price when the market is open. However, even if I use type 2, the problem I described in the original email persisted,
By Frank Bernett · #308 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
Okay, MktDataType 2 may be the answer. Parts of the documentation say it is the quotes recorded at the last closing, which is not what I want, but part of it says it is the last quotes seen by their
By Frank Bernett · #307 ·
Re: Determining which stock is bringing my portfolio into a loss
I'm curious, does it work during regular trading hours?Sent from my Galaxy
By Mel · #306 ·
Re: Determining which stock is bringing my portfolio into a loss
Hi, Yes, setting the market data type to 2 solved the problem. Pranav Sent: Friday, April 4, 2025 11:19 PM To: ib-async@groups.io Subject: Re: [ib-async] Determining which stock is bringing
By Pranav Lal · #305 ·
Re: ib.reqMktData() does not get certain fields when connecting to the gateway the second time.
Type 2 is the last data recorded at market close, which is not what I want. Also, "live" does not usually just mean that I will only get the data when there are new updates. It also means that I will
By Frank Bernett · #304 ·
Re: Determining which stock is bringing my portfolio into a loss
Have a look at my reply to another topic, I think it is closely related to your issue because you are requesting after close: /g/ib-async/message/302
By biney59@... · #303 ·