ChatGPT trading guide: how can you use AI to make stable returns?

When it comes to trading, there’s one fundamental rule: establish a successful strategy and stick to it consistently without deviation.

In this ChatGPT trading guide, the first step – developing a winning strategy – is your responsibility. However, we will assist you with the second step, which involves consistently applying your strategy, regardless of the asset, time frame, or market conditions. Our aim is to help you gain confidence in your strategy, and you’ll determine how far you want to take it.

We’ll explore these concepts step by step in the simplest way possible, leveraging the latest innovation in Artificial Intelligence, ChatGPT.

Can you use ChatGPT for trading?

In the digital era, artificial intelligence has transformed numerous industries, including trading. While ChatGPT isn’t specifically designed to execute trades autonomously, it can be a valuable tool for traders in terms of analysis and guidance. Through its advanced language model, ChatGPT can provide programming code that users can incorporate into trading platforms.

In essence, ChatGPT enables you to obtain the code for a trading strategy, which you can then input into various prominent trading platforms to assess its historical performance. This empowers traders to harness the data analysis and predictive capabilities of the model.

However, it’s crucial to note that final decisions should always be made by humans after considering the inherent volatility and risks associated with trading.

What tools do I need for trading with ChatGPT?

What tools are required for ChatGPT-based trading, and are they free or do they come at a cost? Let’s find out:


Obviously, to engage in trading with ChatGPT, you need to have an account with this popular chatbot.

You must have an account in Chat GPT

It’s quite straightforward. To access version 3.5, which is free, all you need to do is link your Google account and log in. In this guide, we’ll be using ChatGPT 4, a paid and more powerful version, but it’s worth noting that ChatGPT 3.5 can also do the job.


TradingView is a social platform designed for traders and investors in financial assets such as stocks, futures, and foreign exchange markets. It offers advanced charts, a range of technical analysis tools, and an active community where users can share and discuss their perspectives and market strategies.

However, for this guide, we’ll highlight TradingView’s programming language, PineScript. PineScript allows users to create custom indicators and strategies. This feature empowers users to design and test their unique technical indicators and automated trading systems, offering flexibility and adaptability to meet individual trader needs. The best part? This function is entirely free.

What you should know before starting to trade with ChatGPT

The most crucial point to understand when trading with ChatGPT is that, despite its advanced capabilities, it cannot predict the future or make real-time market decisions. When ChatGPT provides the language for executing a trading strategy, it strictly adheres to the predefined parameters.

In practical terms, this means that if specific conditions are met, ChatGPT will provide you with the language to either open or close positions, without considering the broader context or the current market situation. For instance, if the strategy dictates buying when a technical indicator reaches a certain value, the alert in TradingView will trigger each time that condition is met, without regard for other external factors or the overall market situation.

Now, before you embark on your trading journey with ChatGPT, make sure you have three essential components in place:

  1. A clear strategy
    • Define a trading strategy that outlines your approach and the conditions for entering and exiting trades.
  2. A timeframe
    • Choose a specific timeframe that aligns with your strategy. Common options include hourly, daily, or weekly charts.
  3. An asset
    • Select the financial asset you want to trade. This could be stocks, currency pairs, or commodities.

For this example, the following parameters are set:

  • Strategy: Indicator “SuperTrend”
  • Timeframe: 4-hour candles
  • Asset: Bitcoin/EUR

And now, let’s start!

How to start trading with ChatGPT for beginners: step-by-step guide

This guide is tailored for beginners, so we’ll keep it straightforward. Follow these steps to begin trading:

  1. Set up the indicator in TradingView and copy the code in the Pine Editor
  2. Ask ChatGPT to generate a trading strategy
  3. Enter the new code in Pine Editor
  4. Risk management
  5. Set alerts

Step 1: Set up the indicator in TradingView and copy the code in the Pine Editor

First, open TradingView and select your Bitcoin chart with a 4-hour timeframe. Add the Supertrend indicator to your chart.

  1. Click the “View Source Code” icon (highlighted in a red box in the screenshot) on the left.
  2. In the Pine Editor of TradingView (marked with a green box in the screenshot), you’ll see the Pine language code for the Supertrend indicator. Copy this code exactly as it appears.
Step 1: Copy the code of your indicator.

Step 2: Ask ChatGPT to generate a trading strategy

The next step will be carried out via a series of interactions with ChatGPT.

Paste the copied Pine code into ChatGPT, and it will provide an explanation of the code in text format.

