Skip to content

Cannot download data despite the IB symbol is correct.  #12

Description

@cheukhin1024

I want to download HSI data. (HSI is Hang Seng Index)

I followed the guide https://www.wrighters.io/how-to-get-historical-market-data-from-interactive-brokers-using-python/ to download the HSI Hang Seng index data using the following bash command script:

./download_bars.py --size "1 day" --security-type IND --max-days --exchange HKFE HSI

Yet, there is an error: No security definition has been found for the request . I want to know whether this ib-scripts project support downloading non-US data because all examples are US-related. Thank you!

The following is the full terminal result:

10:59:59,183 ibapi.client INFO sent startApi
10:59:59,183 ibapi.client INFO REQUEST startApi {}
10:59:59,183 ibapi.client INFO SENDING startApi b'\x00\x00\x00\x0871\x002\x000\x00\x00'
10:59:59,183 root INFO Connected
10:59:59,183 root INFO Waiting for thread to finish ...
10:59:59,186 ibapi.wrapper INFO ANSWER nextValidId {'orderId': 1}
10:59:59,186 root INFO nextValidId: 1
10:59:59,186 ibapi.client INFO REQUEST reqContractDetails {'reqId': 1, 'contract': 2416213105680: 0,HSI,IND,,0.0,,,HKFE,,USD,,,False,,combo:}
10:59:59,187 ibapi.client INFO SENDING reqContractDetails b"\x00\x00\x00'9\x008\x001\x000\x00HSI\x00IND\x00\x000.0\x00\x00\x00HKFE\x00\x00USD\x00\x00\x000\x00\x00\x00"
10:59:59,187 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfarm'}
10:59:59,187 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfarm
10:59:59,187 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:euhmds'}
10:59:59,187 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:euhmds
10:59:59,187 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:hkhmds'}
10:59:59,188 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:hkhmds
10:59:59,188 ibapi.wrapper INFO ANSWER managedAccounts {'accountsList': 'U7079876'}
10:59:59,188 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:fundfarm'}
10:59:59,188 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:fundfarm
10:59:59,189 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:ushmds'}
10:59:59,189 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:ushmds
10:59:59,189 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2158, 'errorString': 'Sec-def data farm connection is OK:secdefil'}
10:59:59,189 ibapi.wrapper ERROR ERROR -1 2158 Sec-def data farm connection is OK:secdefil
10:59:59,560 ibapi.wrapper INFO ANSWER error {'reqId': 1, 'errorCode': 200, 'errorString': 'No security definition has been found for the request'}
10:59:59,560 ibapi.wrapper ERROR ERROR 1 200 No security definition has been found for the request
10:59:59,560 root ERROR Error. Id: 1 Code 200 Msg: No security definition has been found for the request
10:59:59,561 root ERROR The security doesn't exist, check your parameters
10:59:59,561 root INFO Sending code 0
10:59:59,562 root INFO Received code 0
10:59:59,562 ibapi.client INFO disconnecting
10:59:59,562 ibapi.wrapper INFO ANSWER connectionClosed {}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions