ChatGPT Trading strategy 20097% returns

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

You know all these ChatGPT!?!? AI strats are like: if the 50 SMA crosses the 200 SMA go long in goat futures… Come’on…

👍︎︎ 8 👤︎︎ u/Miserable_Drink_8920 📅︎︎ Jan 15 2023 🗫︎ replies
Captions
all right guys so we're actually in the midst of something big going on right now with the AI industry and that being chat GPT so it's been used heavily in the online space in different fields in different Industries whether it be from a coding space or whether it be from an animation or a Blog writing some people call this the next Google but I've been trying to see whether this can be used for a trading Department from a trading industry perspective especially from a Quant trading perspective because we can get lots of coding data and lots of information from Shark GPT so what we're going to do today is we're going to try out different things in charge GPT we're going to try out different strategies or try out how to get codes see if we can get different strategies and see if you can get an epigenous strategy and how efficient these strategies can be and how we can progress in the algorithmic trading industry so this is my experimentation with rgbt with trading you can try yourself some of these things uh maybe you can try something better as well so what I want you guys to do is just go to chargpt open Ai and then just click on try chat GPT and you will go into assign a page where you sign up all those things your credentials your emails and your password and your phone number I think they send you an OTP and then you will be sent to this page at which place you will essentially write down what you want so these are the examples capabilities and the limitations of this software this AI software uh it's good to have a look at it so the way it works is basically you just type on something here and it answers your question so let's start with some basic questions regarding algorithmic trading strategy so let's create something like how to create and of course we make trading strategy let's see what they have to respond okay yeah that's pretty decent Define your objective identify your Market determine your time frame here that's crucial because we've discussed many things in the daily space and also in the weekly space monthly spaces different time frame selection indicators test your strategy which is quite important um we need to go deeper into that right so let's see whether they came back to sustachi so let's see back testing um moving average strategy and let's be more specific 50 days we'll be back to see a 50-day or let's say a 20-day 20-day moving average strategy in Python let's see what that gives us so it's a frame that's correct so necessary libraries that's like pandas um things like that creating a function yep it trades through the rows uh-huh okay so it didn't give us the code I mean I was expecting the code so it didn't give me the code so let's type in Python code for uh 20-day moving average testing strategy back testing strategy let's see what that gives us okay there we go so I think the wording is quite important on how we get the results so again the libraries have been plotted so a map of pandas so it's reading the CSV didn't tell us specifically on how to download that data but that's okay um got the moving average the 20-day moving average and yeah if price is greater than I made then cash is an interesting kind of code made a bit complicated but I think we should get the net profit and the results as well so it will do the job this is pretty good actually so you can just copy paste this but it doesn't explain line by line the code um but I think we can go deeper into it like for example where to download the data way to download stock data um for python okay so again you've got Yahoo Finance in Bloomberg and web scraping yeah that's another way to do it there's commercial providers and all those things so if you guys want to know the line by line way of doing it I suggest you go to our YouTube channel and there is a video on algorithmic trading so you're the hero in Python that explains to you line by line the code completely we've actually got different chapters as well so you guys to know how to download the data from Wi-Fi and arts and installing the Anaconda libraries and all the other things necessary to delete resample the data one by one so this kind of works so if I want to get line by line data so for example if I want to say python code or downloading data from y Finance yep they've used a ticker function um so we've got we've got lots of information from uh chart gbt on how to download the how to use the codes for different kinds of strategy so now let's go d project I mean we've got an idea on how to uh code or back test the strategy we've got an idea on how to download data so let's go deeper into quantitative function let's go deeper into how to apply this quantitative strategies or how to use some of the quantitative skills that we teach on our course so let's go into what is for testing say for instance so what is forward testing flying to real-time Market data yep that's correct that is a very interesting point that they have uh raised the limitations is like trading such as Market risk and slippage so um there's also another minor thing that they missed so sometimes instead of applying it to real-time data so what we do is we do optimization over a specific time so they've completely forgotten about the whole optimization bit so let's go on what is optimization in trading what is optimization in trading yes that is correct it is adjusting the parameters of a trading strategy yes we can get over fitting so that is one of the things why we do the forward testing in order to avoid the curve fitting so we do in our courses that we actually back test or optimize over a specific period so for example 2005 to 2010 we find out uh which values are the best parameters for example our moving average or an RSI or an Ma and then what we do is that we apply in 2010 to 2012 or something and see whether it works so that is basically what forward testing is so even though we don't have real-time Market data we can still continuously do that like over a five year period or a five month period or whatever it is so in that way every single time the parameters are adjusted uh to the best case scenario so even if the market evolves to a crash based scenario or a market is evolved to a trending up scenario the pyramid is adjust accordingly so that is basically what optimization is and forward testing is so then um it's not very clear HR gp2 has not been that perfect in making you understand but it gives you an overall picture on what's going on what we intend to do in quantitative training but these kind of these minor things are missing from that so for instance um adjusting the parameters of trading so that's basically I think this is for our mfi strategy um so adjusting the parameters will be like changing the 14 day to maybe 13 12 or 50 to maybe 49 or 48 or something I'm seeing how it affects the results of this one this is the mfi and Amazon so we've got 4 900 something so let's change this to let's put it eight something so let's see how that affects the strategy so now it has gone down to 3443 so 14 was far more ideal so an example of an optimized strategy is found on our course for people who have done our course uh it has really performed very well it's a count upon strategy I think it was a third strategy on our course so it's performed spectacularly well uh it's a mean reverting strategy uh this year so for example here it's picked the shot here it's closed here short here I took a position here so even in the down Market it works really well and so that's one of the biggest advantages of me in reversing strategy so if you look at the strategy tester and the list of trade so this is performed uh practically some really good trades 1.442.66 3.5 so it's done pretty well 1.82 so for people who have used the course I mean done the course and use the strategy congratulations but if you haven't used the strategy then I would suggest I hope you guys pick something from it and has adapted to your own personal strategies and it also performed very well in 2008 crash as well so I think if I can go down the 2008 financial crisis because this specific strategy which is the third strategy and also the fifth strategy is ideally meant for volatile market so you can see in 2008 it was just profit profit profit profit small loss here there will be big loss as well but there will be massive uh profits because of the volatile market so media writing strategies work tremendously well during High volatile markets so rather than Trend falling markets these are some of the advantages you could do with optimization and forward testing so these are all critical elements in quantitative trading so chart GPD is kind of guiding us to that right direction which I really like I think it can really help you guys to understand things that you're not thorough about so for example if you don't know anything about quantitative trading and you I say something or you hear something about it in the online space and then you want to know much about it then you know typing it into chat GPT seems more convenient I think to understand sort of Google because Google's like giving you like 10 20 different articles and then you have to open up each article to find out oh yeah this is what that is you know rather than getting your right solution so let's do let's go deeper let's do like an optimization code in Python see how that what gives us see how that works out so they have used the scikit library so this is like a machine learning model so they use the machine classifier they use a training data and they have used the parameters as well so um this is different from what I saw a few minutes ago when I tried out the optimization that was pretty basic optimization but this is like they've taken it a bit too complex according to a machine learning model not that machine learning model doesn't work but the problem with machine learning models is that different kinds of machine learning models there's a q learning uh there's a random Forest then there's the xgb so there are different kinds of machine learning models some of them works really uh okay some of them don't work really well so again they haven't specified it why they're not using this specific model as compared to that specific model so let's go a bit more deeper so let's go optimization code uh in Python by changing parameters by changing parameters so maybe this one might give us more specific code yeah perfect so this is what I was looking for really so there's a parameter value 0.10.5125 but it doesn't specify what kind of parameters we're using so here it's just some random parameters um so this strategy dot run so we haven't decided the strategy dot run function so that code is not there either so these are some of the flaws I guess in chat GPT so uh some of the functions so it just gives you that that small line of code but it hasn't shown us what is the Run function or where is the Run function where is the set parameter function let's do optimizing moving average parameters power or it hasn't even stated that what parameters were changing so let's do optimizing moving average parameters in trading strategy Parton so I think I think the wording in in the chat GPT is pretty critical so it can uh completely change everything so okay so this one seems far better so we've got the ma values 10 20 50 and 100 so they're trying to play around with all these values and then store the results okay this seems far more better than the other one so this is one of the things that I'm kind of expecting so this is pretty much what we're doing in our course but uh not like this not 10 20 1500 we do it specifically for each variable so it's like 10 11 12 13 14 all the way to whatever we're looking for so it's like a minimum to a maximum so it's not it's not specified to 10 20 50 and 100 alone and the code is much more simpler than this one so this this does the job as well so again it doesn't specify why we're just using 10 20 1500 maybe like 31 was far better than any of these values just like 14 was better than eight in that mfi strategy as well so you can charge EBT is kind of lacking in that specific field as well so I think what's going on here is that they're trade they're trying to get the best uh wording in the online space and trying to find the code and putting it right here but unless you're like thorough with the coding and understand the code I think it might be tricky for you guys to play in algorithmic trading or quantitative trading bet but still it does the job you know I mean for for a person like me and I can dissect the information I can leave out some of the unnecessary information so for instance I want to know about I don't use trade search and I use interactive brokers but let's say I want to find the API of tradestation API to python codes a straight station API to python code trading strategy let's see if we get Timber one oh that's so we will get some of the information so we get the API access install the API library in Python then you install the tradestation this is pretty good information you know so I don't use trade station but if in case I did use tradestation uh API then you know I just have to use it in chat GPT and that's that's pretty solid information you know and okay but a lot of you come to check they did the trade station API because especially if I'm going live trading in a quantity based uh trading strategy you have to make sure the codes are correct so it's good so if you're using a new broker or something I think this would be pretty cool to understand the python codes for apis and stuff like that um how about let me go deeper uh how can I how can I Implement I already know this but just to see how uh chat GPT responds to it how can I Implement my trading strategy in Python in the cloud lots of spelling mistake here but let's see I think if there's lots of spelling mistakes it kind of gets slower or I don't know maybe there's like lots of demand in chat in the usage of the charge GPT software okay so there's Google cloud and there's Amazon website Amazon web service is pretty good okay tradestation has got a cloud-based trading platform Google collab or Jupiter okay okay let's see if it does find script code okay find script code for back testing a 50-day moving average strategy so we'll try it out in the bindscript code as well this is super slow I'm quite surprised that it's getting slower okay here's an example of my script code 50 days so it doesn't specify it is a version four or not but I know it's version four because it doesn't use ta so let's try to see it long because it's a longer strategy and racial position show entry strategies are short exit the and sets the look back period to 50 days so it doesn't tell you the version so it's version four on this one so if you guys want to know version 5 is full tutorial on our YouTube channel as well okay anyways what I'm going to do is I'm going to copy paste this one into trading Viewpoint script so I'm just going to copy the code and then I'm just going to go here just gonna create a new strategy so I'm going to paste this so I'm going to save so strategy of a dream so I know why this is not working because it's a version four so I'm just going to version four and save that so what's the thing that's creating the issue so there's a compilation error so we have to do line three long entry seems to be the issue so copy pasting the code simply put in work so it's long entry so long entry is closer crossover close comma Ma so amazing close command look back look back is 50 so it is true I mean what's what's causing the issue oh yeah I know what's happened so what's happened essentially is that the copy pasting didn't work um so there has to be a tab here there's a tab there as well so again we found a drawback in the copy facing bits or the coding bits so let's let's go back to this they actually leave four spaces they also did leave four spaces so this is a very common issue that happens with people well copy-pacing codes I think many people have contacted me as well like they've seen errors while copy pasting so this is again some of the issues with copy pasting code so even charge gp2 hasn't figured out that every uh platform when they copy paste code sometimes these strategies kind of get crunched up so I think it should work right now so let's add this to the chart that the previous one so it didn't work that great I mean it didn't form very well initially and then it did go down so that 50-day moving average long and short in the Amazon didn't work so let's do something else let's see create uh strategy in find script that gives me 100 I mean let's do a bit crazy three thousand percent return in Amazon stock foreign can take in a while I guess it it's not possible to guarantee a specific level of return for any trading strategy okay simple strategy in the Amazon stock Okay so we've got a simple strategy most likely this is a moving hour 50 that we just we just tried that right now doesn't work right it doesn't work this this doesn't work we just tried it right now it doesn't work but obviously we can tweak it for our own benefit we can add some stop loss and take profit and things like that um okay so let's go a bit more crazy let's do something like give me find script code for a long only momentum strategy maybe this might work because we're just doing a long only so if you apply it in some healthy liquid stocks maybe it might work oh my God again they're giving a 50-day but it's kind of a momentum style we just go yeah so strategy or exit okay calculator I'm pretty sure this might actually work so I'm just going to copy this and then go to Pine editor and then paste save doesn't work because it's not version has not been set up so um version equals this is four again the drawbacks of chat GPT so again save that entry again we need to have four spaces here so just again drawbacks of the strategy again let's do the Amazon five exit long so we haven't had a condition if not entry strategy.x8 so that is not correct so we need to have a condition of exit which it has in so it's basically done by and hold really uh buying at the momentum and then it denects it so it's been holding on for a substantial period of time so let me make that change here if if close is I'm just going to create a new strategy of close it's less than SMA close comma 200 . strategy dot exit exit zero to close so again okay so there you go um so there's been certain issues here so um some minor situation of the Court it did astrology.exit and then it gave the name exit but in reality we need to mention which specific trade we're going to close and that specific trade was the long so we have to write in Long here and then specify the conditions um the strategy performed pretty decent I mean we need to change this to 100 Equity obviously to get the accurate results so it did 20 000 return uh okay that's that's pretty decent really um yeah quite surprised by the fact but it seems like there's like lots of Trades there and I think during the choppy period so that was a 200-day moving average really uh if you do the list of Trades it's two percent two percent two percent and then I'm pretty sure there should be like a massive uh returns here in wall so let's do the performance summary profit maximum roll I'm 65 percent shop ratio number of winning trades number losing trade percentage profit was 40 the average trade is six percent average winning trade is 20 an average losing trade is 2.94 so it kind of shows why we've got some spectacular terms but in reality it's got twenty percent twenty thousand percent return so thank you chat GPT in creating that strategy obviously I had to make changes to the code a bit and tweak it to my own specifications uh to get that 20 000 return um so I guess you can use sharp GPT to create pretty decent strategy creating a twenty thousand percent return but I had to tweak it uh because it did give me the right code there was drawbacks in the code so it's not really exit here it should be long here so if we exit the condition there and I had to create my own rules to exit the condition to get that 20 000 return so I think the takeaway with the Chachi BT is that it's not like one one solution to figure out some great strategies but you can use if you know the foundation of some kind of quantitative base if you've got that idea on what to do and what not to do and also I've got a bit of coding experience I think it would be great I think just copy pasting the strategy just like this won't work because it's it's like lots of Errors starting from the spaces and starting from the line of code so unless you know that specific coding language thoroughly you might not know what to do if you come across errors and you have to make specific changes like when we tried um this one and also the other some of the Python codes as well some of the functions were just you know it was just random we didn't know what the function does and things like that so there is no just copy pasting things but that um there's some really great information for example like that tradestation API so if I was using a tradition broker and I didn't know what to do then you know just asking chat GPT might be a great idea uh so from those specifications I thought that was pretty cool but again I'll have to cross that cross check that with the train station website so anyways hope you guys got an idea on how to use chat GPT to learn so I think it's really good to learn quantitative trading or algorithmic trading and also maybe even value investing which I might be doing a video soon so let's say how to calculate intrinsic value of a company and you might actually get some information quality based information because there's lots of uh information available in calculating intrinsic value again another takeaway is that it's kind of slow when it when they're spelling mistakes so be careful the way you type it but overall I think it was pretty good you know the whole I kind of like that space because maybe it didn't help me that much because I am I know thoroughly about the quantitative trading and algorithmic trading space but for people who don't know this can be like a really stepping stone for you guys to learn lots of things in that space and also if you have doubts on the codes I think if you'd like type in like what is momentum trading or what is Trend following trading you know that could be a great information as well or even the python code you know like for instance you want to know what is a function or uh what is the function used to find the average of a stock you know those kind of things will be pretty cool so anyways this one the intrinsic value discounted cash flow model I think you can go deeper into it to find out what is give me an example of a discounted cash flow method stock calculation so um there is lots of room I guess there's a lot of room to learn in this amazing new software so try it out see how it goes and let me know if you guys find something interesting in this but don't don't think that you can find like one trick solution to find a great algorithmic trading strategy the only reason why we got a twenty thousand percent return is because I made a pretty decent change to this by tweaking the exit condition so hope you guys enjoyed this video have a great day thanks for watching
Info
Channel: QuantProgram
Views: 1,177,929
Rating: undefined out of 5
Keywords: Trading, Finance, chat gpt, chat gpt trading bot, chatgpt trading, chatgpt trading bot, chatgpt tradingview, chatgpt pinescript
Id: unsa_gXPAJ4
Channel Id: undefined
Length: 29min 47sec (1787 seconds)
Published: Thu Dec 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.