¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Re: Conditions on twsactivex api

 

Hi,
I tried with 1.15? and got error 320... back.
1,15 transforms into conditional order in tws with 115
I live in Belgium.

The Java demo works fine.

Best,
Herman.


Re: IB tws is sending back a null/empty field when it should be a float

 

I am not saying there is no issue, cp. We just did not encounter any, but then we monitor only a very small fraction of all instruments and only on a few large exchanges here in the US. Would be interesting to hear whether others do experience a recent increase in "lack of a value" indications for market data by the TWS API.

Also, visitors may find it helpful to learn about the different approaches how TWS API represents the lack of a value for numerical fields, so I'd be inclined to keep the thread.

´³¨¹°ù²µ±ð²Ô


Re: IB tws is sending back a null/empty field when it should be a float

 

Hi Jurgen I think I'm fine with your data and thanks for running that. It seems that I'll have to learn a LOT more about julia as the problem is clearly mine. Can't argue with facts. Can you delete this whole message thread as it's going to cause more problems than it's worth. Thanks again for going the extra mile. cp


Re: IB tws is sending back a null/empty field when it should be a float

 

I'll take the topic off moderation then, but I think it would be helpful if you could focus the question a little more (so we don't try to boil the ocean). Can you identify a few instruments that you experience issues with as well as the kind of market data tick types you subscribe to?

I ran a quick report on the market data we received within the last 27 hours (since 17:00 central time on Sunday) and found no issues or missing data. We subscribe to about 80 US instruments (STK,, IND, ETF, FUT) and receive everything that can be requested including tick-by-tick data and Level II for three futures. That's shy of 44 million market data items.

´³¨¹°ù²µ±ð²Ô


On Mon, Feb 7, 2022 at 07:26 PM, comicpilsen wrote:

I asked the question in an incorrect manner. Here's another ( non language specific) way to get an answer.

Has anyone on the forum experienced a RECENT degradation in the feed stimulated by the call

reqMktData(ib, idx, contract, "", false)

I am aware of the Jib documentation and have considered that but this is a SPURIOUS event and I want to know if anyone else is experiencing it. It can be coded out but that's not the first recourse here. If TWS is flaky then it's whack a mole time. I don't want the forum to try to fix a problem in a completely different language using a Pkg that they don't use. I would feel bad about trying that. I just want a read on the quality of the data across the members of the forum. Sorry to have asked the question so poorly.


Re: Help handling disconnects so I dont have to log into TWS every time I need to reconnect

 

I appreciate the advice Jurgen, this is super helpful. Going to work on breaking out the connection/market data request/disconnect first as I think I am going to struggle with this a bit.?


Re: IB tws is sending back a null/empty field when it should be a float

 

I asked the question in an incorrect manner. Here's another ( non language specific) way to get an answer.

Has anyone on the forum experienced a RECENT degradation in the feed stimulated by the call

reqMktData(ib, idx, contract, "", false)

I am aware of the Jib documentation and have considered that but this is a SPURIOUS event and I want to know if anyone else is experiencing it. It can be coded out but that's not the first recourse here. If TWS is flaky then it's whack a mole time. I don't want the forum to try to fix a problem in a completely different language using a Pkg that they don't use. I would feel bad about trying that. I just want a read on the quality of the data across the members of the forum. Sorry to have asked the question so poorly.


Re: IB tws is sending back a null/empty field when it should be a float

 
Edited

I hear you, but what you are experiencing is related to the Julia library implementation, not the TWS API. The TWS API does not return "null" values but it does occasionally indicate that a certain value is missing.

From

Missing Values
Occasionally there is the need for numerical types to represent the lack of a value.
The IB API does not adopt a uniform solution for all situations, but rather various sentinel values are used. They can be either the plain 0 or the largest representable value of a given type such as 2147483647 and 9223372036854775807 for 32 and 64 bit integers respectively or 1.7976931348623157E308 for 64 bit floating point.
Within this package an effort is made to replace all these values with Julia built-in Nothing.

The Julia library implementer(s) took a very reasonable approach to present missing numerical values in a uniform way and to return Nothing objects in these cases. But it's not the TWS API that does that.

Can you pinpoint the callback method that cases the return of the Nothing object? We could then take a look at why TWS API indicates that a value is missing.

´³¨¹°ù²µ±ð²Ô


Re: IB tws is sending back a null/empty field when it should be a float

 

Hi Jurgen It's not the language the question is addressing but the data flow. The language is fine and normally the data works but I am asking if anyone on this forum ( which I have been on for some years) has been experiencing these null values. You'd see them in C, c#, java and Python. So I'd still like the question asked unless you still see an issue with julia.


Re: IB tws is sending back a null/empty field when it should be a float

 

The Julia client is not one of the IBKR provided APIs we are discussing here. You will be better off asking your question in a group or forum that focuses on that implementation.

If you are using the library at take a look at the discussion of missing values in README.md.

´³¨¹°ù²µ±ð²Ô


On Mon, Feb 7, 2022 at 06:06 PM, comicpilsen wrote:

I'm using julia and here's the call


Re: IB tws is sending back a null/empty field when it should be a float

 

Hi there thanks for the intervention. I'm using julia and here's the call

here's my request

contract = Jib.Contract(symbol=s, secType="STK", exchange="SMART", currency="USD")

Jib.reqMktData(ib, idx, contract, "", false)

and I'm getting spurious


