¿ªÔÆÌåÓý

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

Re: How to get market data, specifying exchange=NASDAQ, when ssh to a server that the TWS application is running on


 

¿ªÔÆÌåÓý

As far as I¡¯m aware ¡°NASDAQ¡± doesn¡¯t appear in the list of valid exchanges in the contactDetails() callback for any security. The list for MSFT is typical:

?

validExchanges = SMART,AMEX,NYSE,CBOE,PHLX,ISE,CHX,ARCA,ISLAND,DRCTEDGE,BEX,BATS,EDGEA,JEFFALGO,BYX,IEX, EDGX,FOXRIVER,PEARL,NYSENAT,LTSE,MEMX,TPLUS1,IBEOS,OVERNIGHT,PSX

?

Market data requests must specify an item in this list.

?

However ¡°NASDAQ¡± does appear as the primaryExchange attribute (whereas for IBM the primaryExchange is listed as ¡°NYSE¡±).

?

Primary exchange has always been a very unclear concept in the API and isn¡¯t really defined properly anywhere. Originally there was a statement somewhere that its purpose was to disambiguate the meaning of ¡°SMART¡± ¨C because there are separate SMART routing infrastructures in different regions, eg US, Canada, EU, LSE. So if nothing else indicated which SMART routing infrastructure was to be used for an undirected order, primaryExchange would do it. Normally currency would do the job, but not in every case, though I don¡¯t remember any specific examples. This is all still true, but it may be that primaryExchange has some additional use now that I¡¯m not aware of.

?

So primaryExchange is hardly ever necessary, but in my platform I always use the primaryExchange returned in the contractDetails().

?

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