Skip to Main Content

|

Create A Trading Strategy With ChatGPT

This is a banner that promotes the tax time sale in which you can save up to 73% on TrendSpider, this weekend only.

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.

ChatGPT Creates A Trading Strategy

Prompt One

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.

This is an image of the first prompt from ChatGPT

Prompt Two

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.

This is an image of the second prompt from ChatGPT

Prompt Three

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.

This is an image of the third prompt from ChatGPT

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. 

This is an image of the entry criteria ChatGPT suggested.

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.

This is an image of the exit criteria ChatGPT suggested.

Prompt Four

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.

This is an image of the fourth prompt from ChatGPT.

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.

Prompt Five

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.

This is an image of the fifth prompt from ChatGPT.
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.

This is an image of the Price Behavior Explorer min/max change for winners and losers chart.
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.

This is an image of the revised exit criteria suggested by ChatGPT.
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.

This is an image of the performance of the strategy suggested by ChatGPT.

Prompt Six

In our final prompt, we ask ChatGPT for some variations on this strategy that we can try in order to make it perform better. 

This is an image of the sixth prompt from ChatGPT.

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. 

This is an image of the results of the revised strategy.

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.

This is an image of the launch as trading bot button.
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’. 

This is an image of the trading bot scripting box.
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.

This is an image of the input parameters for webhooks.

Conclusion

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.