Chapter 1 is here.
“Tom, you better check this out”.
It had been nearly three years of coding and getting closely acquainted with Tom’s garage. Despite being big enough to hold two SUVs, Tom and Dan managed to clutter the entire building with five servers, several desktop computers, a spaghetti cluster of electronics and cables, books, and a 2 metre stack of market data print-outs. They hadn’t made 100 million. They hadn’t released the code on Sourceforge. And neither Tom or Dan owned a mahogany power boat. Every weekend Tom was convinced they were nearly there. He had quit his day-job in anticipation, and was doing his best to convince Dan to do the same. The more time they had available to work on the project, the sooner he’d be on his way to Fiji.
But their prediction system only ever seemed to get around 40% accuracy of the New York stock market. It was a risky investment. Statistically an investor was better off asking a stranger on the street.
But this time something was different.
It was 10.05am, and another sunny Saturday morning in Auckland.
Dan had just arrived and settled down at his workstation, welcomed by the lingering smell of stale pizza and day-old-beer. He was perusing the data logs to find the best predictor from the previous night.
In less than an hour the New York stock exchange would be closing for the week.
On his screen Dan had the current stock prices from the NYSE, a live feed depicted as elusive little red lines that they had both come to hate. It was a graph of stock prices against time. Leading the live feed by 40 minutes was a a pale blue line, Dan’s best predictor from a population of over 100,000 different algorithms. The output was from a cluster of new 7th generation algorithms, MS83. Since 9am NYT, the live feed had been closely following the output of MS83. Not exactly, but damn closely. Enough to make someone very rich.
“Wow”, said Tom.
They continued to watch the dance of the lines. Uncannily the live feed matched their blue predictor. Tom felt tingling goose bumps envelope his body.
“We should buy”, he suddenly stated.
“What! You’re crazy. It’s probably just another random anomaly.”
“No, it’s gone on for too long to be random”.
“But I’d wait and see”. Dan was not convinced. He had seen this before, albeit for only brief periods of time.
“Look”, Tom reasoned excitedly, “whatever it has modeled, it’s doing it accurately now. By next week the market might change because of a drop in oil prices or something, and this algorithm will die off. I think we should buy. Look it’s now 4.21pm in New York, and it’s predicting that by closing time GBS stock will jump from $2 a share to $3.65.”
Tom called his stand-in stock-broker and ex-girlfriend Mandy. Tom had finally relented and asked her for a loan to fund his company. He was planning on not only using the prediction software for one off investments for himself, but also to run his finance consultancy business, ETR Systems. His days as a VB6 programmer were long behind him. Mandy had provided Tom with the financial backing he needed. She had also shown him how to invest. All for a small cut of 25% of any profits. She was shrewd and calculating, and he hated her for it, but she was also the only one who knew him well enough to realize that he might just be onto something.
“Mandy, I need you to transfer $1200 into our STK account, I want to buy 200 GBS stock”.
“Tom, are you sure? You’ve already maxed out your credit card”.
“Yes, dammit”, replied Tom. It was uncharacteristic of Mandy to care about his personal finances. As long as it was his money, and not hers, she was happy to see him in debt and miserable, but if he happened to make a profit, she would be first in line to take a cut.
“OK, Tom, I’m doing it now”, she replied. “What’s going on?”
“It’s just a hunch, Mandy.”
“OK, the the transfer’s complete. I hope your program thingee is onto something this time. I’ll be watching.”
“Thanks”, said Tom as he hung up.
Anxiously he stared over Dan’s shoulder at the screen. Dan, had filtered out everything except for the live feed and predictor for GBS.
The adrenaline rushing.
It was 4.17pm NYT. GBS was hovering around $2.10 a share. MS83 was predicting it would rise to $2.35 by 4.20pm.
The cheap Chinese garage clock ticked over to 10.20am. The live feed had risen to $2.32, closely matching MS83’s predictions.
It was now 4.21pm. GBS had risen to $2.43, slightly above MS83’s prediction
4.27pm. GBS was now selling for $3.02 a share, already giving Tom a potential 30% return on investment.
Three years ago Tom never imagined watching the stock market could be this exciting.
4.34pm. MS83 had predicted GBS would sell at $3.27, and then continue to rise, before closing at $3.45. The stock was currently selling at $3.21, slightly below the predictor, but still reasonably accurate.
4.37pm. GBS was now selling at $3.12. A slight drop. But, overall it still seemed to be following the predictor. It was just a local anomaly Tom told himself. But he started having a nagging feeling. Nothing serious, but something didn’t seem quite right. As long as it would hold at that, he could still make a healthy profit.
4.40pm. The live feed started to erratically deviate from the predictor. The value of GBS dropped below the $2.00 mark. Something was going very wrong.
“What’s happening!”, cried Tom.
“I don’t know, whatever caused it to predict, it stopped. Look, it’s right off.”, said Dan, frantically tailing the logs.
And sure enough the pale blue line was not even close. And then it died off completely, replaced by FW3224 a completely new 9th generation algorithm, that was back to achieving their more usual 40% prediction rate.
The market closed with GBS valued at just $1.07 a share.
“Damn it, I’ve lost nearly $600.”
“I told you, you should have waited”, Dan smugly mused.
“Go to hell”, muttered Tom. In about a minute he’d have Mandy’s gloating in self glory to contend with, he didn’t want Dan doing the same also.
The following week, needing the money, Tom was forced to sell his GBS shares for $1.35, losing close to $400.
Tom spent days trawling through the logs trying to determine what had happened, trying to find a bug in Dan’s code, desperately trying to recuperate his losses. What caused MS83 to get so close for so long, and then fail so disasterously?
But, he was unable to find anything. There was nothing significant happening between 4.21pm and 4.37pm, when the algorithm stopped predicting. There wasn’t a speech made, an election won, a game lost, or a company gone public.
And then it hit him.
He couldn’t see why the there was a drop in stock prices at that point. No-one could. And neither could MS83. But from 9.00am to 4.27pm MS83 was accurate, and doing what up until now had been believed to be impossible. There could have been any reason why MS83 failed. It was an evolutionary algorithm. Maybe it had a bad mutation. But, there was no reason why the next generation couldn’t evolve into something better. All it needed was a bit more tweaking, and a bit more time.
They were getting close.