- Gemy Zhou built a program that trades based on 20 to 30 data variables.
- He fed the computer 20 years worth of stock data to determine the relationship between data points.
- His challenge will be maintaining its performance by adjusting it to match market conditions.
Gemy Zhou finished second place in the stock division for the United States Investing Competition of 2022. He was among 326 entrants from across the globe who were putting their trading chops to the test during the worst year for stocks since 2008.
Zhou had a major edge: his knowledge of data science and coding. He entered the competition to put to test a stock-trading computer program he had spent a couple of years developing and tweaking. The program then spent that year executing trades on his behalf automatically and earning him a monstrous 440.4% gain for the year, according to his monthly brokerage statements viewed by Insider. He far outpaced the S&P 500, which fell 19.4%.
But don’t expect that he’ll easily repeat this performance, or that you will be able to. Norman Zadeh, the founder of the competition, was impressed when he heard that Zhou had built his own program and used it in the competition. But as a former professor of operations research — a branch of applied mathematics — at universities including Stanford and Columbia, Zadeh thinks there’s a low probability that Zhou will be able to put up these numbers again.
“His performance is probably a combination of skill and luck,” Zadeh told Insider after hearing of Zhou’s approach. “And so, more likely than not, he might return 30% next year. And I certainly would not suggest to people that you can just easily make 440% in the stock market. I think anybody who trades in the stock market should be happy if they make five or 10%.”
Zadeh added that anyone who can make significant returns in the market should be particularly proud of themselves because the stock market isn’t a completely level playing field.
Zhou’s previous attempt at trading had not been successful. In 2004, he tried trading Chinese stocks on the Shanghai Stock Exchange. Back then, he scoured through company data and earnings reports looking for strong fundamentals. It was a costly and time-consuming process, he said. He told Insider he barely broke even with that method. Two years later, he concluded that trading wasn’t for him.
Shortly after, Zhou moved to Canada and left behind his computer hardware business in China. When he settled into his new home, he didn’t have any job prospects and was living off his savings, he said. He had nothing but time on his hands. So he decided to direct his efforts towards improving his skills, particularly by studying data science and machine learning. One of his main resources was Coursera, an online educational platform that provides courses on all types of subjects.
Zhou had always been interested in anything that had the potential to make money. And since data science studies the relationships between different data points, the stock market seemed like a good place to test his skills. After all, traders use numerous indicators to try and predict price direction, he said. By 2020, he was experimenting with data and coding programs that could successfully trade.
“I thought that maybe data science is a possible way to trade,” Zhou said. “So I just tested and made a lot of experiments and back tests. Although I didn’t trade. but I did a lot of research.”
Building it out
He told Insider that in the beginning, he gathered stock data by using Python, a general-purpose computer programming language, to scrape 20 years’ worth of historical information from places like Yahoo Finance. This resulted in about 20 to 30 data points including things such as moving-day averages for different lengths of time. The data is used to infer the relationship between their features and outcomes. Zhou noted that this process is called model training, and it allows the program to recognize which combinations can determine outcomes, in this case, a stock’s price. Today, he uses Interactive Brokers’ data service to feed his program real-time stock information that doesn’t lag.
Zadeh noted that finding which variables — whether interest rates or news — influence the market most is the big question that every trader is after. And judging from Zhou’s competition results, it seems that he has been more successful than most at attempting this, Zadeh added.
But even after building the program, Zhou says he still doesn’t know which variables have more weight or impact on the machine’s decision to make a trade. However, since he had been a trader in the past, he could make educated assumptions on what variables may be less or more important given the market conditions, he said.
When Zhou first began testing the model in 2020 and 2021, it was breaking even until he made a few adjustments, he said. The main one was reducing the weight that short-term price movement had on the program’s decision to execute a trade. He did this by increasing the threshold of time the price must move before the program reacts to avoid triggering a premature trade. This adjustment was especially important in the highly volatile market of 2021. But when the market slowed last year, he reduced the threshold.
The program executes long and short positions. When the first order is placed to enter a position, the second order (closing order) is also placed at the same time at a calculated price. Positions can be held for an hour or until market closing if the right conditions weren’t met. At that point, Zhou said he determines whether he’s willing to hold the stock overnight, or whether he will manually sell it.
The program trades stocks ranging from pennies priced under $1 a share to large-caps and makes about 20 to 50 trades a day. The number of shares is determined by a preset amount, usually around 1-2% of Zhou’s portfolio and the availability of the market supply at the time, or the quantity offered at market bid price.
For example, at 11:32 a.m. on May 22, the program received a price change for Armstrong Flooring Inc., ticker symbol AFI which has since been delisted. It evaluated the value of the function which triggered a buy signal for 7,500 shares. The system immediately placed a buy order at the market ask price of $0.3004 and at the same time, it also placed a opposite closing sell order at the price of $0.3449, which was calculated by several factors such as market volatility and the symbol’s historical volatilities. About 20 minutes later, the market price rose and hit the sell order price of $0.3449 and the position closed.
Additionally, on February 17, 2022, at 9:31 a.m, the system received a price change for Knowbe4 Inc. (KNBE). The system immediately placed a sell order for 49 shares at a market bid price of $24.57. At the same time, it placed an opposite closing buy order at the price of $21.79, which was calculated by several factors such as market volatility and the symbol’s historical volatilities. About 17 minutes later, the market price declined and hit the buy order price, and the position closed.
In short, Zadeh says Zhou basically wrote a computer program that automatically generated trades. That’s similar to what quantitative hedge funds like Renaissance Capital do at a much larger scale. The issue then becomes, because you’re in a constantly changing environment, you have to modify the program — and that becomes the tricky part.
Matt Monaco, a 24-year-old stock trader who made over $1.4 million in two years, says he has seen YouTube videos of people trying to make basic trading programs using artificial intelligence. He was part of the wave of new retail investors that have increasingly flooded the market in the last two years. He believes the combination of retail traders and their use of machines to trade will probably increase as programs like ChatGPT make AI more accessible.
Monaco, who graduated with a degree in software engineering, tried a similar approach when he started trading. But one of the biggest problems he had was building an algorithm that could work well in all market conditions.
The program is currently set up to perform in less volatile markets, and Zhou says he isn’t sure whether it can continue to get these kinds of returns. It depends on how the stock market shifts and whether he can make the appropriate adjustments to his program, he said.
Zhou says the key takeaway from his experience is that regardless of whether you’re using a program or you’re trading manually, you have to back-test your theory. The second thing he learned is that market conditions are extremely important. As those conditions shift, your strategy should too.