Investing in the stock market can be fun and rewarding, but it requires careful research, analysis, and decision-making. It takes time and effort to develop a method or system that allows you to explore investment ideas easily.
Now, with the rise of generative AI, is there a way to simplify investing so that anyone can easily make profitable investment decisions and maximize their returns?
I've had many challenges while exploring rules-based investing. Some common obstacles include brainstorming investment ideas until they can be defined through real data and information, testing ideas before investing money into it, and managing important details like diversification and risk. Overall, investing requires a lot of effort, which can be a barrier for many people looking to maximize their returns.
Generative AI offers a potential solution to make investing easier for everyone. It allows anyone to implement active investment strategies more easily. In this blog post, I'll start with a simple idea: stocks that are going up should continue to go up. Using ChatGPT as a guide, I aim to create a profitable trading strategy with a fifteen minute conversation. This chat gives us a glimpse of how generative AI can change everyone's investment future.
Below the conversation with ChatGPT that helped us turn an idea into a profitable trading strategy. We will only include summaries of what ChatGPT said below, however we encourage you to try this on your own so you can see all the information it gives. To prepare GPT for this, we instructed it to behave as if it were 2016, and only give us information relevant to that time.
Us: what does it mean in investing for if a stock is going up, it will keep going up?
GPT: Investors can approach investing with the belief that if a stock is going up, it will continue to rise through strategies such as momentum investing, trend following, sector rotation, and implementing stop loss orders. Momentum investing involves buying stocks that have show higher price appreciation, while trend following aims to identify and invest in stocks with established upward trends. Sector rotation involves investing in sectors experiencing growth, and stop loss orders provide risk management by setting a predetermined selling price if the stock's price declines. However, it's important to note that market dynamics can change, and no strategy can guarantee consistent success. Diversification, research, and risk management are crucial.
Great. Now we have a way to explain our idea in investing terms. Furthermore, GPT also tells us some things we need to consider for a healthy strategy, with the mention of diversification, risk. These are points which we will revisit later. Let's continue to work on our idea for now.
Us: Exactly, I want trend-following. What are some specific ways that I can implement trend-following strategies?
GPT: Here are some specific ways to implement trend-following strategies in investing. One approach is to use moving averages, where a shorter-term moving average crossing above a longer-term moving average generates a buy signal, indicating an uptrend. Breakout trading involves identifying when a stock price breaks above a significant resistance level, signaling potential upward momentum. Trendline analysis helps determine trend directions by observing higher highs and higher lows for uptrends and lower highs and lower lows for downtrends. The Parabolic SAR indicator can provide entry and exit signals based on the dots appearing below or above the price, indicating uptrends or downtrends. Moving average envelopes help identify overbought and oversold conditions and potential trend reversals.
GPT mentioned some potential signals that we could use. From here, we could try out these different signals to see which one is the best. For now, we like the ease of using moving averages, and want to try implementing a moving average strategy.
Us: Can you give some ideas for moving crossover averages? What groups of values to pick for short MA and long MA, and can you provide some reasoning for why you would pick those pairs?
GPT: Certainly! When implementing a moving average crossover strategy, the selection of short-term and long-term moving average (MA) pairs depends on factors like the timeframe, stock volatility, and trading objectives. Popular choices include the 50-day and 200-day MA for identifying intermediate to long-term trends, the 20-day and 50-day MA for capturing shorter-term trends, and the 10-day and 50-day MA for very short-term or intraday trading. The specific MA pairs chosen should align with individual preferences and market conditions, and it's important to combine them with other technical indicators for confirmation. Experimentation and adapting the strategy to fit personal trading style is essential.
We now have different combinations of moving averages and their underlying idea, whether it is to capture short-term or long-term growth. As ChatGPT mentioned, we can experiment to find the right combination down the line. We have another issue though, we doesn't know what stocks to pick and watch in our strategy. One idea is to pick certain stocks from an industry. Let's try to find companies that are exciting and interesting to invest in.
Us: What are some industries where innovation is most visible?
GPT: several industries were at the forefront of innovation. The technology sector was experiencing advancements in AI, VR, AR, IoT, and cloud computing. Healthcare was undergoing a digital transformation with telemedicine and wearable health devices. Renewable energy was growing rapidly with improvements in solar and wind power technologies. The automotive industry was shifting towards EVs and autonomous driving. Fintech was disrupting traditional financial services with mobile payments and blockchain technology. E-commerce was transforming retail with online marketplaces and personalized experiences. These industries showcased visible innovation
Us: I like tech. What are some of the most popular tech stocks that have been exhibiting growth?
GPT: As of March 2016, several popular tech stocks were exhibiting growth. Apple (AAPL) was recognized for its consumer electronics and strong brand presence. Alphabet Inc. (GOOG), the parent company of Google, dominated the search engine and online advertising industry. Microsoft (MSFT) was known for its software, cloud computing services, and gaming platforms. Amazon (AMZN) stood out as a massive e-commerce retailer with various services like Amazon Prime and AWS. Facebook (FB) had the largest social media platform and owned Instagram and WhatsApp. NVIDIA (NVDA) specialized in high-performance GPUs for gaming, AI, and autonomous vehicles. Netflix (NFLX) disrupted traditional media with its streaming service and original content. Salesforce (CRM) provided cloud-based CRM solutions.
Awesome. Now we have a basic understanding of the signals we will use, and the stocks we want to invest in. Now let's see if ChatGPT can explain the overall idea and tell us how we can actually implement it.
Us: I am incoporating the moving average crossover idea and I believe it can work with some of the stocks you gave me. How can I combine both ideas together of trading this group of stocks with the cross-over signals.
GPT: With your selected stocks and chosen moving averages, monitor their prices for crossovers. A bullish crossover occurs when the shorter-term moving average crosses above the longer-term moving average, indicating a potential uptrend and a buying opportunity. Conversely, a bearish crossover happens when the shorter-term moving average crosses below the longer-term moving average, suggesting a potential downtrend and a selling opportunity. Regularly review the strategy performance, apply risk management techniques like diversification and setting stop-loss orders to protect your capital.
Okay, we know how to use our signals now. However, we still need more information into how to actually do it.
Us: If I have 10,000 dollars for this strategy, how can I invest across 5 stocks to perform these trades
GPT: One approach you can consider is to equally balance your funds across the selected companies in your portfolio. By allocating an equal percentage to each stock, you ensure a balanced distribution of your investment. To maintain this balance over time, it's important to regularly monitor the performance of your portfolio and review the allocation of each stock. If the allocation deviates significantly from the desired percentage, you can implement rebalancing strategies by buying or selling shares to realign the allocations. Rebalancing helps to ensure that your portfolio remains properly diversified and aligned with your investment objectives.
Awesome, we now have a strategy that we want to test.
Our idea: A MA-Crossover strategy focused on a main group of 5 technological stocks with equal allocation of funds, buying or selling when the moving averages cross over. We will rebalance monthly. All of this built off of the idea of wanting to invest in stocks that have been going up.
Before we start testing this strategy, let's see how ChatGPT helped us create a trading strategy. It took a simple idea and made it understandable for investing. It gave me ideas for the data and signals to use in the strategy. It helped me choose stocks I might want to invest in. Most importantly, it reminded me of the important steps in safe investing, like experimenting and managing risks. This is just the beginning of what ChatGPT can do.
While I'm testing the strategy, GPT can help me come up with different tweaks which might improve returns: It can suggest how to allocate funds among different stocks, good stop-loss levels, and other stocks to consider. In our conversation, ChatGPT not only helped me fully develop my initial idea but also provided various options for future modifications. It made investing like a choose-your-own-adventure book.
Now let's see how we did.
Overall, our strategy built with ChatGPT did really well. In a two-year period from 2016 to 2018, it generated a 65.5% return on investment, compared to 41.3% if we had invested in SPY. The strategy had a strong Sharpe Ratio of 2.873 and a CAGR of 28.65%. These are impressive numbers for a strategy that started as a simple idea of "if a stock is going up, it should continue going up."
However, the strategy is not perfect. The moving-average crossover signal we used wasn't very efficient, and we missed out on potential gains compared to just holding the five stocks and rebalancing. We could have tried expressing our idea differently, like investing in the top momentum technology stocks, which ChatGPT could have helped us explore further. Also, we only tested the strategy from 2016 to 2018, and it might not do well in different market conditions.
Despite its flaws, ChatGPT helped me a lot in applying my idea quickly. In just a fifteen-minute conversation, it guided me through the research and explained concepts, saving me time and effort. It was like a co-pilot in my experiment to build a trend-following strategy, even though it was a basic one. Generative AI's role as a co-pilot is just beginning, and it will revolutionize how we invest in the future. In this early stage, I still had to do most of the work, from coding the strategy to experimenting with variations for better returns. Soon, it will be capable of doing all the legwork for you, becoming a mini-hedge fund that follows your investment ideas.