tickPrice2: AAPL CLOSE 172.39 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL OPEN 172.76 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL BID 172.8 23.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickPrice2: AAPL ASK 172.81 33.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickSize: 1 BID_SIZE 23.0
tickSize: 1 ASK_SIZE 33.0
tickString: 1 BID_EXCH KPQXZU
tickString: 1 ASK_EXCH KPQZNU
marketDataType: 2 REALTIME
tickReqParams: 2 0.01 9c0001 3
©° Error: exception thrown
©¦   e = TypeError: in typeassert, expected Float64, got a value of type Nothing


Re: IB tws is sending back a null/empty field when it should be a float

 

Which API/language are you using? Also, your log does not clearly show which API call-back method throws the exception.

´³¨¹°ù²µ±ð²Ô

PS. I have put this thread onto moderation for now so that we can focus on your question.


On Mon, Feb 7, 2022 at 05:44 PM, comicpilsen wrote:

Jib.reqMktData(ib, idx, contract, "", false)

©° Error: exception thrown
©¦   e = TypeError: in typeassert, expected Float64, got a value of type Nothing


Re: IB tws is sending back a null/empty field when it should be a float

 

again can you take this to another thread. My concern is your issue is not relevant to mine.Thank you


Re: IB tws is sending back a null/empty field when it should be a float

 

I guess that's my point, that it doesn't "roll over immediately after rth." Every other quote service I've used gives an OHLCV quote as soon as available (usually a few minutes after the close, depending on whom they poll for volume figures). I simply want to enter a valid trade after hours. "Valid" means the limit price I set should be marketable. Perhaps I will find that when IB gave -1 for the bid and ask that trades were no longer marketable. But this is robotrading. I need to programmatically set a trade that should execute as soon as available.


Re: IB tws is sending back a null/empty field when it should be a float

 

here's my request

contract = Jib.Contract(symbol=s, secType="STK", exchange="SMART", currency="USD")

Jib.reqMktData(ib, idx, contract, "", false)

and I'm getting spurious


tickPrice2: AAPL CLOSE 172.39 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL OPEN 172.76 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL BID 172.8 23.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickPrice2: AAPL ASK 172.81 33.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickSize: 1 BID_SIZE 23.0
tickSize: 1 ASK_SIZE 33.0
tickString: 1 BID_EXCH KPQXZU
tickString: 1 ASK_EXCH KPQZNU
marketDataType: 2 REALTIME
tickReqParams: 2 0.01 9c0001 3
©° Error: exception thrown
©¦   e = TypeError: in typeassert, expected Float64, got a value of type Nothing


Re: IB tws is sending back a null/empty field when it should be a float

 

Hey guys can you take this to another thread. This isn't anything to do with what I asked.


Re: IB tws is sending back a null/empty field when it should be a float

 

Nick:

Perhaps I should have been more clear. I am trying to use marketPrice() to get a valid price from which to enter an after-hours order. marketPrice() returns the following:

 * last price if within current bid/ask;
 * average of bid and ask (midpoint);
 * close price.

So, if there is not a bid and ask available, it provides a 3-day-old close quote. That is unusable. That they tell us this in the docs does not make it any better. It is still a worthless quote.

last would be best, as long as it is not from some after-hours book cleanup, meaning it is the last actual open-market tick. I guess I could compare to Last RTH Trade to see if it makes sense.


Re: IB tws is sending back a null/empty field when it should be a float

 

You're not referring to me right? I don't want to have this thread go off in another direction. I'm pretty sure that I'm calling the correct data at the correct time. So my question still stands.


Re: IB tws is sending back a null/empty field when it should be a float

Nick
 

P.S. If the Close field is not advancing properly upon session close then you could submit a ticket with IB.

The docs don't say how 'previous' is defined. Whether it is calendar day only or rolls over immediately after rth.

On 2/7/2022 6:18 PM, Nick wrote:
Are you talking about tickPrice type 9 - Close Price?


Re: IB tws is sending back a null/empty field when it should be a float

Nick
 

¿ªÔÆÌåÓý

Are you talking about tickPrice type 9 - Close Price? If so,

From the docs:

The last available closing price for the previous day. For US Equities, we use corporate action processing to get the closing price, so the close price is adjusted to reflect forward and reverse splits and cash and stock dividends.
This is the closing price for the previous day. The day before Monday is Friday. The api is behaving as documented.

Maybe read the docs to know what data you are getting.



On 2/7/2022 6:00 PM, Bennie wrote:

Yeah, I am finding IB's quotes to be completely unreliable. Here is a quote I just received after hours:

ticker_data = ib.reqMktData( qualified_contract, "", True, False, [])

ticker_data.marketPrice(): 3.75
ticker_data.close: 3.75 # this is Friday's close!
ticker_data.last: 4.05
ticker_data.ask: -1.0
ticker_data.bid: -1.0

When trying to set a limit order after hours, one needs to know a valid current price. Entering a trade with a 3-day-old quotation is ridiculous. I guess I have to rely on a 3rd-party quote service, which is shameful.



Re: IB tws is sending back a null/empty field when it should be a float

 

Yeah, I am finding IB's quotes to be completely unreliable. Here is a quote I just received after hours:

ticker_data = ib.reqMktData( qualified_contract, "", True, False, [])

ticker_data.marketPrice(): 3.75
ticker_data.close: 3.75 # this is Friday's close!
ticker_data.last: 4.05
ticker_data.ask: -1.0
ticker_data.bid: -1.0

When trying to set a limit order after hours, one needs to know a valid current price. Entering a trade with a 3-day-old quotation is ridiculous. I guess I have to rely on a 3rd-party quote service, which is shameful.