What I learned from building quant trading strategies with AI
Learnings and reflections from building with AI
Recently, the concept of AI coding has gained immense popularity on the internet. AI coding tools like Cursor, Replit, Trae, and Claude Artifact have demonstrated powerful capabilities in automatically generating advanced code, attracting millions of users. I've encountered numerous brilliant use cases online where people with no coding experience have built impressive apps and websites from the ground up with AI assistance, some even generating significant profits!
After witnessing so many examples, I couldn't resist trying it myself. Over the past two months, I used AI coding tools (specifically Cursor and V0) to build two products: my personal website and a quantitative trading program. Both experiences were surprising, as I watched how quickly and perfectly AI helped me build complete products from simple prompts. The quant trading program impressed me the most, especially after seeing how well it performed with real market data. I asked AI to code an LSTM-driven long-short strategy on QQQ (Nasdaq 100 Index), and it generated an annualized return of 78%! From the summary picture below, we can clearly observe that it precisely bought during market dips and shorted at market highs - words cannot adequately describe how shocked I am.
Here's how I built it with AI:
Step 1: Basic knowledge learning and idea generation
I had zero quant trading experience before starting this project and basically had no idea how to begin the process. So, I simply talked to AI. I asked Claude to teach me basic concepts of quant trading: how it works, what strategies can be used, and how these strategies are implemented. Within one hour, Claude helped me establish a solid understanding of the fundamentals and guided me to start with macro market indexes that I was previously familiar with.
Step 2: Trading strategy formulation and prompt writing
After acquiring a fundamental understanding, I worked with AI to solidify the strategies I wanted to experiment with. There were two major decisions: 1) On asset classes: we decided to focus on major indexes including SPY, QQQ, and BTC; 2) On strategies: we decided to implement three - one with simple technical indicators, one with machine learning techniques, and one with deep learning techniques.
With well-defined strategies, it then came down to my part of writing prompts clearly outlining my specific requirements for data sources, time ranges, trading logic, results summarization, etc. This was the most important work on my end. A specific prompt could effectively help AI understand every detail of my objective and set up a solid foundation that led to well-functioning code.
Step 3: Code generation and debugging
The rest of the process was fairly straightforward. With my prompt, AI directly generated lines of code that could precisely execute my requirements and achieve all the goals I defined. It's clear that AI models have made significant improvements and are now very advanced in their code generation capabilities. Simply using a natural language-based prompt, AI managed to create powerful code that executed very well and flawlessly realized what I demanded.
Some bugs emerged throughout the process, which used to be the part that tortured me the most before the AI age. It was painful to understand the mechanical reports computers provided. However, now I can just copy-paste them back to AI tools and let AI fix all the problems. Not only could it quickly understand what was happening with the reported errors, but AI was also able to automatically edit all code referencing to the error reports. After several rounds of quick iterations, all code started functioning as I originally expected. 0 suffering on my end!
Step 4: Implementation and result interpretation
After fine-tuning all code details, I just needed to deploy the code in my local environment and set up the required packages to ensure the code had everything it needed to operate. This included streamlining data flows, setting up ML/DL training environments, and defining result output formats. With AI's help, I could fully focus on being the project manager, simply making sure each piece of the project could be tied together, using the right input and generating the desired output.
As the last step, AI also played an important role in helping me understand and interpret the results generated by the trading algorithm. Since this was my first time conducting a quant trading exercise and some of the algorithms worked like a black box, some results looked confusing at first glance. But all I had to do was simply feed them to AI and ask whatever stupid questions I had. AI candidly guided me through understanding all the results, and we made some final tweaks. Finally, the whole project worked exactly as I had wished from the beginning!
I completed the entire process within one week of working on it on and off in my spare time - something that would have seemed impossible to achieve before. Without AI's help, one week would have barely been enough for me to learn the basic concepts.
What I learned from this process:
AI is revolutionizing project development from end to end. Learning and building are democratized for everyone
Throughout my development process, AI played an important part at each stage and smoothed my entire learning curve. From learning the basic knowledge to generating large amounts of code, then to debugging and interpreting results - I couldn't have achieved any of these without AI's help. This demonstrated AI's power in end-to-end project development. I started knowing nothing. AI was my teacher, thinking partner, developer, interpreter, and implementer throughout the whole project, while I only had to take on the project manager role - understanding the context and specifying my requirements. More interestingly, AI did a much better job than I could have in each role - it taught more effectively, generated code more efficiently, and iterated more productively. There is no better teammate than AI.
Now, I can fully understand the successful cases on the internet. It is entirely achievable to start from knowing nothing and then utilize AI to build everything, with excellent end results. Everyone is equipped with a powerful team consisting of AI tools. As long as you can specify your requirements, AI can build.
Learning to work with AI is the single must-have skill now
What needs from us is just learning to work with AI. No matter who we are, what projects we want to build, or what we don't know yet, AI will always be available to us. Prior to the AI age, I had to purchase tons of learning materials, subscribe to multiple educational accounts, and even hire different people to do what I was unable to. Now, I just have to ask and write prompts. If you don't believe AI can achieve what you want, it's because you haven't explored enough with it. Beyond coding, I have also found AI useful in many day-to-day scenarios, including data analysis, web development, design, writing, and language learning. And I believe there is still more to explore. With AI, I could become a very productive student, consultant, product manager, or whatever I want to become. I am freed from all the redundant work and learning previously required, and I can fully focus on creating and building.
What remains important to humans now is to have brilliant ideas
When almost all work can be done by AI, what's left for humans to do? From my experience building this project, it's coming up with ideas. AI won't build anything or initiate anything by itself. It needs to be triggered, and we just need to trigger it with ideas - the idea of wanting to learn, the idea of a brilliant product, the idea of an unsolved pain point. Looking at all products on the internet built with AI, what sets them apart is no longer coding capabilities, technical complexities, or knowledge and experience barriers. AI has eliminated them all. The only difference lies in the original ideas, which come from our different upbringing, different life experiences, and different levels of understanding of how the world around us works. We just have to articulate and inject this human knowledge into AI. Then another great product emerges. The impact of AI is comparable to the previous industrial revolution. With productivity fully unleashed by AI's work, the only edge humans possess is coming up with brilliant ideas.