ChatGPT o1: Python Strategy Makes 432% — Transcript
Full transcript
- 0:00hey guys it's s today I want to do
- 0:01something a bit different so as you know
- 0:03open AI recently released their latest
- 0:05model called the 01 preview which is
- 0:08supposed to be PhD level smart so I was
- 0:10curious to know how helpful would it be
- 0:12for us to use it to write a strategy and
- 0:15turn it into Jess code so we can see the
- 0:17results so that's exactly what I did so
- 0:19let's get right into it oh before I
- 0:21forget we're going to have a giveaway as
- 0:22always so make sure to stick around
- 0:24until the end of the
- 0:26video if you go to the GPT store and
- 0:29look up the word jesse you can find the
- 0:32custom GPT that I released months ago
- 0:35which would help you write strategies
- 0:37and also turn your ideas into the syntax
- 0:40that Jesse accepts so we already had
- 0:43that but unfortunately at the moment we
- 0:45cannot use that with the o1 preview
- 0:47model and that's what I wanted to do so
- 0:49instead I opened a new chat and I simply
- 0:52said I need you to write me the suo code
- 0:55for an algorithmic trading strategy that
- 0:57is Trend following now I tried countless
- 1:00prompts and almost none of them were
- 1:01good enough for us to be able to use
- 1:03them until I came up with this one
- 1:06please include the following details
- 1:08entry signals exit signals technical
- 1:10indicators used use one Bas onine
- 1:13indicator and at least another one for
- 1:14confirmation as for Baseline I need you
- 1:16to Define one Trend property and a big
- 1:19one which would use a bigger time frame
- 1:21in these properties don't simply say if
- 1:23the price is bigger than the moving
- 1:25average if you are using moving averages
- 1:27make sure there are multiple of them and
- 1:29compare the values for them use at least
- 1:32one indicator to filter out ranging
- 1:34markets which happen to be like the
- 1:36biggest Factor open positions with the
- 1:38entire Capital because later I want
- 1:40myself to adjust my position sizing cuz
- 1:43it wasn't really helpful with that stop
- 1:45loss and takeprofit targets use an
- 1:47indicator to calculate them instead of a
- 1:49specific percentage number which is
- 1:50something I absolutely hate suggest time
- 1:53frame for trading the market that I will
- 1:55be trading is BTC UC and it gave me the
- 1:59sud as you can see here it sounds okay
- 2:03and you might be curious why did I ask
- 2:05for a studio code and not the python
- 2:07code well the reason is chat GPT is not
- 2:11really familiar with the Jus syntax it
- 2:13is a bit but not as much as I want it so
- 2:17the custom GPD that I had made before is
- 2:20much more helpful with that so I just
- 2:22just simply copied the studio code and
- 2:25went to our custom GPT and said convert
- 2:28and I just pasted the sud code and this
- 2:31is the result that it gave me so this is
- 2:34the python code for Jesse and this is
- 2:37the key points so it is explaining how
- 2:39it works which is really really helpful
- 2:41if you want to get familiar with it so
- 2:44let's copy first the name of the
- 2:46strategy go to Jesse to the strategy
- 2:49section create a new one paste it here
- 2:52and just so that we can find it easier
- 2:54I'm going to add the word AI to
- 2:57it all right so let's go back here copy
- 3:02the entire code and paste it here save
- 3:05it go to the back testing tab now which
- 3:09time frame should we trade well it said
- 3:12the 1 hour chart for exit and entry
- 3:14execution which would be our trading
- 3:16time frame and for big Trend analysis it
- 3:19would be the 4 hours okay so I'm going
- 3:22to change this to 1 hour and as for date
- 3:25I picked since the beginning of
- 3:272022 up until 20 24 until the 7th month
- 3:32and everything else seems fine so let's
- 3:35run it oh sorry I forgot to choose the
- 3:38correct strategy so it was Trend
- 3:40following AI so let's run it again and
- 3:44we're getting this error I want you to
- 3:46see this error because I've seen many
- 3:48beginners with Jesse facing this one and
- 3:51usually the reason is because the name
- 3:53of the strategy and the name of the
- 3:55class are not the same so if I go back
- 3:57here and let's quickly go to the editor
- 4:01for this strategy so the name of it was
- 4:04supposed to be Trend following AI but
- 4:06when I copied it I left out the word Ai
- 4:09and that's why we were getting that
- 4:10error so if I go back and run it again
- 4:12this time that error should go away now
- 4:15we're getting another okay the function
- 4:17object has no attribute shape so let's
- 4:19go to our editor and look up Trend
- 4:23following
- 4:26Ai and let's clean this up a bit and
- 4:30look for errors that we can fix so right
- 4:32here you can see that we're getting a
- 4:33warning from my editor which is py charm
- 4:36and it is pretty smart so it's
- 4:39saying actually it doesn't matter what
- 4:41it's saying let's just check it because
- 4:43it is using this just like a property
- 4:46but if I go here you can see it didn't
- 4:48Define the keyword property so it just
- 4:51defined a function so that's why we were
- 4:53getting
- 4:54that so now the error is gone so let's
- 4:59go back and run it again okay it looks
- 5:01like it is stuck on some kind of loop
- 5:04but why is
- 5:06that okay so you see here it defined the
- 5:10name of the exchange as binance which
- 5:13isn't true that's not the name we're
- 5:15using here it's binance perpetual
- 5:17Futures and to make sure you don't get
- 5:19it wrong let's define this dynamically
- 5:21so instead I will say self.
- 5:25exchange and the symbol is correct but
- 5:28it's still let's do the same here
- 5:31and the time frames are right but
- 5:33because this is my trading time frame
- 5:35I'm going to replace it with self. time
- 5:38frame all right let's try it again all
- 5:41right this time we're getting Mac the
- 5:42object has no attribute histo so let's
- 5:44go here and look for other warnings
- 5:48let's remove this cuz we're not using it
- 5:50and then we have here and that's because
- 5:53in Jesse the word is H not
- 5:56histo and there's also one case here
- 6:00and that's it all right let's run it
- 6:05again all right it got executed that's
- 6:09good and the results aren't great but if
- 6:13you see what while the price was going
- 6:15up our Equity gear also went up so I
- 6:18think it has still some potential it
- 6:21didn't do almost anything during the
- 6:23downtrend which is a bit
- 6:25weird
- 6:26and during the range Market
- 6:30it went a bit down but not too much okay
- 6:32so it's not that bad so let's go back to
- 6:35the
- 6:35strategy and here we can see that it did
- 6:39not Define the shoot short and go short
- 6:41functions and that's why it is not
- 6:43taking any short trades so if I go down
- 6:46here you can see that the Longs are 100%
- 6:48of the times and the shorts are 0% so
- 6:51let's define the shot short function and
- 6:57hopefully copilot will help us to write
- 6:59the opposite of our shootong conditions
- 7:02here and it did let's also Define the go
- 7:06short function again using co-pilot so
- 7:10let's go back and run it
- 7:13again all right so now instead of 300
- 7:16and something is taking 1,600 trades so
- 7:19it is taking short trades if I go down
- 7:22here you can also see it here so that's
- 7:24good but the results aren't great so now
- 7:28at this point I want to change the code
- 7:30a bit based on my own knowledge that I
- 7:33usually do to improve the results so
- 7:36firstly I don't want to use the 1H hour
- 7:39time frame I want to use the 4 hours
- 7:41because I found it to work significantly
- 7:43better with Trend following strategies
- 7:46so I'm going to remove this candles 1
- 7:49hour
- 7:50here and I'm going to select whichever
- 7:54place that was used and simply use self.
- 7:56candles which will give us the trading
- 7:59candles for our current session which
- 8:01would be whatever time frame you use now
- 8:05I'm going to change the 4 hours for our
- 8:07bigger time frame and use the 6 hours so
- 8:11I will also rename this from 4 hours to
- 8:156 hours all right now let's go back and
- 8:20change our trading time frame from 1
- 8:22hour to 4
- 8:24hours and run it again and the results
- 8:28is significantly better
- 8:30now we are finishing in profit with
- 8:3360% the max R isus
- 8:3728% the win rate is at 52% so these are
- 8:42actually decent results but let's take a
- 8:46look while we had a downtrend our Equity
- 8:49care went up which is exactly what we
- 8:51wanted however here you could argue that
- 8:54this is a ranging market and we didn't
- 8:57do great which is typical for a TR
- 8:59falling while the price was going up we
- 9:02also made some nice profits so the way I
- 9:05see it we need to avoid the ranging
- 9:07market and in fact if I go to the source
- 9:11code we can see that the strategy is
- 9:13already using the adx to avoid ranging
- 9:16conditions but the threshold is set at
- 9:1925 which I think is a bit low so I'm
- 9:22going to replace this with 40 and run it
- 9:27again and now
- 9:29we finished with 87% profit with a Max
- 9:33throw down of minus 10% which is
- 9:35brilliant because usually we're okay for
- 9:38our Maxon to go as high as 20 or even
- 9:4130% so that means I can easily go here
- 9:46and change my position sizing to use
- 9:50more Capital so here this is my quantity
- 9:54I can just simply multiply it let's say
- 9:56by three and also do the same for the go
- 10:01short and run it again all right so
- 10:04we're getting this error which is
- 10:05basically saying we run out of margin
- 10:08and that's because I haven't changed my
- 10:10leverage number so it is currently set
- 10:13at two so let's increase this to
- 10:18four now again yes it is set to four but
- 10:22I'm still using three I'm just using
- 10:24three times of my Capital but I set it
- 10:26to four just in case to uh you know my
- 10:30trading fees or anything like that won't
- 10:31cause us issues so let's run it
- 10:40again and now we are finishing with 4
- 10:4532% profit with a Max R of minus 31%
- 10:50which is acceptable to me now obviously
- 10:52there are much more optimizations that
- 10:54we can do to this strategy and in fact I
- 10:57am going to keep working on it and
- 10:59create a premium version of it and
- 11:01submit it to our strategy index page on
- 11:03our website and I will also submit this
- 11:05free version to our website that you can
- 11:07use now this was a new type of video
- 11:09that I just did I'm not sure if you guys
- 11:10liked it or not if you want me to try
- 11:12out other scenarios with AI or other
- 11:15ways we can use it to write new
- 11:16strategies let me know down in the
- 11:18comments so that I can make more videos
- 11:20like this one now before I leave you
- 11:22we're going to have a giveaway a random
- 11:24user who likes this video posts a
- 11:26comment and subscribes to the channel is
- 11:27going to receive 1 million bnk token all
- 11:30right let's pick the winner from my
- 11:31previous
- 11:33video and the winner
- 11:35is huge fan brother please don't stop
- 11:38what you're doing this is hands down the
- 11:41best framework on the market right now
- 11:43and you're absolutely killing it thank
- 11:45you so much for your super nice comment
- 11:47please reach out to me so that I can
- 11:49send you your bunk tokens thanks for
- 11:51watching and I'll see you in the next
- 11:54one w w
- 11:59oh
About this transcript
This page contains the full transcript of ChatGPT o1: Python Strategy Makes 432% by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 2,016 words across 269 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.