HK Blotter Order (ibkr): No security definition has been found for the request

I want to trade stocks from the Hong Kong exchange (XHKG or SEHK in ib) among other exchanges. For now, I have only encountered this problem when placing orders for securities of the HK exchange.

I’m using EOD data from the EDI dataset to run my strategy and generate the orders, then to place them I’m using blotter with my ibkr paper account.

I’m receiving the message ‘No security definition has been found for the request’ whenever I try to place an order using blotter.

Example: for Sid FIBBG00B8MPGL2, Symbol=6865, edi_LocalSymbol=06865, ibkr_Symbol=6865, ibkr_ConId=213680557

If I try to track the symbol in TWS it locates the security if I use 6865 as the symbol but doesn’t work if I place the symbol with the trailing zero. (I don’t think this is the cause of the problem, as the API seems to be using the correct ibkr_ConId)

The Ib Gateway API log looks like:

============================== Log file: /root/Jts/lcpaclincngcegoijkbihijkkjbldpnajnfnnaje/api.6001.20210324.054857.ibgzenc =============================
05:48:56:803 <- 49-1-
05:48:56:805 -> —49-1-1616579336-
05:48:56:805 <- 49-1-
05:48:56:805 -> —49-1-1616579336-
05:48:56:806 <- 3-123-213680557----0.0—SMART-------BUY-500-MKT—Day–DUXXXXXXX–0-dma-tech-1-0-0-0-0-0-0-0–0--------0—1-0—0---1-1–0------0-----0-----------0—0-0—0–0-0-0-0–1.7976931348623157e+308-1.7976931348623157e+308-1.7976931348623157e+308-1.7976931348623157e+308-1.7976931348623157e+308-0----1.7976931348623157e+308-----0-0-0–
05:48:56:829 -> —B4-2-123-200-No security definition has been found for the request-

EDIT:
I have tested with securities from several exchanges and so far the results are:

Exchanges that doesn’t work:
‘XSES’, ‘XMEX’, ‘XHKG’

Exchanges that seems to work:
‘XNYS’, ‘XTSE’, ‘XLON’, ‘XASX’, ‘XASE’, ‘XNAS’, ‘XTSX’, ‘XFRA’,‘XJPX’,‘XMAD’,‘XETR’

When I use TWS to place the orders, there isn’t any problem…

Per the docs, this could happen if the exchange isn’t valid for the security. Are you sure SMART works for those securities/exchanges? Make sure you replicate the TWS order exactly.

Ooops! for securities trading on some exchanges it seems that SMART doesn’t work…

Thank you, Brian!