开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

reqMktdata SPX call


 

Hi all is there ANY reason that calling reqMktdata using "SPX" , "CBOE","USD" as parameters would cause

sending | ┌ Error: exception thrown
│   e = TypeError: in typeassert, expected Float64, got a value of type Nothing

and no data?

I can send the same reqMktdata for any symbol and it works perfectly.


 

开云体育

Give us some clues please!

?

Like what API implementation are you using?

?

?

From: [email protected] <[email protected]> On Behalf Of comicpilsen
Sent: 11 March 2022 00:02
To: [email protected]
Subject: [TWS API] reqMktdata SPX call

?

Hi all is there ANY reason that calling reqMktdata using "SPX" , "CBOE","USD" as parameters would cause

sending | ┌ Error: exception thrown
│?? e = TypeError: in typeassert, expected Float64, got a value of type Nothing

and no data?

I can send the same reqMktdata for any symbol and it works perfectly.


 

Sorry Richard

I wanted to just ask the general question if it was legitimate for me to send a reqMktData for an index. Here's the TWS connection data

Info: connected
│   V = "167"

I'm using a language called julia and so posting the code won't help as this language isn't supported on this forum. I'm using the same structure of call I use for "STK" so I was hoping that if I send the same call but with the following fields filled out I would get a data stream.


Contract(symbol="SPX" , secType="IND" , exchange="CBOE"  , currency="USD")

Is this is legitimate call please in general terms.


 

开云体育

Yes, market data requests work the same way for indexes as for any other contract.

?

I just tried it on my system with these parameters and it worked fine (market is closed now though so only zeros returned).

?

Even if it wasn't allowed, I wouldn't expect any sort of request to result in an exception like this: clearly some work to be done in this implementation!

?

?


 

开云体育

Thanks Richard

so the results of the call for an "IND" should be the same as the results as a call for "STK". Is that a fair statement?? Also I was talking to a chum about the Aboyne highland games. I used to spend time in Banchory and used to enjoy the games and the characters.

cp


On 3/11/22 06:42, Richard L King wrote:

Yes, market data requests work the same way for indexes as for any other contract.

?

I just tried it on my system with these parameters and it worked fine (market is closed now though so only zeros returned).

?

Even if it wasn't allowed, I wouldn't expect any sort of request to result in an exception like this: clearly some work to be done in this implementation!

?

?


 

开云体育

Absolutely the same. Depending on the index you may not receive some tick types, but I've never noticed anything to be missing that I'd expect to be there. The FTSE index (which IB actually no longer provide data for) used to even send out bids and asks, which always puzzled me somewhat – no idea what they were meant to mean, since the index isn't tradable.

?

You know, IB provides some test ?programs with the API that enable you to just try all this sort of thing out without having to write code. There are test programs for C#, Visual Basic and Java. If you're on Linux the Java one would be the only option. I think you have to build them yourself the first time.

?

They enable you to essentially call any API with any parameters you choose and see the results. I've found these things really useful over the years for trying things out before writing code in my platform.

?

Regarding the Highland Games, I've lived here in the North East of Scotland for over 32 years now and have never been to them. Not really my thing!

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of dent
Sent: 11 March 2022 12:50
To: [email protected]
Subject: Re: [TWS API] reqMktdata SPX call

?

Thanks Richard

so the results of the call for an "IND" should be the same as the results as a call for "STK". Is that a fair statement?? Also I was talking to a chum about the Aboyne highland games. I used to spend time in Banchory and used to enjoy the games and the characters.

cp


 

You provided very little context, but the word "Sending" in the error message jumped at me. Just guessing but could it be that your request fails in the Julia API implementation before it is even sent to TWS? That would explain why you get no data.

You could check TWS API log to verify whether the request makes it to TWS and whether market data is sent back to you. You might want to reach out to the creators of the Julia API if TWS never sees the request.

闯ü谤驳别苍

On Thu, Mar 10, 2022 at 06:01 PM, comicpilsen wrote:

Hi all is there ANY reason that calling reqMktdata using "SPX" , "CBOE","USD" as parameters would cause

sending | ┌ Error: exception thrown
│   e = TypeError: in typeassert, expected Float64, got a value of type Nothing

and no data?

I can send the same reqMktdata for any symbol and it works perfectly.


 

开云体育

Hi there

nope, the message is getting to IB it's just not sending anything back. I just wanted to see if I was missing anything at the highest level. As Richard says there should be not difference in call. "STK" or "IND". thanks for chipping in though but the call is fine.

Which logs should I be looking at please?? I use TWS desktop running on Linux. I just want to make sure I'm looking at the right ones.

thank you for taking the time

cp



On 3/11/22 08:42, 闯ü谤驳别苍 Reinold via groups.io wrote:

You provided very little context, but the word "Sending" in the error message jumped at me. Just guessing but could it be that your request fails in the Julia API implementation before it is even sent to TWS? That would explain why you get no data.

You could check TWS API log to verify whether the request makes it to TWS and whether market data is sent back to you. You might want to reach out to the creators of the Julia API if TWS never sees the request.

闯ü谤驳别苍

On Thu, Mar 10, 2022 at 06:01 PM, comicpilsen wrote:

Hi all is there ANY reason that calling reqMktdata using "SPX" , "CBOE","USD" as parameters would cause

sending | ┌ Error: exception thrown
│   e = TypeError: in typeassert, expected Float64, got a value of type Nothing

and no data?

I can send the same reqMktdata for any symbol and it works perfectly.


 

Under "File -> Global Configuration -> API -> Settings"
  • Enable "Create API message log"
  • Enable "Include market data in API log file"
Log files are stored encrypted so you would use "Account -> Diagnostics -> API Logs" to view or export them.

闯ü谤驳别苍


On Fri, Mar 11, 2022 at 08:50 AM, dent wrote:

Which logs should I be looking at please?? I use TWS desktop running on Linux. I just want to make sure I'm looking at the right ones.


 

开云体育

thank you Jurgen

great help as always.

cp


On 3/11/22 09:44, 闯ü谤驳别苍 Reinold via groups.io wrote:

Under "File -> Global Configuration -> API -> Settings"
  • Enable "Create API message log"
  • Enable "Include market data in API log file"
Log files are stored encrypted so you would use "Account -> Diagnostics -> API Logs" to view or export them.

闯ü谤驳别苍

On Fri, Mar 11, 2022 at 08:50 AM, dent wrote:

Which logs should I be looking at please?? I use TWS desktop running on Linux. I just want to make sure I'm looking at the right ones.