开云体育

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

Re: No definition for SPX option using LocalSymbol


 

开云体育

The Contract Inspector shows you the actual local symbol to use. US options and European options have different local symbol formats: you’ve tried to use the European format for a US option.

?

The local symbol you need is:

?

SPXW? 241218C05945000

?

which is probably in your screenshot, except it’s too small and fuzzy to read.

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of Andy Sanders via groups.io
Sent: 19 December 2024 05:16
To: [email protected]
Subject: [TWS API] No definition for SPX option using LocalSymbol

?

Could somebody advise why I'm getting "No security definition" error for a contract with this local symbol : C SPX 20241218 5945 W

?

Security: SPX index

Strike: 5945

Side: Call?

Expiration: 2024-12-18?

Type: Weekly

?

Trying to send order to buy and sell SPX index options. When I set separate contract properties such as strike, symbol, expiration, currency, and exchange, place order request returns error "ambiguous definition" because API returns the same expiration date for monthly and weekly options.?

?

?

There are several ways to make contract definition for option unique, e.g. using TradingClass or LocalSymbol properties. When I try to use LocalSymbol I get error "No security definition found"

?

Example of local symbol that I used : C SPX 20241218 5945 W

Format mentioned in the docs : ?

?

Join [email protected] to automatically receive all group messages.