YouTube2Text

Crypto Coin Screener in Python — Transcript

by Algo-trading with Saleh · 2,468 words · 331 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hey guys, so in this video I'm going to
  2. 0:02share with you the code that I wrote for
  3. 0:04a cryptocoin and time frame scanner in
  4. 0:06Python. Now when will you need this?
  5. 0:07Well, a good example of it is the
  6. 0:09previous video that I did. It was about
  7. 0:11this mean diversion strategy in Python
  8. 0:13which was producing pretty good results
  9. 0:14but only if you were trading it on three
  10. 0:16different assets. But why just those
  11. 0:18three? Why not other assets? Did I look
  12. 0:20for them? No. And was even the time
  13. 0:22frame that we were trading it on the
  14. 0:24best option? Well, to answer this
  15. 0:25question, I wrote this script to be able
  16. 0:27to go through a lot of coins and time
  17. 0:29frames very quickly. So, if that sounds
  18. 0:32interesting and useful to you, let's get
  19. 0:33right into it. Now, before I continue, I
  20. 0:35got to say I am not a financial advisor.
  21. 0:37This video is merely a tutorial and you
  22. 0:39should always do your own research
  23. 0:41before trading. And don't take this
  24. 0:42video or any of my previous work as a
  25. 0:44plugandplay money printing machine. Such
  26. 0:46a thing doesn't exist and trading always
  27. 0:48carries risk and you should only trade
  28. 0:50if you accept full responsibility for
  29. 0:52it.
  30. 0:53So here's the result for the strategy
  31. 0:55that I showed you in the previous video.
  32. 0:57It was called mean reversion RSI and by
  33. 0:59the end of it we were trading it
  34. 1:01simultaneously on ETH BTC and Doge on
  35. 1:04the hourly time frame. This was the P&L.
  36. 1:06This was the maxonus 22% which is really
  37. 1:09good. The Vet was 92% and the sharp was
  38. 1:12almost two. So I'm pretty proud of this.
  39. 1:14But the real question was why not other
  40. 1:17coins, right? And was evenly the best
  41. 1:20choice for all different coins. So to
  42. 1:22answer this question, I went ahead and
  43. 1:25wrote two scripts. The first one is for
  44. 1:28importing data for so many coins
  45. 1:30simultaneously. So this is it is called
  46. 1:32batch importer. Feel free to name it
  47. 1:34whatever. And by the way, I will share
  48. 1:36the source code for both of these
  49. 1:37scripts and the link will be in
  50. 1:39description. So the first one is
  51. 1:40responsible for importing data. And
  52. 1:42inside it, there's this config section
  53. 1:44which is almost the only thing that you
  54. 1:46guys should care about. First give it
  55. 1:48the name of the exchange. So this is an
  56. 1:49enome to make sure you are giving the
  57. 1:52right name. So for example, if I want to
  58. 1:53give the name of Binance, you have these
  59. 1:55options, Binance spot, Binance use spot
  60. 1:58and binance perial futures and it's
  61. 2:00test. So this is the one that I want.
  62. 2:02But if you want something else such as
  63. 2:03gate, you can also do this and you won't
  64. 2:06have to worry about the exact spelling
  65. 2:08of the name of it.
  66. 2:10And next we have the list of the
  67. 2:12symbols. And as you can see, I've given
  68. 2:15it so many here, right? So just add as
  69. 2:19many as you like. And next you should
  70. 2:21give it the start date. Now a note on
  71. 2:23this, it doesn't exactly matter. So just
  72. 2:26give it a very early date. For example,
  73. 2:28I've given a 2018 and many of these
  74. 2:31coins didn't even exist back then. But
  75. 2:34Jesse is smart enough to know that
  76. 2:36sometimes it needs to import from after
  77. 2:39the date you're giving it if there's no
  78. 2:41date of before that date. So just give
  79. 2:42it an early date such as 2018 and it
  80. 2:45should be good to go. The other good
  81. 2:47thing about the script is that it will
  82. 2:49import them one after another. So it's
  83. 2:51careful about the API rate limits of the
  84. 2:54exchange and even if there is any
  85. 2:56network issues for example it will keep
  86. 2:58retrying and it will also skip the
  87. 3:00existing candles. So you don't have to
  88. 3:02worry that for example one of the coins
  89. 3:05already exists on your database and
  90. 3:08lastly when it is done with every coin
  91. 3:11it will sleep for 24 hours and then try
  92. 3:14to import the data for that single day.
  93. 3:16So what I mean is you can just run this
  94. 3:18script on your machine and let it run
  95. 3:20for weeks or months and never have to
  96. 3:22worry about importing candles again. So
  97. 3:24if you are a bit lazy with you know
  98. 3:26updating your database this is a pretty
  99. 3:28good option. All right. So assuming that
  100. 3:30we have the data now let's move on to
  101. 3:32the actual script that is responsible
  102. 3:34for running the back test. So again we
  103. 3:37have a config section. All right. And
  104. 3:39this is the only thing that you guys
  105. 3:41should care about not every function
  106. 3:42that is in here. And firstly we will
  107. 3:45give it the name of the strategy. So in
  108. 3:47the previous video it was called mean
  109. 3:48version RSI. Next we have the name of
  110. 3:50the exchange again. And then we have a
  111. 3:52list of symbols again just like the
  112. 3:55batch importer. So put as many symbols
  113. 3:58as you like. And then we have the list
  114. 3:59of the time frame. So I have given it 15
  115. 4:02minutes, 30 minutes, 1 hour and 2 hours.
  116. 4:04And next we have the start date and end
  117. 4:06date of the back test. And then we have
  118. 4:08the data. So because this is back test,
  119. 4:10we don't just have trading routes, we
  120. 4:12also have data. So in the example of the
  121. 4:14mini version RSI strategy, we had BTCUDT
  122. 4:18and time frame of 4 hours as our data
  123. 4:20route. So it's also important to put
  124. 4:23this here. Now a little note here. What
  125. 4:25if we're not trading BTC anymore because
  126. 4:26we're giving it a list of symbols,
  127. 4:28right? So, what if it is trading ETH
  128. 4:29now? Well, when you define something
  129. 4:31like this as a data route in Jesse,
  130. 4:33something you guys may not know is that
  131. 4:35behind the scenes, it actually imports
  132. 4:37the data for that time frame for all the
  133. 4:40trading symbols. So what I mean is that
  134. 4:42if I put this here, even if my trading
  135. 4:45symbol is ETH, because I have this BTC
  136. 4:47UCT in the 4 hours time frame, Jesse
  137. 4:50will also import the data for ETH US on
  138. 4:53the 4 hours time frame. So this will
  139. 4:55work no matter what. But sometimes the
  140. 4:58bigger time frame that you need isn't
  141. 4:59for the exact symbol that you're
  142. 5:00trading. So you got to be careful with
  143. 5:02that. So what if for example, I'm
  144. 5:03trading a memecoin, but I also want the
  145. 5:05data of solicity in my strategy. That's
  146. 5:09a pretty good use case. So in those
  147. 5:10cases you need to make sure this exists
  148. 5:12here. Now I'm going to comment this out
  149. 5:14again. All right. So this is good. Next
  150. 5:16we have the config which will get the
  151. 5:19starting balance the trading fees which
  152. 5:21by the way I have set it a little bit
  153. 5:22higher than what it is on the actual
  154. 5:24exchange. I do this because I want to
  155. 5:27account for the slippage or any kind of
  156. 5:30fees that we are not taking into account
  157. 5:32because in general I like my back test
  158. 5:34to be very strict so that if my strategy
  159. 5:37is able to produce profits in my back
  160. 5:40test when it reaches live trading and it
  161. 5:43pays even less trading fees it has a
  162. 5:45better chance. So you hear all the time
  163. 5:46that live trading isn't as good as back
  164. 5:48testing. So because of that I try to
  165. 5:50make my back test as hard as possible.
  166. 5:52And next we have the type which is
  167. 5:54features. Features leverage is 10. Then
  168. 5:56features leverage mode is cross. And
  169. 5:58then the exchange. You don't have to
  170. 5:59change this because we already defined
  171. 6:01it uh above here. And then we have the
  172. 6:03warm-up candles which is by default 210
  173. 6:06in Jesse. And that's it. We don't really
  174. 6:08care about anything else. So let's go
  175. 6:10ahead and run this. Now by the way, when
  176. 6:11you run this for the first time, there's
  177. 6:13good chance that there's going to be
  178. 6:15some dependencies that aren't installed
  179. 6:16on your machine. But most of them are
  180. 6:18exactly what we use in Jesse. And of
  181. 6:21course the most important part which is
  182. 6:23the back testing itself is using Jesse's
  183. 6:25research module. So you need to ensure
  184. 6:27you have Jesse installed and some other
  185. 6:30libraries that may not be coming with
  186. 6:33Jesse. I think seabour is one of them
  187. 6:35and maybe also matt plus lib. So if you
  188. 6:37ran it and got an error like this just
  189. 6:39make sure to run a command such as pip
  190. 6:42install and then the name of that
  191. 6:44library. Do this one or two times and
  192. 6:46you should be good to go. And the other
  193. 6:47thing that you need to be very careful
  194. 6:49is where to put these files. You need to
  195. 6:51put them inside your Jessie project. So
  196. 6:53here the bot is the name of my Jessie
  197. 6:56project and here's my strategies folder,
  198. 6:59the storage and then we have the root of
  199. 7:01my Jessie project and this is where I
  200. 7:04need to put this. All right. So let's
  201. 7:05run this now. First of all, it is saying
  202. 7:07base here. So the cond environment that
  203. 7:10I have for Jesse isn't activated yet. So
  204. 7:12let's do that.
  205. 7:15activate
  206. 7:17Jesse 3.12 and then I will simply say
  207. 7:20Python batch
  208. 7:23back test
  209. 7:28and notice that it is using parallel
  210. 7:31processing to finish these back tests as
  211. 7:33fast as possible. Now, while that's
  212. 7:35going, I want to quickly remind you guys
  213. 7:36about our Telegram. It's the fastest way
  214. 7:38to get notified about my future work,
  215. 7:40whether it's a new tutorial or a tool
  216. 7:42that I create. Also, don't forget to
  217. 7:44check out our free Discord where more
  218. 7:46than 5,000 members like you and I are
  219. 7:48hanging out there and helping out each
  220. 7:49other with algo trading so we can all
  221. 7:51succeed together. The links for both are
  222. 7:53down in the description. There we go.
  223. 7:55So, first let's take a look at this. So,
  224. 7:58I'm going to zoom out so we can see this
  225. 8:01table a little better. All right. So, I
  226. 8:03hope this isn't too small for you guys
  227. 8:05to see, but basically we have a table
  228. 8:07here that shows us the result of the
  229. 8:09back test. And by default, it's been
  230. 8:11sorted by sharp ratio. So for example,
  231. 8:14we can very quickly see that BTC UC on
  232. 8:17the hourly time frame produces the best
  233. 8:19sharp ratio, which is 1.56.
  234. 8:22And next we have ETH USC on the 30
  235. 8:24minutes time frame. So that's
  236. 8:26interesting. And then we have ETH USC on
  237. 8:28hourly. Then we have BTC on 30 minutes
  238. 8:31producing the best sharp. Then we have
  239. 8:33B&B on the hourly and so on. And we also
  240. 8:36have tables. So let's take a look at
  241. 8:38this. First is displaying them by the
  242. 8:41returns and then by win rate. So we have
  243. 8:43BTC on the hourly producing 94% win rate
  244. 8:48which is amazing on ETH hourly still has
  245. 8:50the best win rate but when it comes to
  246. 8:53something such as sharp which is what we
  247. 8:55care more BTC USD on the hourly produces
  248. 8:58the best results for ETH. However, we
  249. 9:00can see very quickly that on the 30
  250. 9:03minutes is it has the best results which
  251. 9:04is 1.25. And then we have another table
  252. 9:07for the max draw down. So let's close
  253. 9:08this.
  254. 9:10Next, we have another table which shows
  255. 9:12us the net profit on different time
  256. 9:15frames. So for example, on ETH, I can
  257. 9:17very quickly see which one is giving me
  258. 9:19more. On BTC, I'm seeing that the
  259. 9:21hourly, which is this orange one, is
  260. 9:23producing better numbers. On BNB, only
  261. 9:26the hourly is profitable and the other
  262. 9:28two are actually negative. And on soul,
  263. 9:30I can see that almost all of them are
  264. 9:32bad. And we have another table for shop
  265. 9:34ratio.
  266. 9:37And then we have another one which shows
  267. 9:39us very quickly the max draw down and
  268. 9:41the win rate and also the number of
  269. 9:43trades. So the bigger the circle here is
  270. 9:46the more trades it is taking. So for
  271. 9:48example, this one looks amazing. This
  272. 9:51one which is for ETH on 30 minutes is
  273. 9:53also pretty good and so is this one. So
  274. 9:55I guess this last table is the most
  275. 9:57useful one to me. Of course I have the
  276. 9:59table of sharp ratios. But you might be
  277. 10:01thinking okay so you basically just gave
  278. 10:04us the same results. Well, go around
  279. 10:06this yourself on as many coins as you
  280. 10:08can because I did. And after finding the
  281. 10:12best combinations, my results went from
  282. 10:15this, which was producing 848%
  283. 10:19in 3 and 1/2 years with a maximum of
  284. 10:22minus 22. It went up from this into
  285. 10:26this. So now on the same time period it
  286. 10:30is producing 21,763%
  287. 10:35with a max draw down of - 32%. So if I
  288. 10:38compare the sharp ratio for example so
  289. 10:40you can see it went from two up to 2.7
  290. 10:43and even the average holding time went
  291. 10:46down from 70 to 43 hours which is
  292. 10:50better. So this number is simply crazy.
  293. 10:53And to trade it, instead of three
  294. 10:55assets, I'm trading eight different
  295. 10:57coins with different time frames. And I
  296. 10:59found them all using this script. Now,
  297. 11:01I'm not going to show you the exact name
  298. 11:03of those. It's going to be your
  299. 11:04homework. So I gave you the script. Go
  300. 11:06run it yourself and find the best
  301. 11:08combinations. Now, in case you want the
  302. 11:09source code for the strategy I just
  303. 11:11showed you, first of all, go watch the
  304. 11:12video. It's right before this one on my
  305. 11:14YouTube channel. And also, if you want
  306. 11:16the source code of it, you can find it
  307. 11:17on our strategies page, which is
  308. 11:20jesse.trade. trade slash strategies. And
  309. 11:22here's the results of that one. You can
  310. 11:25check it out the results for different
  311. 11:27time frames and symbols to see which
  312. 11:30ones perform better. And there's also
  313. 11:32some metrics here. Now, this is a new
  314. 11:34type of video that I just did. I shared
  315. 11:36with you a script that I wrote. It's not
  316. 11:38an official feature of Jesse yet, but
  317. 11:41it's very much could be. So, if you want
  318. 11:43to see this feature, this point screener
  319. 11:45inside Jess's dashboard. So you won't
  320. 11:48have to run a different script to get
  321. 11:49the results, but let me know and I will
  322. 11:52build it into Jesse. So if that sounds
  323. 11:54good, let me know in the comment
  324. 11:55section. Now, if you want to support me
  325. 11:56and my work to make more videos like
  326. 11:58this, please make sure to give the video
  327. 12:00a like and subscribe to the channel.
  328. 12:01Thank you so much for watching. I'll see
  329. 12:03you in the next one.
  330. 12:16[Music]
  331. 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.