avatarHenrique Centieiro & Bee Lee

Summary

ChatGPT can be used to create profitable trading bots with zero coding knowledge, and TradingView can be used to backtest these bots.

Abstract

ChatGPT, an AI model, can help users create profitable trading bots without any coding knowledge. Users can ask ChatGPT to create a trading bot based on specific indicators or request a bot that returns at least 10% with the lowest risk possible. The bot can then be backtested on TradingView, a free charting tool that allows users to access charts of various assets and build indicators, trading strategies, and trade. It is essential to do extensive backtesting before using a new trading bot to trade real money.

Opinions

  • ChatGPT can help users create profitable trading bots with zero coding knowledge.
  • ChatGPT can provide users with the script for a trading strategy based on specific indicators.
  • TradingView is a free charting tool that can be used to backtest trading bots.
  • It is crucial to do extensive backtesting before using a new trading bot to trade real money.
  • The author of the article created a trading bot that beats 99% of Wall Street investors and more than doubled the initial investment in 3 months.
  • The author advises users to be cautious when using trading bots and to test them thoroughly before using them to trade real money.
  • The author suggests that users should only use a small percentage of their savings (say 1%) and avoid using leverage when trading with bots.
You can now create your own tailor-made bot to do profitable trading for you, in a matter of minutes. (AI image created on MidJourney V6 by the author)

ChatGPT

Use This ChatGPT Trading Bot to Beat 99% of Wall Street Investors!

Step-by-Step of How to Create a Profitable Trading Bot & How to Backtest it with Zero Coding Knowledge Needed.

Even a 16-year-old can now create a profitable trading bot with zero coding knowledge needed.

You no longer need to be a developer or a quant to do this. ChatGPT can help you turn your trading bot idea into a fully automated money machine.

And don’t worry if you don’t have a bot idea yet: ChatGPT can give you many ideas to create a profitable trading bot.

I created a trading bot that beats 99% of Wall Street investors.

This bot more than DOUBLED the initial investment in 3 months and generated 75% profitable trades.

I know it all sounds too good to be true, so read on to see for yourself!

📌Pre-requisites: You Need ChatGPT to Create and TradingView to Backtest

What is ChatGPT?

ChatGPT is an AI model that can help you with content creation and tons of other use cases, as well as coding your trading bot. However, it won’t backtest your strategy or interpret charts. But don’t worry; I’ll guide you through the process of creating and testing your algorithmic trading bot on TradingView.

What is TradingView?

TradingView is a free charting tool where you can have access to charts of anything from crypto, stocks, commodities and FX. You can also use it for technical analysis, building indicators, trading strategies, and trade.

📌 Create Your Profitable Trading Bot with ChatGPT

There are 2 ways you can ask ChatGPT to create an automated tradingbot.

1. If you don’t know what kind of bot you want, simply ask ChatGPT:

Create a Pine 5 strategy that returns at least 10% with the lowest risk possible.

ChatGPT will then help you decide what indicators to use for the strategy and give you the script for the strategy.

2. If you already know what kind of trading strategy you want, you can ask GPT exactly for it.

I asked GPT-4 to create this trading bot for Bitcoin, which gave me excellent results. Here’s the prompt:

Create a Pine 5 strategy based on Bollinger Bands Breakout.
Place a buy order when the price goes below the lower band and sell when the price goes above the upper band. 
Put the lengths of the Bollinger Bands as a variable.
Allow pyramiding = 100.

⚠️ Here are a few important tips:

  • “Pine 5” is the TradingView programming language. Include it in the prompt.
  • Pyramiding = 100 allows the bot to open up to 100 consecutive orders.
  • If you want to edit a value easily, ask to add it as a variable like I did for the Bollinger Band length.
  • Make sure your prompts are very clear.

Let’s see ChatGPT (in this case, the GPT-4 version) in action:

Screenshot by the author.

Amazing! You have just created a brand new trading bot strategy.

Let’s test it to see if it works, shall we?

📌 Backtest Your Automated Trading Bot with TradingView

TradingView allows you to backtest any trading bot that you create. Backtesting is a simulation that uses past data to see how well the bot would perform.

You should do A LOT of backtesting before considering using a new trading bot to trade real money.

Let’s test your new bot!

