QuantConnect / Lean.Brokerages.InteractiveBrokers

InteractiveBrokers Brokerage Plugin
Apache License 2.0
27 stars 17 forks source link

Improves GetContractDetails Error Message #106

Closed AlexCatarino closed 2 months ago

AlexCatarino commented 2 months ago

Expected Behavior

When we can find the details for a security, inform the user that this security was not found in IB database.

Actual Behavior

We receive the following message:

No security definition has been found for the request. Origin: [Id=42] GetContractDetails: NVDL (CFD NVD L SMART)

which is not very helpful. It means that the CFD for NVDL was not found in IB database. If we search for it in the Produce Search page it cannot be found.

Potential Solution

Catch that error message and explain we couldn't find it on the IB dataset page. We could suggest using TWS search to verify whether the symbol is supported.

Reproducing the Problem

self.add_cfd("NVDL", market=Market.INTERACTIVE_BROKERS)

Checklist

AlexCatarino commented 2 months ago

Replaced by https://github.com/QuantConnect/Lean/issues/7972