Can ChatGPT really create a profitable trading strategy?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey I hope you're doing well you must have heard of chat DPT by now you know that AI chatbot from open AI this thing is so knowledgeable and Powerful the possibilities are crazy honestly but today we'll focus on trading who would have known and see how easy it is to get it to create a sound training strategy but more than that I also want to ask him to produce a code so I can backtest the strategy live on trading view don't forget to click that like button it helps a lot if you like my content and would like to support me in creating some more you can make a donation on my buy me a coffee page.com enjoy [Music] here I am on chat.openai.com and we shall start a new chat okay nice let's start simple can you create a simple trading strategy that uses the crossover of two simple moving averages I know I'm saying hello please to an AI maybe that doesn't make any sense but you know what being polite always brings the best out of things okay so what did it tell us that we have to calculate two different smas one short one or 50 day and one longer term one of 200 days and basically is saying that when the short term one crosses above the longer term one that would be our Buy Signal because that signals a bullish Trend and the opposite will be our sell signal because this implies that this trend is going to be bearish it also tells us about the management of our risk tolerance it also mentions that we could add other indicators we'll see about that later and it finishes by mentioning the possibility of using a stop loss to limit our potential losses lastly it adds that this trading strategy will be effective in trending markets and not in sideways or choppy markets this makes sense we're using only two Trend indicators to moving averages so that's what we could expect okay cool this is basically Training 101 I do see though that this will not fit my target I want to trade some cryptos and typically such large values of the averaging of the moving averages don't fit the high volatility of cryptos you generally should aim for smaller ones so I think I should just tell him that can you adapt it to the high volatility of crypto okay nice the first recommendation indeed is to shorten the moving averages and into for example a 10 and 30 days I like that the second suggestion is again to couple the smas with different types of indicators so not trending typically the RSI is a momentum indicator and the Bollinger Bands are volatility indicators so I think we will look into this after let's ask him to put that into a code and see what comes out of it okay nice I see the code running here I can already see that they missed a header so it's not defining this as a strategy that we're testing however it is indeed defining our two smas and it didn't add any of the other indicators which is good for now we'll see later what we can do okay the header so let's actually just ask him right now before copy pasting into trading View and I think we should also ask him at the same time in which version of pine script this code is intended to be okay great so this is in version four and he did put the header strategy we do see that we still have a SMA the bias indeed a crossover and on the other hand the cell is the cross under so let's actually copy this code come here and you can see that I want to work with the ethereum usdt pair and I'm sticking to the one day chart for this test so let's simply open our editor and paste the code I'm going to save it and we can see that there's an error that popped up okay well let's simply copy that and see if GPT can sort it out okay so I don't know why he did the error at the first time but it seems like he knows exactly what's going on and colors might be defined like this okay so let me copy now come here and select all the code and replace it with the new one save and great we see that everything worked well we can now add our strategy to the chart and actually nothing happens so what's going on let's go back to the code and yes indeed the plots have been made correctly but nowhere do we see the entering and the exiting in the strategy so let's fix that you have forgotten to add the entries and exits okay up to now nothing changes let's see if it adds the things properly after great and it's indeed adding the entry and the close of a buy so let's just copy this and go back to here and just update it and Save okay now we can see that we have the entering and the closing Let Me Maybe zoom in so we see better I think it's a bit confusing to have the triangles and the arrows so maybe we can just delete the plotting of those shapes just for clarity okay nice shall we have a look at what this strategy gives us oh but wait a second if I look here I see that the average trades make 23 percent and there were 31 trades but I only get two percent total profits so something is bound to be wrong let's go maybe see properties okay the range is until 2017 great one day all good okay but I do see here the problem the order size is one contracts but this is not what we want to do typically we just want to work in the percentage of the total portfolio and because this as I said is really a trending strategy I would just use 100 of my portfolio so let's change that and see what happens and to do that we need to add some information in this strategy header so let me actually do it by copy pasting from a code I did before so I'm going to save open let's go here I'm gonna copy this sentence and open back our previous and edit here and let me just tell you what we see here I'm Gonna Save so typically we're saying that the quantity type is going to be the percentage of inequity and we're saying that we want to use each time a hundred percent but also very important I want this back test to take into consideration training fees and basically we're saying that the training fees are also in a percentage and the value that we're giving is of 0.01 percent right so let's go to our strategy tester and you can see that now indeed the order size is changed to 100 of equity and let's see what we get and yes indeed Everything Has Changed now the strategy is quite profitable almost four thousand percent profits the win rate is slightly below 30 percent and however the maximum drawdown is quite High about 46 so maybe we can ask chat GPT to improve that and follow his advice of coupling the smas of this strategy with another indicator maybe you remember that they suggested before to couple with the RSI or Bollinger Bands in fact I actually recently released a series of videos where I code a crypto training board from scratch it was actually quite a fun project very informative and interesting I'll link it up there it might interest you back to today's task I think because of that I'll go for the other indicator that Chad GPT suggested which is the Bollinger band so let's go and ask him to do that for us I think for the training strategy that we're dealing with now the simplest usage of the boli gem bands would be to have the Buy Signal being triggered when the prices breaks through the upper Bollinger ban and we make sure as a confirmation that our conditions with the symbol moving average are still met let's ask chat GPT to do that for us can you add the condition that the buy is triggered when the price crosses above the upper Bollinger band and the short-term SMA is above the long-term SMA so we can see that it has added the parameters of the Bollinger Bands so the period the length and the standard deviation they actually only computed the upper Bollinger band so maybe I should have made myself more clear just for the purpose of the plot we actually would like to see the hole so let me ask for that okay nice it added the computation of the lower and also the plot so let me simply copy and come here and replaced everything and I think we need to keep our strategy header properly maybe I should tell him that we're using this new thing so I'm going to save and see what happens okay so you have two errors I was expecting something like this by seeing the way it computed the bolega band typically Computing it like this through a function is possible in the version 5 of pine script so let me just mention that to him and see what he says and ask him to compute the Bollinger Bands from scratch that's probably the easiest way to do it oh I also want to tell him that I've changed the header so it knows so let me prepare okay let's wait for him to finish we can see that now it does the computation by itself okay let me just mention that as well so I can simply copy paste the whole code it'll be simpler okay so I finished the code so let me simply come copy come back here select all and paste and Ctrl s and great it works but we're back to having a very tiny amount of profits so what happened there let's have a look at the training strategy it's probably something to do with our conditions and indeed I didn't really pay enough attention to that when I was writing down the code but he kind of did the reverse of what I asked so I want the crossover to be triggered when the close goes above this upper Bollinger band but I want that to still verify the fact that the short-term SMA is above the long-term SMA so let me simply copy this and paste it here and then do that this becomes our trigger we still want the confirmation with the SMA but this just becomes a simple condition we want to verify that this can be triggered if and only if the short-term SMA is above the long term one so let's now save and see okay we get more profits but maybe we can play a bit more to kind of match and tune the bonnington bands to fit well the simple moving averages so I think we should analyze a bit more what we see to make the right decisions let's maybe zoom out and have a look I do have a feeling that they're a bit too wide this ramping up of the market that we had here quite a big bull Trend was not taking advantage of in our training strategy and that's because the bollagen bands here is too high so let's simply reduce our standard deviation of the Bollinger band and save and see what happens so we have lost in terms of profits I think the rest is about the same I think we should also see the other parameter of the Bollinger Bands so the moving average length so let's maybe reduce it by five and see okay so this seems to have decreased The Profit so maybe that was not the right direction so let's do plus five oh okay I think we're going in the right direction the profit increased quite a lot the drawdown however increased a bit so let's see if we carry on what do we get so the profits increase quite a lot and I think the rest is more or less the same so let's simply carry on okay interesting that's very nice the profits increased the win rate increased quite a lot above 70 percent and the drawdown dropped quite a lot below 24 so okay let's crank up that number a bit more to see if we gain anything and no on the contrary now the profits divided by two and we have the maximum draw done that increased again so I think we found a nice sweet spot at 35. okay this was fun I will put this card on our GitHub it's all for free so don't hesitate and if you have any questions or comments please write them down below or join our community Discord details in the description but remember that none of this is financial advice and trading can involve high risk of losing Capital personally although it looks very appealing I wouldn't go trade with this trading strategy just yet you saw for instance that when we change the Bollinger Bands parameters the results could change a lot and a bit randomly this probably means that this training strategy is overfitted and we don't want that we want to be more demanding with our training strategies but no big deal there's a lot of potential with chat GPT and I'm sure we can do way better I'm thinking something more day trading like yeah so let me work on that and get back to you thanks for watching don't forget to give us a like And subscribe if you haven't already if you have more time on your hands I think you might find these interesting take care
Info
Channel: Robot Traders
Views: 23,537
Rating: undefined out of 5
Keywords: algorithmic trading, automated trading, algorithmic trading python, algorithmic trading strategies, algorithmic trading using python, moving average trading strategy, trading bot python, trading bots crypto, trading bots for beginners, cryptocurencies, crypto, trading for beginners, trading, trading signals, tutorial, python, python for beginners, trading strategies, trading strategies for beginners, investing for beginners, cryptocurrency trading, challenge, technical analysis
Id: aE1jDiDpGRQ
Channel Id: undefined
Length: 14min 15sec (855 seconds)
Published: Wed Feb 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.