node-ib icon indicating copy to clipboard operation
node-ib copied to clipboard

Default value on contract.future multiplier parameter causes issues

Open lewisdawson opened this issue 8 years ago • 3 comments

I just tried to upgrade from an older version of IB and my code started failing. After some digging, I discovered the addition of the multiplier parameter was the cause. A contract.future initialization without a multiplier works just fine, I'm not sure why it was failing for @claude2 -- I commented out the multiplier addition from #61 locally to verify this across many different futures symbols and I had no issues.

Having a default value of 50 for a multiplier causes a lookup to fail when 1) you don't specify a multiplier 2) the symbol you're looking up does NOT have a multiplier of 50. You get Error: No security definition has been found for the request. I propose that there should be no default value for the multiplier parameter -- it should be set to undefined if it's not supplied.

lewisdawson avatar Feb 27 '17 03:02 lewisdawson

Just thinking about this, perhaps this has to do with the version of TWS/Gateway being used. @claude2, what version were you seeing #61 on?

lewisdawson avatar Feb 27 '17 03:02 lewisdawson

@pilwon @claude2 I'm going to open a pull request that makes the change I propose above, but it would be ideal if we could figure out why it wasn't working for @claude2 without a multiplier before a final change is made.

lewisdawson avatar Feb 27 '17 04:02 lewisdawson

@lewisdawson's PR #93 was merged and published as v0.1.20

pilwon avatar Feb 27 '17 20:02 pilwon