pilwon / node-ib

Interactive Brokers TWS API client library for Node.js
381 stars 133 forks source link

Fix Option Greeks with values > 1. #166

Closed mfrener closed 3 years ago

mfrener commented 3 years ago

During using node-ib for getting option greeks, I have noticed that sometimes there are MAX_VALUE's returned instead of the greek value. Reason is a check on incoming.js that caps values > 1 to MAX_VALUE. This is not good, is i.e. vega can be > 1 and so you get MAX_VALUE instead of the actual value. Did a cross-check with EDecoder.java private void processTickOptionComputationMsg() throws IOException from IB SDK, there they also do NOT check abs() > 1, but against the error indicator value. This PR is about align the JS code with the Java code and fix option greek values > 1.