¿ªÔÆÌåÓý

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

Re: Find stock with ISIN given (VBA)


 

¿ªÔÆÌåÓý

Hello,

?

I finally found the time to check out this method but I haven?t been successful yet.

?

Below you can see the code I used to get the stock information with the ISIN given.

?

Unfortunately I always receive the error message ¡°Argument is not optional¡±.

?

I tried many variations but I haven?t been able to find out which argument is missing.

?

Does someone have an idea which argument is missing?

?

Sub stockSearch()

?

Set ObjTWSControl.m_contractInfo = ObjTWSControl.m_TWSControl.createContract()

?

With ObjTWSControl.m_contractInfo

??????????????

????????????????.symbol = ""

??????????????? .secType = "STK"

??????????????? .secId = "DE000A0Z2ZZ5"

??????????????? .secIdType = "ISIN"

??????????????? .lastTradeDateOrContractMonth = ""

??????????????? .strike = ""

??????????????? .right = ""

??????????????? .primaryExchange = "IBIS"

??????????????? .exchange = "IBIS"

??????????????? .currency = "EUR"

??????????????? .localSymbol = ""

??????????????? .marketName = ""

??????????????? .tradingClass = ""

??????????????? .conId = ""

??????????????? .minTick = ""

??????????????? .priceMagnifier = ""

??????????????? .multiplier = ""

??????????????? .orderTypes = ""

??????????????? .validExchanges = ""

?

End With

?

Call ObjTWSControl.m_TWSControl.reqContractDetails(id, ObjTWSControl.m_contractInfo)

?

End Sub

?

?

?

?

Von: [email protected] <[email protected]> Im Auftrag von corneliu maftuleac
Gesendet: Mittwoch, 9. Dezember 2020 19:53
An: [email protected]
Betreff: Re: [TWS API] Find stock with ISIN given

?

Actually I was referring to python api from ib_insync.
For VBA is this reqContractDetails


The idea is to fill in only some fields and let the api fill the rest.
Something like?

Dim contract As Contract = New Contract()

contract.SecIdType = "ISIN"

contract.SecId = "US03076KAA60"


client.reqContractDetails(.....)


Not sure it will work, but why not give it a try.

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