ibind icon indicating copy to clipboard operation
ibind copied to clipboard

conid parameter in 'make_order_request' function

Open zacciep opened this issue 1 year ago • 5 comments

I believe conid needs to be an int, not a str.

zacciep avatar Jun 21 '24 17:06 zacciep

Note that the 'live_market_data' method checks its parameters and requires a str (as it builds a list).

zacciep avatar Jun 21 '24 17:06 zacciep

Hey @zacciep thanks for pointing it out. I've modified the make_order_request as per your suggestions. I'll publish it with the next minor release.

As for the live_market_data - I'm sorry but IBind doesn't have such a method. If you meant the live_marketdata_snapshot method, it indeed expects strings as it builds a list as you describe. I'm not sure I understand the message behind what you wrote - could you elaborate?

Voyz avatar Jun 22 '24 07:06 Voyz

I was just pointing out the inconsistency between the need for conid as an int to get ‘make_order_request’ and ‘place_order’ to work, vs ‘live_marketdata_snapshot’ actively insisting on conid as a str. Do you have an approach of keeping parameters in the same format as IBKR within IBind, or converting them on request? If the former, then for consistency should ’live_marketdata_snapshot’ take the conids as a list of ints (and convert them into a str itself)?

zacciep avatar Jun 22 '24 09:06 zacciep

Understood, thanks for clarifying. Truth is, the API seems to accept both str and int. I know they specify just one or the other, but I never saw a request rejected for that reason.

That being said, it probably is a good idea to introduce more consistency there. I'll look into it at some point when I find a minute

Voyz avatar Jun 24 '24 05:06 Voyz

v0.1.5 has been released adding consistency to conid params. Thanks for your contribution! Feel free to close this issue 👍

Voyz avatar Aug 19 '24 15:08 Voyz