Ask ChatGPT to create a strategy in Pine Script language based on buying when the Supertrend indicator crosses above the BTC/EUR price and selling when it crosses below. Essentially, you’re obtaining a script in Pine language that defines a strategy using the Supertrend indicator to generate buy and sell signals based on the price and indicator crossing.

The strategy is based on buying (long) when the closing price crosses the Supertrend from below to above, and selling (short) when the closing price crosses the Supertrend from above to below.

Now you just have to copy and paste this code into the Pine Script editor of TradingView and test the strategy on the BTC/EUR pair to see how it performs on historical data.

Step 3: Enter the new code in the TradingView Pine Editor

  1. Return to TradingView and go to the Pine Editor, where you initially copied the code.
  2. Create a copy of the code to work on; this is a simple click on the prominent blue button.
  3. Delete the old code (green box).
  4. Paste the new code generated by ChatGPT (green box).
  5. Optionally, you can name the script; for instance, “Supertrend BTC/EUR Strategy” (blue box).
  6. Save your changes (orange box).
  7. Click “Apply to the chart” (purple box).
Step 3: We apply the strategy in TradingView

Step 4: Improve risk management

Following these steps, you’ll see a chart like the one below:

SuperTrend strategy applied to the BTC/EUR pair


  • Blue arrows indicate opening positions (buy).
  • Red arrows indicate closing positions (sell).
  • Purple arrows correspond to short positions and align with the red arrows.

In this case, you’ll notice:

  • A gain of 40.48%.
  • A maximum loss of 7.16%.

However, please be aware that these numbers don’t consider trading expenses like commissions. To account for this, let’s implement some risk management:

Go to settings (red box in the screenshot) and access the “Properties” tab.

Optimise the risk management settings. Keep in mind that these values can be subjective and you can adjust them to suit your preferences.

Improve Risk Management

These are the optimised fields:

  • Initial capital: EUR 5,000
  • Reference currency: Euros
  • Order size: 5% of the assets
  • Commission: EUR 1/order
  • Recalculate

And now, the real return is slightly lower due to the commissions.

Step 5: Set alerts

The final step is to set up alerts for each trading operation as soon as the strategy signals them. Follow these steps:

  1. Go to the clock icon at the top right of TradingView and open the alert configuration pop-up.
  2. Configure the alert as follows:
    • Condition: Select the script you saved, which in this case is “Supertrend BTC/EUR Strategy.”
    • Expiration: Set it to the maximum duration to avoid daily renewals.
    • Name of the alert: Create a name for your alert, such as “Alert Supertrend.”
  3. Save the alert settings. Now, whenever the Supertrend indicator crosses the price either upward or downward, you’ll receive a notification. It’s up to you to decide whether to buy or sell when the alert triggers. Note that after each alert, you’ll need to set up the next one.
Set trading alert

Is it possible to improve the strategy?

Certainly. As we can see, the strategy over the entire period—slightly over two and a half years—has not been exceptionally profitable, yielding only a 36% return. However, it’s worth noting that during the same period, Bitcoin experienced roughly a 10% loss.

One factor that may have hindered maximising profits in this period is the high number of trades the strategy executed when the price remained relatively flat with minor fluctuations. This led to increased losses due to trading commissions.

In essence, the Supertrend strategy performs well during trending market movements but performs poorly when prices are relatively stable.

To address this, we’ll combine the Supertrend strategy with the volume indicator, focusing on the Supertrend indicator only when there is a surge in the BTC/EUR trading volume. The goal is to enhance the strategy with the help of ChatGPT.

Here’s how to proceed:

  1. Copy the initial source code of the Supertrend indicator from Step 1, which contains the clean Supertrend indicator code for BTC/EUR.
  2. Paste this code into ChatGPT, as shown in step 2. ChatGPT will provide an explanation of the code, as we saw earlier.
  3. To reduce the number of operations, we’ll fine-tune our strategy by providing the following instructions to ChatGPT: “Could you use the code I just provided to generate a Pine Script-based strategy that buys when the Supertrend indicator crosses from below to above the BTC/EUR price and sells when it crosses from above to below? However, consider only those operations with a trading volume 30% above the average volume traded for the same period.”
  4. Copy the resulting Pine Script code returned by ChatGPT, similar to what we did in step 3.

By implementing this refined strategy, you’ll increase your profitability by 50% over the entire period. The key change here is that instead of executing 126 trades (long or short) with associated commissions, you’ll have closed only 58 trades with higher volumes. These higher volume operations could indicate the beginning of a trend.

Remember that, as mentioned in step 4, you have the flexibility to set up a risk management strategy according to your preferences.

Is ChatGPT trading the same as automated trading?

