I Tested a Bitcoin Strategy Using AI Without Writing a Single Line of Code

CodeTrading www.youtube.com

Kurze Zusammenfassung

In diesem Video wird eine einfache, aber effektive Daytrading-Strategie für Bitcoin/USD vorgestellt, die vollständig ohne Programmierung auf der CoinQuant-Plattform erstellt und getestet wird. Die Strategie basiert auf dem Abprallen von Candlesticks von den unteren Bollinger-Bändern. Es wird gezeigt, wie man die Strategie in natürlicher Sprache beschreibt, die Parameter anpasst und Backtests mit historischen Marktdaten durchführt.

  • Erstellung und Backtesting einer Trading-Strategie ohne Programmierung mit CoinQuant.
  • Nutzung von Bollinger-Bändern zur Identifizierung von Kaufgelegenheiten.
  • Wichtigkeit von Risikomanagement und Backtesting über verschiedene Marktbedingungen hinweg.

Einführung in die Bollinger Band Bounce Strategie

Das Video beginnt mit einer Einführung in die Erstellung und das Testen einer einfachen, aber leistungsstarken Daytrading-Strategie für Bitcoin/USD. Anstatt Python-Code zu schreiben, wird die CoinQuant-Plattform verwendet, die es ermöglicht, Strategien in natürlicher Sprache zu beschreiben und direkt mit realen Marktdaten zu testen. Die Strategie basiert auf Tageskerzen der letzten zwei Jahre und zielt darauf ab, Kerzen zu identifizieren, die von der unteren Bollinger-Band-Kurve abprallen. Long-Positionen werden mit 20 % des Eigenkapitals eröffnet und für fünf Kerzen gehalten, wobei jeweils nur ein Trade geöffnet ist.

Strategie-Definition in CoinQuant

Der Sprecher demonstriert, wie man die Strategie in CoinQuant definiert, indem er die Regeln in natürlicher Sprache in ein Chatfenster eingibt. Zum Beispiel: "Wenn die Kerze unterhalb des unteren Bollinger-Bandes öffnet und oberhalb des unteren Bollinger-Bandes schließt, öffne eine Long-Position mit 20 % des Eigenkapitals, aber nur, wenn keine offene Position vorhanden ist." Das Sprachmodell analysiert die Strategie und wandelt sie in ausführbare Regeln um. Dieser Prozess dauert nur wenige Minuten, im Vergleich zu Stunden, die für das manuelle Schreiben von Code erforderlich wären.

Analyse und Anpassung der Strategie

Nach der Generierung der Strategie zeigt CoinQuant ein Schema der Strategie an, einschließlich der Ein- und Ausstiegsbedingungen. Der Sprecher erklärt, wie man die Parameter der Strategie anpassen kann, z. B. die Datenquelle (Binance, Coinbase, Kraken usw.) und den Zeitrahmen. Er ändert auch die Standardabweichung des unteren Bollinger-Bandes, um zu demonstrieren, wie man mehrere Indikatoren innerhalb derselben Strategie kombinieren kann. Das Sprachmodell gibt auch Feedback und weist darauf hin, dass noch keine Ausstiegsbedingungen definiert wurden.

Backtesting und Risikomanagement

Der Sprecher erläutert die Trade-Management-Funktionen von CoinQuant, einschließlich der maximalen Halteperiode und der Risikomanagement-Optionen wie das Stoppen des Handels nach aufeinanderfolgenden Verlusten. Er führt einen Backtest der Strategie durch und zeigt die generierte Equity-Kurve und einen vollständigen Bericht mit Kennzahlen wie Sharpe Ratio, Volatilität und Gewinnrate. Der Bericht enthält auch Details zu den ausgeführten Trades, einschließlich Gebühren und Drawdowns.

Detaillierte Analyse des Trade Logs

Der Sprecher greift auf das Trade Log zu, um alle Details der ausgeführten Trades einzusehen, einschließlich Orderdatum, Zeit, Typ, Einstiegspreis, Größe, Gebühren und Netto-Gewinn/Verlust. Er betont, dass die Plattform hochwertige Marktdaten von Keiko verwendet und sowohl Kerzendaten als auch Tick-Level-Präzision für die Ausführung verarbeitet, was zu realistischeren Backtests führt.

Optimierung und Anpassung der Strategie

Der Sprecher demonstriert, wie man die Strategie erneut bearbeitet und die Parameter ändert, um sie zu optimieren. Er ändert die Standardabweichung der Bollinger-Bänder und führt einen weiteren Backtest durch, um die Ergebnisse zu vergleichen. Er erwähnt, dass CoinQuant über 30 Indikatoren unterstützt und regelmäßig neue hinzufügt, sodass komplexere Strategien erstellt werden können.

Risikohinweise und abschließende Gedanken

