开云体育

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

TWS API returns "Error: 0 200 No security definition has been found for the request" in reqMktData() for INDEX


 

Hi,
I am trying to pull real-time data for some INDEX in a Python based project, I write the following code to pull the data:??
```
contract = Contract()
contract.symbol = "ES"
contract.secType = "IND"
contract.exchange = "SMART"
contract.currency = "USD"
reqMarketDataType(1)
reqMktData(2, contract, "", False, False, [])
```

But it always returns?"Error:? 0? ?200? ?No security definition has been found for the request".

Does anyone know what's wrong with my code?

- Thanks
Tareq

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