No, at least not as explained in this article. Here, we’ve detailed how to test a trading strategy using historical data, identify entry and exit points, and set up alerts for potential future trades. However, the ultimate decision to buy or sell based on the strategy’s indications rests entirely with you.

Automated trading with ChatGPT is a more advanced concept that goes beyond what we’ve shown here. To truly automate your trades with ChatGPT, you would need to follow these steps:

  1. Develop a trading bot, possibly using a simpler programming language like Python.
  2. Incorporate the trading strategy into this bot, potentially with assistance from ChatGPT.
  3. Connect the bot to your broker or exchange using an API KEY, enabling automated trades according to preset conditions.
  4. Get the bot up and running.

Only by following these steps can you truly enter the world of automated trading with ChatGPT.

Disclaimer: what is the essence of this article?

Uncovering the secrets of trading isn’t just about finding the “best strategy”; it’s about understanding the decision-making process behind each trade.

The primary takeaway here isn’t whether the strategy we’ve highlighted outperforms another. Instead, it’s about the journey we’ve shared, step by step, to harness the power of tools like ChatGPT and TradingView.

The goal was to reveal how to conduct trading tests, assess potential profitability, and do it all swiftly and affordably.

For further trading strategies and insights, there is a wealth of resources available online, including books, videos, and expert advice. Now, it’s your turn to explore and experiment, building on the foundation provided in this article.

If you want to start your journey, make sure you check this trading guide, learn about technical analysis, and find out how TradingView works in this TradingView review. Alternatively, you may want to check your options by visiting the best trading platforms and the best brokers for intraday trading.

ChatGPT trading: is it a good idea?

The essence of good trading is, in fact, quite mundane, centred around consistently applying one or more winning strategies.

So, is ChatGPT the magic tool that can automate our trading once we provide the strategy?

Well, if you’re thinking of programming a strategy into ChatGPT and blindly following its every trading signal, the answer is a clear no. Successful trading demands a combination of education, backtesting, market understanding, and experience.

However, the situation isn’t entirely black and white. If you view the information provided by ChatGPT as historical backtesting of a strategy, then we’re dealing with something different. In this context, ChatGPT can be a valuable tool. For instance, you can thoroughly analyse how your strategy would have performed in various past scenarios. This perspective can offer valuable insights and help refine your future trading decisions.

So, rather than seeing ChatGPT as your trading autopilot, think of it as an experienced co-pilot. It can provide data, analysis, and perspectives, but ultimately, you remain the captain of the ship, at least until you’ve thoroughly tested your strategy in different scenarios and know how to adapt it to each situation.

Pros and cons of trading with ChatGPT

All in all, these are the advantages and disadvantages of trading with ChatGPT:


✅ Access to advanced data analysis

✅ Streamlines the process of historical backtesting

✅ Allows testing any strategy on any type of asset (stocks, indices, forex, commodities, cryptocurrencies)

Facilitates access to programming languages, which otherwise would require an expert or hours of training

✅ Flexibility in adapting and understanding strategies


❌ Risk of neglecting necessary trading and finance education

❌ Potential disconnection from real-time market and financial dynamics

❌ Risk of excessive reliance on predefined parameters

❌ It is not suitable for real-time decisions

Other trading guides

Here are some other resources to help you out in your trading journey:


In brief, the trading landscape is continually evolving, and the integration of AI-based tools like ChatGPT is evidence of this evolution. Nevertheless, engaging in trading with ChatGPT is not a magical solution that guarantees profits. Instead, it provides a fresh perspective that has made analysis, strategy testing, and programming more accessible. These were areas that once demanded years of dedicated study.


What are the advantages of using ChatGPT in trading?

ChatGPT offers valuable benefits such as rapid backtesting of strategies, access to advanced data analysis, and simplified programming for trading strategies. It democratises access to these tools, making them more accessible to traders who may not have extensive coding or financial analysis experience.

Is ChatGPT suitable for real-time decision-making during fast-moving markets?

No, ChatGPT is not ideal for real-time decision-making in fast-paced markets. Its analysis and strategy generation occurs within a conversational framework and may not keep up with rapid market fluctuations. Traders should use ChatGPT for in-depth analysis and strategy development, not for immediate execution of trades.

Can ChatGPT predict future market movements?

No, ChatGPT cannot predict future market movements. It relies on historical data and user-provided strategies to make informed decisions. Trading involves uncertainty, and ChatGPT should be viewed as a tool to assist in analysis and strategy development, rather than a crystal ball for predicting market outcomes.

Related Articles