Hacker News new | ask | show | jobs
by AndrewBissell 2238 days ago
Incorrectly assuming values can never be negative is an all-too-common occurrence in trading and financial software. In 2012 Swedish stock futures trading was suspended for a time because their matching engine used an unsigned type for order quantities and someone submitted an order with a negative value which wrapped around to 4 billion: https://www.reuters.com/article/markets-sweden-bug/swedish-s...

Interactive Brokers' software is usually very solid. I'm surprised they weren't ready to handle this, the possibility of oil going negative had been discussed for some time before it happened.

4 comments

I particularly dislike the attitude of the CEO which shows he either doesn't know or pretends that he doesn't know how such contracts work. Please read the contract specs and educate yourself a little, Mr. Peterffy, they're public and free.

> Peterffy said there’s a problem with how exchanges design their contracts because the trading dries up as they near expiration. The May oil futures contract -- the one that went negative -- expired the day after the historic plunge, so most of the market had moved to trading the June contract, which expires May 19 and currently trades around $24 a barrel.

> “That’s how it’s possible for these contracts to go absolutely crazy and close at a price that has no economic justification,” Peterffy said. “The issue is whose responsibility is this?”

Nobody ever promised neither liquidity nor positivity of prices, it is the fault of the brokerage, plain and simple. Thankfully $100M is something that IBKR can take on their books (they have $3B of cash according to the latest filling).

Yes this is a very CYA statement. IB has been in this business for a long time, Peterffy knows very well that expiring futures contracts can experience all kinds of liquidity problems and large swings in price.
But if it’s never happened before, and you’re some random programmer making this stuff, I’m not surprised there are all kinds of assumptions being made when choosing data types and validating inputs...
"No economic justification"? That has to be faux-naïf. Yes, I was shocked at first to hear of prices turning negative. For about thirty seconds. Once I learned that the oil had to be delivered somewhere without enough storage, and under conditions of extreme low demand, it was perfectly obvious that you'd end up paying someone else to take the oil off your hands. Either Peterffy is too stupid to understand mass-media reports on his own field of business – not likely – or he's disingenuous, which says something about how he sees his clients.
Peterffy is a long time industry vet. He brought a lot of tech to trading in the 80's. He knows very well how things work.
>Interactive Brokers' software is usually very solid.

That is certainly not my experience. Endless bugs in TWS over the years, and the support people are unbelievably rude. Every time I try to report a bug they start out by blaming me, it usually takes 2-3 back and forth rounds until they admit it's actually broken and tell me they'll forward the issue to the tech people. After that it's radio silence and you never know if they'll actually fix it or not.

And let's not get into the disaster that is their API...

Completely agree. Their mobile app, TWS, API, and websites are all a nightmare. I left them as soon as I stopped trading on margin (the only really compelling reason to use them for a retail trader/investor).
I'll admit I haven't worked with their API or done anything too fancy with it. My experience is all relatively infrequent click trading, chart generation, and such.
> Interactive Brokers' software is usually very solid.

Except their web portal. 40-50% of the time it is unable to load my portfolio data (even without the current market value, just the number of stocks and cash balances). At the same time I log into the mobile app, it forces a logout on the web app (why?) and it is able to load the balances and portfolio. No explanation. Same network, no adblocker or other browser plugin.

The single session thing is annoying. I'm guessing it is related to their various data provider regulations. The large brokers can get around this because, well, you are not really seeing pool depth and the like.
I'm going to guess there's two teams involved on the IB side of things. There's financial engine team which processes and handles trades. And there is the UI team that displays the data and allows people to create trades. I bet the engine handled these fine and issue was that the UI team had data validation checks to prevent negative values.
Nope. It was not possible to trade at negative.