Crypto Coin Screener in Python — Transcript
Full transcript
- 0:00Hey guys, so in this video I'm going to
- 0:02share with you the code that I wrote for
- 0:04a cryptocoin and time frame scanner in
- 0:06Python. Now when will you need this?
- 0:07Well, a good example of it is the
- 0:09previous video that I did. It was about
- 0:11this mean diversion strategy in Python
- 0:13which was producing pretty good results
- 0:14but only if you were trading it on three
- 0:16different assets. But why just those
- 0:18three? Why not other assets? Did I look
- 0:20for them? No. And was even the time
- 0:22frame that we were trading it on the
- 0:24best option? Well, to answer this
- 0:25question, I wrote this script to be able
- 0:27to go through a lot of coins and time
- 0:29frames very quickly. So, if that sounds
- 0:32interesting and useful to you, let's get
- 0:33right into it. Now, before I continue, I
- 0:35got to say I am not a financial advisor.
- 0:37This video is merely a tutorial and you
- 0:39should always do your own research
- 0:41before trading. And don't take this
- 0:42video or any of my previous work as a
- 0:44plugandplay money printing machine. Such
- 0:46a thing doesn't exist and trading always
- 0:48carries risk and you should only trade
- 0:50if you accept full responsibility for
- 0:52it.
- 0:53So here's the result for the strategy
- 0:55that I showed you in the previous video.
- 0:57It was called mean reversion RSI and by
- 0:59the end of it we were trading it
- 1:01simultaneously on ETH BTC and Doge on
- 1:04the hourly time frame. This was the P&L.
- 1:06This was the maxonus 22% which is really
- 1:09good. The Vet was 92% and the sharp was
- 1:12almost two. So I'm pretty proud of this.
- 1:14But the real question was why not other
- 1:17coins, right? And was evenly the best
- 1:20choice for all different coins. So to
- 1:22answer this question, I went ahead and
- 1:25wrote two scripts. The first one is for
- 1:28importing data for so many coins
- 1:30simultaneously. So this is it is called
- 1:32batch importer. Feel free to name it
- 1:34whatever. And by the way, I will share
- 1:36the source code for both of these
- 1:37scripts and the link will be in
- 1:39description. So the first one is
- 1:40responsible for importing data. And
- 1:42inside it, there's this config section
- 1:44which is almost the only thing that you
- 1:46guys should care about. First give it
- 1:48the name of the exchange. So this is an
- 1:49enome to make sure you are giving the
- 1:52right name. So for example, if I want to
- 1:53give the name of Binance, you have these
- 1:55options, Binance spot, Binance use spot
- 1:58and binance perial futures and it's
- 2:00test. So this is the one that I want.
- 2:02But if you want something else such as
- 2:03gate, you can also do this and you won't
- 2:06have to worry about the exact spelling
- 2:08of the name of it.
- 2:10And next we have the list of the
- 2:12symbols. And as you can see, I've given
- 2:15it so many here, right? So just add as
- 2:19many as you like. And next you should
- 2:21give it the start date. Now a note on
- 2:23this, it doesn't exactly matter. So just
- 2:26give it a very early date. For example,
- 2:28I've given a 2018 and many of these
- 2:31coins didn't even exist back then. But
- 2:34Jesse is smart enough to know that
- 2:36sometimes it needs to import from after
- 2:39the date you're giving it if there's no
- 2:41date of before that date. So just give
- 2:42it an early date such as 2018 and it
- 2:45should be good to go. The other good
- 2:47thing about the script is that it will
- 2:49import them one after another. So it's
- 2:51careful about the API rate limits of the
- 2:54exchange and even if there is any
- 2:56network issues for example it will keep
- 2:58retrying and it will also skip the
- 3:00existing candles. So you don't have to
- 3:02worry that for example one of the coins
- 3:05already exists on your database and
- 3:08lastly when it is done with every coin
- 3:11it will sleep for 24 hours and then try
- 3:14to import the data for that single day.
- 3:16So what I mean is you can just run this
- 3:18script on your machine and let it run
- 3:20for weeks or months and never have to
- 3:22worry about importing candles again. So
- 3:24if you are a bit lazy with you know
- 3:26updating your database this is a pretty
- 3:28good option. All right. So assuming that
- 3:30we have the data now let's move on to
- 3:32the actual script that is responsible
- 3:34for running the back test. So again we
- 3:37have a config section. All right. And
- 3:39this is the only thing that you guys
- 3:41should care about not every function
- 3:42that is in here. And firstly we will
- 3:45give it the name of the strategy. So in
- 3:47the previous video it was called mean
- 3:48version RSI. Next we have the name of
- 3:50the exchange again. And then we have a
- 3:52list of symbols again just like the
- 3:55batch importer. So put as many symbols
- 3:58as you like. And then we have the list
- 3:59of the time frame. So I have given it 15
- 4:02minutes, 30 minutes, 1 hour and 2 hours.
- 4:04And next we have the start date and end
- 4:06date of the back test. And then we have
- 4:08the data. So because this is back test,
- 4:10we don't just have trading routes, we
- 4:12also have data. So in the example of the
- 4:14mini version RSI strategy, we had BTCUDT
- 4:18and time frame of 4 hours as our data
- 4:20route. So it's also important to put
- 4:23this here. Now a little note here. What
- 4:25if we're not trading BTC anymore because
- 4:26we're giving it a list of symbols,
- 4:28right? So, what if it is trading ETH
- 4:29now? Well, when you define something
- 4:31like this as a data route in Jesse,
- 4:33something you guys may not know is that
- 4:35behind the scenes, it actually imports
- 4:37the data for that time frame for all the
- 4:40trading symbols. So what I mean is that
- 4:42if I put this here, even if my trading
- 4:45symbol is ETH, because I have this BTC
- 4:47UCT in the 4 hours time frame, Jesse
- 4:50will also import the data for ETH US on
- 4:53the 4 hours time frame. So this will
- 4:55work no matter what. But sometimes the
- 4:58bigger time frame that you need isn't
- 4:59for the exact symbol that you're
- 5:00trading. So you got to be careful with
- 5:02that. So what if for example, I'm
- 5:03trading a memecoin, but I also want the
- 5:05data of solicity in my strategy. That's
- 5:09a pretty good use case. So in those
- 5:10cases you need to make sure this exists
- 5:12here. Now I'm going to comment this out
- 5:14again. All right. So this is good. Next
- 5:16we have the config which will get the
- 5:19starting balance the trading fees which
- 5:21by the way I have set it a little bit
- 5:22higher than what it is on the actual
- 5:24exchange. I do this because I want to
- 5:27account for the slippage or any kind of
- 5:30fees that we are not taking into account
- 5:32because in general I like my back test
- 5:34to be very strict so that if my strategy
- 5:37is able to produce profits in my back
- 5:40test when it reaches live trading and it
- 5:43pays even less trading fees it has a
- 5:45better chance. So you hear all the time
- 5:46that live trading isn't as good as back
- 5:48testing. So because of that I try to
- 5:50make my back test as hard as possible.
- 5:52And next we have the type which is
- 5:54features. Features leverage is 10. Then
- 5:56features leverage mode is cross. And
- 5:58then the exchange. You don't have to
- 5:59change this because we already defined
- 6:01it uh above here. And then we have the
- 6:03warm-up candles which is by default 210
- 6:06in Jesse. And that's it. We don't really
- 6:08care about anything else. So let's go
- 6:10ahead and run this. Now by the way, when
- 6:11you run this for the first time, there's
- 6:13good chance that there's going to be
- 6:15some dependencies that aren't installed
- 6:16on your machine. But most of them are
- 6:18exactly what we use in Jesse. And of
- 6:21course the most important part which is
- 6:23the back testing itself is using Jesse's
- 6:25research module. So you need to ensure
- 6:27you have Jesse installed and some other
- 6:30libraries that may not be coming with
- 6:33Jesse. I think seabour is one of them
- 6:35and maybe also matt plus lib. So if you
- 6:37ran it and got an error like this just
- 6:39make sure to run a command such as pip
- 6:42install and then the name of that
- 6:44library. Do this one or two times and
- 6:46you should be good to go. And the other
- 6:47thing that you need to be very careful
- 6:49is where to put these files. You need to
- 6:51put them inside your Jessie project. So
- 6:53here the bot is the name of my Jessie
- 6:56project and here's my strategies folder,
- 6:59the storage and then we have the root of
- 7:01my Jessie project and this is where I
- 7:04need to put this. All right. So let's
- 7:05run this now. First of all, it is saying
- 7:07base here. So the cond environment that
- 7:10I have for Jesse isn't activated yet. So
- 7:12let's do that.
- 7:15activate
- 7:17Jesse 3.12 and then I will simply say
- 7:20Python batch
- 7:23back test
- 7:28and notice that it is using parallel
- 7:31processing to finish these back tests as
- 7:33fast as possible. Now, while that's
- 7:35going, I want to quickly remind you guys
- 7:36about our Telegram. It's the fastest way
- 7:38to get notified about my future work,
- 7:40whether it's a new tutorial or a tool
- 7:42that I create. Also, don't forget to
- 7:44check out our free Discord where more
- 7:46than 5,000 members like you and I are
- 7:48hanging out there and helping out each
- 7:49other with algo trading so we can all
- 7:51succeed together. The links for both are
- 7:53down in the description. There we go.
- 7:55So, first let's take a look at this. So,
- 7:58I'm going to zoom out so we can see this
- 8:01table a little better. All right. So, I
- 8:03hope this isn't too small for you guys
- 8:05to see, but basically we have a table
- 8:07here that shows us the result of the
- 8:09back test. And by default, it's been
- 8:11sorted by sharp ratio. So for example,
- 8:14we can very quickly see that BTC UC on
- 8:17the hourly time frame produces the best
- 8:19sharp ratio, which is 1.56.
- 8:22And next we have ETH USC on the 30
- 8:24minutes time frame. So that's
- 8:26interesting. And then we have ETH USC on
- 8:28hourly. Then we have BTC on 30 minutes
- 8:31producing the best sharp. Then we have
- 8:33B&B on the hourly and so on. And we also
- 8:36have tables. So let's take a look at
- 8:38this. First is displaying them by the
- 8:41returns and then by win rate. So we have
- 8:43BTC on the hourly producing 94% win rate
- 8:48which is amazing on ETH hourly still has
- 8:50the best win rate but when it comes to
- 8:53something such as sharp which is what we
- 8:55care more BTC USD on the hourly produces
- 8:58the best results for ETH. However, we
- 9:00can see very quickly that on the 30
- 9:03minutes is it has the best results which
- 9:04is 1.25. And then we have another table
- 9:07for the max draw down. So let's close
- 9:08this.
- 9:10Next, we have another table which shows
- 9:12us the net profit on different time
- 9:15frames. So for example, on ETH, I can
- 9:17very quickly see which one is giving me
- 9:19more. On BTC, I'm seeing that the
- 9:21hourly, which is this orange one, is
- 9:23producing better numbers. On BNB, only
- 9:26the hourly is profitable and the other
- 9:28two are actually negative. And on soul,
- 9:30I can see that almost all of them are
- 9:32bad. And we have another table for shop
- 9:34ratio.
- 9:37And then we have another one which shows
- 9:39us very quickly the max draw down and
- 9:41the win rate and also the number of
- 9:43trades. So the bigger the circle here is
- 9:46the more trades it is taking. So for
- 9:48example, this one looks amazing. This
- 9:51one which is for ETH on 30 minutes is
- 9:53also pretty good and so is this one. So
- 9:55I guess this last table is the most
- 9:57useful one to me. Of course I have the
- 9:59table of sharp ratios. But you might be
- 10:01thinking okay so you basically just gave
- 10:04us the same results. Well, go around
- 10:06this yourself on as many coins as you
- 10:08can because I did. And after finding the
- 10:12best combinations, my results went from
- 10:15this, which was producing 848%
- 10:19in 3 and 1/2 years with a maximum of
- 10:22minus 22. It went up from this into
- 10:26this. So now on the same time period it
- 10:30is producing 21,763%
- 10:35with a max draw down of - 32%. So if I
- 10:38compare the sharp ratio for example so
- 10:40you can see it went from two up to 2.7
- 10:43and even the average holding time went
- 10:46down from 70 to 43 hours which is
- 10:50better. So this number is simply crazy.
- 10:53And to trade it, instead of three
- 10:55assets, I'm trading eight different
- 10:57coins with different time frames. And I
- 10:59found them all using this script. Now,
- 11:01I'm not going to show you the exact name
- 11:03of those. It's going to be your
- 11:04homework. So I gave you the script. Go
- 11:06run it yourself and find the best
- 11:08combinations. Now, in case you want the
- 11:09source code for the strategy I just
- 11:11showed you, first of all, go watch the
- 11:12video. It's right before this one on my
- 11:14YouTube channel. And also, if you want
- 11:16the source code of it, you can find it
- 11:17on our strategies page, which is
- 11:20jesse.trade. trade slash strategies. And
- 11:22here's the results of that one. You can
- 11:25check it out the results for different
- 11:27time frames and symbols to see which
- 11:30ones perform better. And there's also
- 11:32some metrics here. Now, this is a new
- 11:34type of video that I just did. I shared
- 11:36with you a script that I wrote. It's not
- 11:38an official feature of Jesse yet, but
- 11:41it's very much could be. So, if you want
- 11:43to see this feature, this point screener
- 11:45inside Jess's dashboard. So you won't
- 11:48have to run a different script to get
- 11:49the results, but let me know and I will
- 11:52build it into Jesse. So if that sounds
- 11:54good, let me know in the comment
- 11:55section. Now, if you want to support me
- 11:56and my work to make more videos like
- 11:58this, please make sure to give the video
- 12:00a like and subscribe to the channel.
- 12:01Thank you so much for watching. I'll see
- 12:03you in the next one.
- 12:16[Music]
- 12:17[Applause]
About this transcript
This page contains the full transcript of Crypto Coin Screener in Python by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 2,468 words across 331 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.