-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use named parameters for ib.contract.XXX #137
Comments
@meteorpublish I agree this change will make writing contracts more flexible and easier to read, however it'll be a breaking change. Any suggestion for introducing this without touching existing API? |
Well, since the package is at v0.x, its API is not really guaranteed per semver anyway. One suggestion would be to release v1, rewritten using ES Modules, and with named parameters. For v0.3, could ib.contract({ type: 'stock', symbol: 'AAPL' }) Otherwise, methods with an ib.contract.fopO({ symbol: 'ES', expiry: '20190920', strike: ..., }) |
@meteorpublish Yes, you're right about v0.x. I however still wish to maintain this library that doesn't surprise existing users unless it's absolutely necessary. I prefer the cleaner |
@pilwon: do you still have time to maintain this library? I've submitted a PR announcing that it needs maintainers. |
The long list of parameters for various contract types is unwieldy, and also inconsistent in the parameter order:
future: symbol, expiry, currency, exchange, multiplier
fop: symbol, expiry, strike, right, multiplier, exchange, currency
Using destructured parameters would make calls consistent, and much less error-prone:
I'm writing a function that parses strings into contract and it's a long
switch
statement right now because of the variable parameter order.The text was updated successfully, but these errors were encountered: