All news

Finding a Trading Idea with ChatGPT and Claude: From Data to Backtesting

Finding Trading Ideas with ChatGPT and Claude: From Data to Backtesting

In this article, we decided to compare two popular services, ChatGPT and Claude.ai, and see how they perform in finding transaction inefficiencies in November 2024. I assessed their capabilities and ease of use to see which one is better suited for analyzing data and developing profitable trading strategies.

To make data collection easier, we used Hydra, the best free market data download tool.

I downloaded about 25MB of BTCUSDT minute data for 2024 and uploaded it as a CSV file.

Hydra also has its own analytics capabilities, but as we move forward we will see that all of this is powered by AI. You don't even have to write any code yourself.

However, the main part of my work was not collecting data, but analyzing it and finding ideas for strategy. Instead of manually searching for approaches, we decided to trust the AI ​​and study the strategies it suggests, what patterns and inefficiencies it can identify in the data, and how to optimize the parameters for testing. Using ChatGPT, we were able to not only conduct detailed analysis, but also test our strategies based on our data.

Once I had the microscopic data, I loaded it into Python (the AI ​​wrote the code itself, simply typing in what I wanted as text) and began pre-processing. This involved naming each column and combining dates and times into a single column to make time series analysis easier.

After pre-processing the data, we decided to ask the AI ​​about inefficiencies and patterns that could be useful for strategy development. ChatGPT came up with a few approaches: • No volatility clusters – Periods of high volatility may be suitable for momentum strategies. • No mean reversion bias – If price deviates from the mean, you may want to use a mean reversion strategy. • No momentum pattern – there has been continuous price movement over a period of time, which may be a sign of a trending strategy.

Based on the AI ​​suggestions, we selected two strategies to test. • No Mean Reversion: Go short when the price moves significantly above the mean, and go long when the price falls. Close the position when the price reverts to the mean. • No Momentum Strategy: Go in the direction of the trend during periods of increasing volatility. If the return is positive and above the threshold, go long, if the return is negative and below the threshold, go short.

Each strategy had basic entry and exit rules, as well as loss prevention rules to manage risk.

Using ChatGPT, we were also able to test both strategies to see how they would perform on historical data. The test results showed a return curve for the mean reversion strategy (see chart below).

The chart shows how the portfolio capitalization can change if the strategy is followed. You may see strategies that showed steady growth over a period of time, but then began to decline. This reinforces the importance of adjusting parameters and using risk management.

Along the way, I also used Claude Sonnet from Anthropic, which recently announced big data analytics capabilities (read more here). The idea seemed promising. All you have to do is upload a 25MB file and Claude can help you with the analysis.

However, I ran into a few problems. Unfortunately, this feature was raw and unfinished. My files wouldn't even load. I ended up shortening it, but because of the previous error, I quickly reached the request limit. All I got was an error when trying to draw a graph.

I enjoy working with Claude, but I hope that the project engineers will improve this feature and significantly expand the data loading window. This allows for more efficient analysis of large files and opens up new possibilities for working with large amounts of information.

ChatGPT not only allows us to analyze data, but also asks AI questions on how to formulate appropriate strategies. This approach not only yielded new insights, but also helped us quickly test hypotheses and generate recommendations that might have been missed using traditional approaches. I fully understand that this is just a tool and not a replacement for human analysis. However, approaches that use AI to help find insights and strategy parameters open up new possibilities for flexible and adaptive trading strategy development.

Original and my blog https://osaengine.ru/2024/11/02/%D0%B1%D1%8D%D0%BA%D1%82%D0%B5%D1%81%D1%82-%D1% 82%D0%BE%D1%80%D0%B3%D0%BE%D0%B2%D0%BE%D0%B9-%D1%81%D1%82%D1%80%D0%B0%D1%82 %D0%B5%D0%B3%D0%B8%D0%B8-ChatGPT-Claude.html


Source: sMart-lab.ru - Блоги Инвесторов, Форумы по акциям, КотировкиsMart-lab.ru - Блоги Инвесторов, Форумы по акциям, Котировки

Loading news...

Children's Days

Loading...
follow the news
Stay up to date with the latest news and updates! Subscribe to our browser updates and be the first to receive the latest notifications.
© АС РАЗВОРОТ.