I no longer program, I build. ChatGPT + Bing Chat+ Trading Platform

SmartLever
4 min readFeb 20, 2023

”It appears to me virtually certain that many big changes fueled by artificial intelligence working with human intelligence will lead to shocking advances in many areas over the next 10 years (in fact over the next three years).” Ray Dalio

Welcome to the exponential era.

It seems like every time we turn around, there’s a new gadget or app that’s changing the way we live our lives. But did you know that this is just the beginning of a much bigger trend that’s happening all around us? That’s what Ray Kurzweil’s concept of the Exponential Cycle is all about.

It might sound a bit scary at first, but trust me, it’s actually pretty exciting. The Exponential Cycle is all about how technological progress is not linear but exponential. In other words, the more advanced technology becomes, the faster it progresses. And the faster it progresses, the more advanced it becomes. It’s a never-ending cycle of growth and development that’s only getting faster and faster.

In our previous post, I started using ChatGPT to create a basic RSI (Relative Strength Index) trading strategy by employing prompt engineering and the SmartBot platform for basktesting. Since then, Bing Chat has been introduced, and additional experiments have been conducted. Thanks to these new tools, I’ve been able to improve my trading cycle more efficiently. This post explores how Bing Chat can help us create a stronger trading strategy that ChatGPT can code.

The query, Bing Chat

Unlike ChatGPT, BingChat has an internet connection, allowing users to perform information searches and get more accurate results. With this “skill”, I asked BingChat for an explanation of a trend trading strategy and used it as an input for the Query in the Prompt at ChatGPT.

OK OK, there is no guarantee 😇, I know that¡¡¡. Bing Chat provided an idea for the next step query: “I want a trend following strategy using averages and pattern recognition.”

The coder: ChatGPT

After making various attempts to improve the prompts, it seems the chat works better with a short prompt and an example. This strategy offered a lot of advantages, including the ability to provide more thorough information, improve the chat’s comprehension of the desired outcome, and even lower the frequency of bugs. COOL 😎. Here is the prompt:

You are a specialized Python coding assistant for quantitative trading with trading systems and strategies.
create a new class that inherits from the Abstract_Strategy class, follow this three points:
1) Use the example as a guide.
2) Create all the respond within one code block.
3) Make comments to explain the code.
example: """https://github.com/SmartLever/SmartBots/blob/main/src/domain/services/strategies/rsi_chatgpt.py"""

Query: """I want a trend following strategy using averages and pattern recognition"""
Respond: """ """

Note: In the example, please copy and paste the code from the provided link. The code was not included here for simplicity.

The second round on ChatGPT

Another interesting thing, ChatGPT does a better job in the second round. So I asked, “How can you improve the code?”

The second iteration improved memory efficiency and resolved several bugs.

The tutor: Learning the Logic

It could have been everything, but I was intrigued by the pattern recognition code created by ChatGPT, so I asked for an explanation.

def check_pattern(self):
if len(self.buffer) >= self.pattern_length:
pattern = self.buffer[-self.pattern_length:]
trend = pattern[-1] > pattern[0]
for i in range(1, len(pattern)):
if (trend and pattern[i] < pattern[i - 1]) or (not trend and pattern[i] > pattern[i - 1]):
return False
if (trend and pattern[-1] > pattern[-2]) or (not trend and pattern[-1] < pattern[-2]):
return True
return False

Here is the explanation with examples 😎.

Putting it all together

  • Here the strategy.
  • I went bug hunting and surprisingly didn’t find any this time! If you’d like to try it yourself, here’s a tutorial to get started.
  • The results: Not bad at all:
  • Given that Bitcoin’s value dropped a lot in 2022, it might be a good idea to look into using a trend-following strategy.

Main Takeaways

  • Prompt engineering is evolving rapidly, so great experimentation is essential.
  • Using ChatGPT to program is a brutal performance boost. I no longer program, I build.
  • Interaction with the initial response from the chat is essential for less debbuging.
  • Use ChatGPT to learn. It is an incredible tutoring tool for understanding coding.

Here is an advanced version of this post.

Subscribe to all our news here.

The train is in the station and you can’t miss it, so join us on this journey. We are an open community and if you want to collaborate with us, please send us an email: andres@smartlever.tech

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

SmartLever
SmartLever

Written by SmartLever

Leverage your options with technology.

Responses (10)

Write a response

Excuse me, you need ChatGPT to tell you to use NumPy mean instead of for() loop?! It’s like asking Picasso to show you how to use Crayons. What am I missing?
With respect to trading side of the story, where is statistical advantage demonstrated…

--

This is such a value article..I haven't used the bing chat yet but after this article I'm definitely going to test it and see how I can implement into my process along with GPT 4. I started a series called "Time Travelling Talks" where through my…

--

Reading a URL content by ChatGPT still doesn't work. It spits out random content. So how do you get it work?

--