Create A Trading Strategy With ChatGPT
For traders, one of the most interesting use cases for emerging new AI tools like ChatGPT is in helping with the creation and testing of trading strategies. In this blog, we’ll explain the steps we took to create a profitable trading strategy on TSLA using only six prompts from ChatGPT.
Whether you’re new to the markets or a seasoned vet, it can be difficult to know exactly where to start in regard to creating and testing trading strategies. In this blog, we will explore leveraging ChatGPT and TrendSpider to do exactly that. Let’s dive in.
For our first prompt to ChatGPT, we simply ask it to provide us with a list of popular, successful day trading strategies for the 15-minute timeframe.
The AI creates a list of 8 different broad-based trading strategy ideas. From Momentum to Moving Average Crosses, RSI Divergence, Fibonacci Retracements, VWAP, and more.
To keep things simple, we choose option one, Momentum Trading.
For our next prompt, we get a bit more specific about the momentum strategy that was suggested in Prompt One. Here, we ask ChatGPT to create a high win-rate momentum trading strategy for the 15-minute time frame.
ChatGPT provides a list of basic parameters that are likely to define a momentum-based strategy. It says we need to be in a positive-trending market, there should be high volume associated with the move, and momentum indicators like RSI or MACD should be flashing bullish momentum.
Next, ChatGPT goes on to define how we should think about both our entries and our exits. It says we should look for a breakout above a resistance level and potentially even combine that with a moving average cross. It also tells us that we should predefine our exit via risk management tools like stop losses and take profit orders. It even suggests a minimum of a 2:1 or 3:1 risk-to-reward ratio.
In Prompt Three, we get more specific to the TrendSpider platform and ask ChatGPT to use the criteria it defined in Prompt Two to create a set of parameters for our entry and exit. ChatGPT not only tells us how to define trend direction, but also the settings we should define for the volume, momentum, and price.
For trend direction, it specifically tells us to define that the 50-period SMA is greater than the 200-period SMA. This means we’re in a bullish trend. For momentum, it tells us to define that RSI is greater than 50. Finally, for the breakout, it says that we want to see the price breaking above the VWAP.
Next, we need to define our exit criteria. To keep things simple, we use the conditions ChatGPT provides for the ‘short trade’. They’re the exact same conditions as the long trade, just the opposite.
You’ve made it halfway! You deserve a discount.
Now that we have our momentum strategy defined in TrendSpider, we ask ChatGPT to give us a list of the best momentum stocks. Again, for ease, we select the first name it suggests, TSLA.
Now that we have the entry and exit conditions defined, let’s address the risk management tools that were suggested in Prompt Two.
We know that we can utilize the Price Behavior Explorer to help us understand how to choose our stop loss and take profit percentages, but we first ask ChatGPT to help us understand the tool.
In Prompt Five, we ask ChatGPT to explain how we can use the Price Behavior Explorer to help us define our take profit and stop loss values.
Within the list of items above, we focus on bullet point seven, which tells us that we should choose a stop loss level that provides a balance between giving the trade room to breathe and minimizing our risk.
In order to properly define a stop loss, we need to know the path that our trades tend to take. Using the Price Behavior Explorer, specifically the ‘Min/Max Change for Winners and Losers’ settings, we can visualize the level where our winners tend to draw down before reversing and set a stop just below it.
We can see on the chart above that level is at about 5%, so we should set a stop loss for that value. Additionally, using what we were told about risk-to-reward ratios; if our stop loss is at 5%, that means we need to be making at least double that, or 2:1 risk to reward, on our winning trades. With that in mind, we add a 10% take profit.
We run the test, but the results are unfavorable. There is some no-go highlighting visible, which suggests that there are fundamental flaws in our strategy and we should not go live with it until those flaws are fixed.
In our final prompt, we ask ChatGPT for some variations on this strategy that we can try in order to make it perform better.
It suggests a number of things that we can try like changing our time frame, adding a confirmation layer like a chart pattern, filtering out low volatility periods, or using trail stops.
To keep things simple, just as we did earlier, we try the first option and change our timeframe to hourly.
As is seen in the image above, changing the time frame was the final step we needed to make this strategy profitable, reliable, and consistent.
Implementing The Strategy
Now that we have the strategy locked in, the next step is to put it into action. After running the strategy test, click the ‘Launch As Trading Bot’ button in the top toolbar.
A text box will appear that will allow you to define how you want to utilize your new bot. You can forward test and receive alerts to your phone and email by simply checking the SMS and Email boxes and then clicking ‘Create Bot’.
Take it a step further with webhooks, which allow you to link the bot directly to your broker via an order-routing service, like SignalStack. The bot can automatically place trades for you when the conditions are met.
With just a few simple prompts, ChatGPT led us to a profitable strategy that beats buy and hold on TSLA over the last four years by nearly 300%. We think that’s pretty impressive!
If you’d like to give this strategy a try, feel free to download it here.
You can also utilize the entry conditions in our Market Scanner to hunt for names meeting these criteria right now. Here’s a link to the scan!
We hope you found this helpful, and if you ever have any questions for us, feel free to reach out via the ‘Contact Us’ button in the bottom right-hand corner of your workspace.