Abschließend gibt der Sprecher wichtige Risikohinweise, insbesondere für den Krypto-Handel. Er empfiehlt, mit kleinen Positionsgrößen zu beginnen, auf Nachrichtenereignisse und Volatilität zu achten, Risikolimits festzulegen und die Strategie über verschiedene Zeiträume und Marktbedingungen hinweg zu testen. Er betont, dass diese Regeln genauso wichtig sind wie die Strategie selbst. Er ermutigt die Zuschauer, ihre eigenen Strategien auf CoinQuant zu testen und ihre Ideen in den Kommentaren zu teilen.

Fasse jedes YouTube-Video in Sekunden zusammen

Hol dir Zusammenfassungen wie diese für jedes Video, in deiner Sprache, mit der kostenlosen Summ-App.

Laden im App Store
Jetzt bei Google Play

Transkript

Vollständiges Transkript von „I Tested a Bitcoin Strategy Using AI Without Writing a Single Line of Code“. Klicke auf einen Zeitstempel, um das Video an dieser Stelle zu öffnen. Du brauchst ein anderes Video? Nutze den YouTube-Transkript-Generator.

0:00 Hi, and welcome back to this channel. Today we're going to build and test a very simple but powerful daily trading strategy on Bitcoin US dollars. And instead of writing a Python code like we usually did in previous videos, we're doing everything inside CoinQuant. a platform with a no-code strategy builder that lets you describe your strategy in plain English and backtests it directly on real market data. We will be using daily candles over the last two years, for example, and the idea is straightforward. We look for candles that rebound from the lower Bollinger Band curve. We enter long with 20% of the equity and we hold the trade for, let's say, five candles with only one trade opened at a time. I personally consult for CoinQuant and use this tool myself,

0:46 so this video is not a financial advice, but I'll walk you through how I use the platform, what it does well, and where it can help you test your own ideas. Okay, now let's see how it works on the platform. So this is how the page looks like. As you can see, we have a set of menus on the left, and the nice part actually is that I can describe this strategy in plain English using this chat box right here. So for example, I can write if the candle opens below the lower Bollinger Band and closes above the lower Bollinger Band again.

1:33 In this case, on BTC-USDT, for example, daily time frame, you don't need to over-explain it unless you have a lot of details. A simple as this, and the language model is going to analyze your strategy and understand it. Then we're going to open a long position with 20% of the equity. That's our risk, but only if there is no open trade already. And that's it. I just described my strategy. This is what it takes, a couple of minutes, to backtest it, to generate it

2:19 and backtest it on historical data. If you want to write this in Python, it's going to be 15 to 20 minutes at least if you're using another language model, and if you want to write it manually, that's going to be an hour, I would say, to load the libraries, set your environment. If you've been into backtesting, wildcoding, you know how much effort it takes to install an environment to get things running and then to write the strategy in Python language or any other coding languages. So here it took me a minute, I would say. Think about the strategy, the rules. Just describe these in plain English and that's all it takes to start running your strategy. So I'm going to press generate this is going to take a couple of seconds so now i can see the language model and the whole pipeline

3:06 in the background actually creating the schema of the strategy it's going to analyze your strategy and you're going to see the schema here on the right so let's wait a few seconds okay now the language model just answered i've set up your bollinger band bounce strategy It will look to enter long when the price opens below, etc. So you have another description, like this is the feedback, the answer of the language model. It's worth reading it and checking that everything is as intended. But on the right side, this is where things get more interesting. Let's see the entry conditions. We have if Bitcoin USDT price opens

3:51 on the one-day time frame below the Bollinger Band 20, on the daily time frame and at the same time we have a close on the daily time frame above the Bollinger Band 20 on the daily time frame again. We're going to enter long 20% worth of the equity, Bitcoin USDT, as market order. Now why is this interesting? Because I can click here on any of the elements and just change the asset, for example. And also, which is very, very important, this is very tedious. I always get the question, where do you get your data from? You don't have to get any data from using CoinQuant. You can just click here. And these are the sources where CoinQuant is going to get your real trading

4:38 data, the real historical data. So we have Binance, we have Coinbase, Kraken, Maxi and OKEx. So as you can see, you can get the data. You don't have to worry about this. You don't have to pay for it. CoinQuant, took care of it in the background. So I will just go with Binance data for now for this test. I'm going to close it. I don't want to change anything. And also if you want to change the time frame, we can click on it and change the time frame. So this is how you can also think of multiple time frame strategies and combine them together using this schema. I'm going to cancel it here. Now, if you noticed, we've described this as the conditions for entry, the candle should open below the lower Bollinger Band and close above the lower

5:27 Bollinger Band. And here it's just saying Bollinger Band, but if I click on it, I can see that it selected the output, which is the lower Bollinger Band. So I can select the middle band, the upper band, or any other parts of the indicator I'm using. I can change also the period, maybe you want to change it to 25, or anything less than that. So I'm going to change, let's say just for fun, the standard deviation to 1.8, let's say, instead of 2. I'm going to apply the changes. So now what this strategy is doing, if the candle is opening below the lower Bollinger Band, but that's 1.8 standard deviation, and closing above the lower Bollinger Band, but that's 2 standard deviation.