How to test a strategy on TradingView. Source: TradingView, compiled by the author.
  1. Select what you want to trade and the time frame. I’m trading Bitcoin with 15-minute candles. You can try other assets like stocks or commodities.
  2. Click Pine Editor at the bottom and copy/paste your trading bot from ChatGPT.
  3. Click add to the chart.
  4. Pray that it works.
  5. If it was added to the chart, congratulations!
  6. If you have an error message, copy/paste it to ChatGPT and try again.
  7. Adjust the properties (including initial capital and order size) in the ⚙️ on Strategy Tester.

Look at the “Strategy Tester” results. What do you see? Is it profitable?

Share your trading strategy in the comments section! 📩

📌 Let’s Look at The Results of My Amazing Trading Strategy

Before I throw fireworks, I must admit this is backtesting and not involving real money… but still — Let me pat myself on the back!

As you can see in the chart below, the strategy created by ChatGPT seems to buy low and sell high in a fairly consistent manner.

Chart with the Bollinger Bands bot created by ChatGPT. Pretty cool to see it consistently buying low and selling high. The returns were very positive. Source: TradingView.

We all want to automate a bot that buys low and sells high so that you can make money while you sleep, right? Here you go!

Just by looking at the chart, you have to agree that this is a pretty good trading strategy, which was 100% coded by ChatGPT. You’ve got to love AI!

What’s the return of the strategy? Look at it with your own eyes:

Trading strategy performance for our automated bot 100% developed by GPT.

In 3 months of trading Bitcoin, the strategy generated:

  • Net Profit: 130% profit, i.e. our $1000 initial investment turned into $2353 in 3 months
  • Total trades: 305
  • Percent profitable: 75% of the trades are profitable (really good ratio)
  • Profit factor: 2.28. This means that for every $1 lost, the strategy made $2.28
  • It outperformed just buying and holding Bitcoin (blue line)

This beats 99.9% of the Wall Street professional investors — Simply outstanding!

📌 Before You Go ALL IN with a Trading Bot…

I made trading bots at 20 years old (that’s like 18 years ago… Phew, I’m getting old).

One of those trading bots lost me all my money — After six months of consistent profit, a market move totally wiped out my leverage account.

Lesson learned: Bots work until they don’t.

Here’s what happened:

I spent hundreds of hours creating the bot and backtesting it, and then I tested it with a virtual money account and finally started trading with real money.

It was amazing: for over 6 months, it gave me over 30%/month. At this speed, I would become a millionaire very fast. I started to dream high.

Then, one day, the market made a crazy move, and I blew up my leverage account, losing all my money.

It was a BIG lesson.

⚠️ There are way too many articles and videos on the internet saying that you can make a ton of money with these AI-generated trading bots. That’s not true:

  • LLMs like ChatGPT understand languages well, but it doesn’t understand well charts, mathematics and market dynamics;
  • Previous market conditions influence backtest results, but the same conditions might not repeat again;
  • Don’t use leverage (or only use very little leverage);
  • Use only a small percentage of your savings (say 1%);
  • Most importantly, test, test, test all the possible market scenarios and use a “Paper account” before trying anything with real money!

📌 Conclusion

ChatGPT might also be able to create bots for Metatrader, TradeStation and other platforms. I might explore those other platforms in another article, but I feel that TradingView is the most popular, and it connects with most of the brokers in the market.

One last thing — If you manage to create a trading bot that gives even better results than mine, I might invest in it!

Did you manage to create a trading bot using ChatGPT?

Share it with me! I’d love to see the results and perhaps help you tweak it! ✨

If you found value in this article, throw us some Medium love!

🥰 What you can do to support us: Clap up to 50, leave a message to share your thoughts & be sure to follow. 💌

🌞 Stay in touch with us:

Visit us at DataDrivenInvestor.com

Subscribe to DDIntel here.

Have a unique story to share? Submit to DDIntel here.

Join our creator ecosystem here.

DDIntel captures the more notable pieces from our main site and our popular DDI Medium publication. Check us out for more insightful work from our community.

DDI Official Telegram Channel: https://t.me/+tafUp6ecEys4YjQ1

Follow us on LinkedIn, Twitter, YouTube, and Facebook.

ChatGPT
Artificial Intelligence
Investing
Trading
Trading Bot
Recommended from ReadMedium