AI Trading program placed #18 nationally (25.87% return in 4 weeks)

A few weeks ago, I wrote about a tool I created to keep a “peripheral eye” on the stock market, with plans to plug it into on online brokerage that could make trades automatically (without any involvement from me). This post seeks to share the results from that endeavor.

Between October 26 – Nov 20 ’20 Alpaca held it’s Annual trading competition that includes both active and passive traders across a multitude of strategy including Swing Trading, Day Trading, Shorts, Longs Options, Margins and so on. I decided to enter what I had made so far at the time, which was only the Swing Trading & Long only strategies. Besides being the easiest to implement, I treated my portfolio as a personal investment account, did not use margins to leverage my returns, and focused on buy low and sell high.

Obviously this came with its Pros and Cons.

PRO: the maximum risk was to lose the value of the stocks the program was holding.

CON: difficult to generate “high” returns due to 1:1 leverage and limited upside potential. (how much can a stock really grow in 4 weeks?)

So What Happened?

Market Performance

To start, we need to look at the market overall to get a better picture.

S
S&P 500: Mid Oct – Mid Nov ’20

The market during this time was mostly sideways, with small moves. It opened at $3,440.66 on Oct 26, 2020 and closed at $3,557.15. With a net growth of 3.38%.

The low was $3,230.69 on Oct 30th with a high of $3,645.20 on Nov 9th. Someone who would have perfectly timed the market and bought and sold between these two points would have made 12.8%.

Trading Bot Performance

Obviously the trading bot was not buying and selling the market overall, but was instead trading individual stocks. The trading bot performed better with an overall return of 25.8% in the 4-week period.

Portfolio Performance over Contest

Portfolio Performance over Contest

@karmcy on leaderboard

@karmcy on leaderboard

The interesting part about this is that I actually was a late entrant to the competition as I was working on a project for work, and so missed the best buying opportunities during the market low on Oct 30th. Still, the program started trading a few days after, and grew quickly amid a slightly bull market.

As you can see, the returns were generally positive, with little swing – which is something that was planned. At its highest point, the algorithm had created 27.81% of unrealized profit – and ranked #8 overall.

However, since this was a contest within a 4-week timeframe, an exit strategy became important as the strategy I was using required multiple weeks but I only had a few days. At this point, I took a very risk averse outlook with an emphasis on preserving and growing the capital instead of trying to buy new stocks (which would again need time to grow).

My modifications at this point were new to me, and I made mistakes exiting these stocks, losing about 2% of overall gains, and ending at #18 nationally with 25.87% profit (or $25,868.77 in profit from a starting balance of $100,000). 

Final Leaderboard at competition close

Final Leaderboard at competition close

Post Competition Thoughts

1. Margin/Leverage + Options vs Investment + Long-only

The first observation I had was that there was consistent fluctuation among the top 10 in the leaderboard. The top few rankings would consistently change between people who made a lot of money, only to lose it all and drop out of the rankings next week. In fact, several of the people who finished on top at the end of the competition had swung up over 300 places only a couple days before the competition closed. 

Logically, this makes sense, high risk yields high reward scenarios and a 4x leveraged options trading strategy can do just that. Still, this was acceptable to me and something I consciously chose not to do, but looking forward – I will consider ways to maximize some returns while keeping risk at a level that is acceptable to me. At the very least, I’m looking into an Artificial Intelligent strategy to short stocks on the way down.

2. Human traders vs Artificial Intelligent / Machine Learning Machines

Most of the people on the leaderboards were human traders (if you look at the leaderboard image where I was ranked #8, 9 of the top 12 competitors were active traders aka human beings who were “Active Daily Rebalancing” their portfolio). Besides the point covered above, I didn’t find any noticeable advantage or disadvantage of humans when compared to an AI trading program that incorporated statistics and machine learning in a way that humans are not able to do quickly. Still, I also don’t have a lot of data to make this inference as I didn’t see many AI bots on the leaderboards, so its hard to say.

3. On the spot changes to strategy / Quick Fixes

The final observation I had (more of a lesson) is that on the spot changes to strategy – regardless of how well-intentioned they may be, lose money. Most of the program’s success came from well researched concepts from other trading experts and industry leaders that were coded into it by me. However, when I started to tweak things based on “what made sense to me personally”, (as I did towards the end of the contest) – the program lost money. I’m confident that had I left things alone, the returns would have continued to grow until the last day, which goes to show that when trying new things, you have to try in the lab before putting it in the real world program. Luckily, I did view the whole contest as a lab anyway, and was willing to take the risk of a mistake.

So what’s next?

Overall, I was quite happy with the performance of the robot, and have since moved it to the real world, where it seems to be doing well so far (between 1-4% returns on some weeks, but too early to tell). However, I plan to take a break and build to it some more to be more intelligent and also prepared for outlying conditions (for example, a massive sell off). 

I’d also like to incorporate the Day Trading strategies, or at least test them out, which require data analysis in shorter periods.

If things go well, maybe this program can scale and I’d be happy to invite some of my friends to allocate some of their capital to this as well. But theres a long way to go before I feel comfortable to do something like that, and until then, you can look at the daily watchlist the program recommends below. And as always, suggestions and criticisms are welcomed.

*The stocks in BLUE are the ones I traded – but the program often bought them at an opportune time. Also, I may be playing around with my strategies in the future so use at your own risk!