Voyz/ibind

marketdata_history_by_symbol gives ExternalBrokerError

Closed this issue ยท 2 comments

the call to marketdata_history_by_symbol in rest_05_marketdata_history.py gives an ExternalBrokerError.

I also took a look at marketdata_history_by_conid and noted small difference,

marketdata_history_by_conid
request={'url': 'https://XXXXX/v1/api/iserver/marketdata/history', 'params': {'conid': '265598', 'bar': '1min', 'period': '1min', 'outsideRth': True}}

marketdata_history_by_symbol
request={'url': 'https://XXXXX/v1/api/iserver/marketdata/history', 'params': {'conid': 265598, 'exchange': '1min', 'period': '1min', 'outsideRth': True}}

As you can see, exchange is suddenly '1min', so some mess up with the parameters. exchange is not even provided in your example.

Opposite to the first call, conid is provided without quotes, to me it looks like an integer. maybe that is the problem?
Update: I called ...conid with an integer conid, still working. So as of now, I am cluesless of what's going wrong here

Voyz commented

Thanks for reporting @HaSiMiPa ๐Ÿ‘ As far as I know, the API accepts both integer and string conids, but I'll have a look at that too to double check.

The '1min' was the right clue. I introduced that error when I realised that the bar was not an optional parameter and shifted the order. I've fixed it now and released v0.1.2 with a fix. Let me know if it works ๐Ÿ‘

fixed at light speed, great work ๐Ÿ‘