6:18 And this is where you can start seeing that you're using multiple indicators even though you're using the same bollinger band. So if you want to use the same curve we're going to change this one as well to 1.8. I'm going to apply the changes and these are my entry conditions. Now I still don't see the exit conditions and actually the language model itself noticed it as well. I noticed there aren't any exit conditions yet, so your trades won't have a defined way to close, and so on and so on, because we don't have any take profit or stop loss. But we do have the trade management part, which is here on the right. Let me adjust this a bit. So we can see that we have the maximum holding period, which is this number in seconds. And if you remember, we defined that we

7:04 need to exit any long position by five days. This can be changed, this is in seconds, you can change the duration to hold the position like you wish. This is where you actually apply your trade management part. We have a maximum holding period, when threshold is reached, pause, then continue trading, or close all positions and stop trading, and so on. You can set any thresholds stopping the trading or consecutive losses, for example consecutive losses threshold and so on. So you have this risk management part to be filled. We're not going to use it now for this example for the sake of the simplicity of this video, but I'm going to let's say keep it as is for now. I'm going to cancel it and

7:53 run the backtest. So I'm pressing on the backtest. You can see that the backtest is running in the background. It takes less than a minute, and it's going to generate this equity curve. As you can see, it's going into the positive, but we don't have a big number of trades. But the important thing is that we have a full report of all the backtests. For example, we have the starting date, the end date, the trades executed, we have only nine trades. Remember, we're using the daily time frame, so this is completely normal. We have the long ratio, this is a long only strategy, so that's correct, we have 100% long positions, the sharp ratio, volatility, win rate 66% and so on. And we do have

8:39 all the details, so total in fees we paid $7.24, remember this is a backtested strategy with the fees, with the estimated cost of trading. We have the maximum drawdown 1.89%, which is not bad. and the profit factor 1.11 and so on. Now we do have access to the trade log. I'm going to press trade log and I can see all the trades that were executed in this strategy. We can see all the details. We have the order date, the time, the type. This is market orders for all the trades. Entry date, entry time, symbol, the price, the size and so on. So you can access all the

9:25 details, the drawdown, the fees actually, the fee type for example, and the fees here, so the amount of fees, and the net profit and loss. So as you can see it's actually complete for a backtest report. And again, normally setting all this up, conditions, exits, position, sizing and trade limits would require quite a bit of code in Python or another coding language. Here it's all done with plain English rules and a visual interface which makes it much easier to experiment. And I really can't stress enough on the fact that behind the scenes this is running on high quality market data sourced from Keiko. CoinQuant works with

10:11 candle data and tick level precision for execution. So it's not really candles that are only processed during the backtest. You also process tick level when needed, and this is all automated in the background for the executions. So all of this converges towards a more realistic backtesting. Here as well, for the list of trades, we can customize whatever we want to print or to show. And as you can see, it's very flexible. Actually, you have access to all the details. We can also go and edit the strategy again. I press on Edit Strategy. So let's say I want things to be different. I want to open below the

10:57 lower Bollinger Band, but this time it's going to be 2.2, a standard deviation. And Close actually This one is the open one, so that's going to be 2.2 standard deviation and close above the 1.9 standard deviation, let's say. I'm trying to optimize my strategy here. I run the backtest again, so clicking run backtest. The backtest is in progress and it takes less than a minute, 30 seconds or so, and now I have less trades. I can see the new results so it's not working better than the previous one. Now, CoinQuant already supports 30

11:43 plus indicators for now and they are adding more on a regular basis, so you're not limited to just Bollinger Bands, you can build much more advanced strategies as well. You can also combine different technical indicators together in your strategy schema, describing this in plain English right here on the left. So if you want to change anything in the schema, you can still add or remove stuff from your strategy using plain English. As you can see, we have a chat box here on the left. For example, let's change the holding period to two days instead of five. And the language model is going to change it for me, although I could have done it automatically here in the trade management part, but I'm just showing you how

12:32 this works with the language model part. Now, before anyone thinks about trading any strategy live, a few important risk points, especially with crypto. Start with small position sizes relative to your capital. Be aware of major news events as well and high volatility days. Always have risk limits. Even if this example uses a strict time exit in real trading, you might want to have a proper stop loss, for example. And test across different periods and market regimes, not just a single two-year window. Practice and get comfortable on a demo or paper account before going on live trading with real money and burning your account first. Now, these risk rules are just as important as the strategy itself. And

13:22 this is it. This is our daily Bollinger Band Bounce strategy on Bitcoin USD built and tested inside CoinQuant with completely no code workflow. We saw how we defined the idea in plain English, turned it into a clear entry and exit rules, including the five candle time exit with no overlapping trades. Now, we backtested it on two years of high quality data and reviewed the trade log and checked the key performance metrics. If there's a strategy you've always wanted to test, maybe a moving average crossover, a breakout setup, or a more advanced mean reversion idea, leave it in the comments. I might build it in the future or in a future video. And if you feel this is interesting and you want to try this yourself, you can

14:07 jump into CoinQuant, type your rules in plain English, and turn your trading ideas into data-driven backtests. Thanks for watching. Don't forget to like, subscribe, and I'll see you in the next one.

Share

Weitere Video-Zusammenfassungen