gofinance / ib

Pure Go interface to Interactive Brokers IB API
391 stars 121 forks source link

DisplaySize in order must be 0 when received string is empty, not MaxInt64 #43

Open dimchansky opened 3 years ago

dimchansky commented 3 years ago

The default value of DisplaySize must be zero, not MaxInt64, when reading Order data from TWS. Otherwise if you try to send PlaceOrder request with the same fields as the received order, except for the parameter to modify, you'll get Unable to parse data. java.lang.NumberFormatException: For input string: "9223372036854775807" error from TWS. It's because TWS can't parse DisplaySize value that is equal to MaxInt64. Actually, when you call NewOrder method, the default value of DisplaySize is zero, not MaxInt64. Why it should be different, when you read the order from TWS?