YouTube2Text

Cloud Scalping Strategy in Python Makes 223% — Transcript

by Algo-trading with Saleh · 3,454 words · 471 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hey guys so in this video I'm going to
  2. 0:02disclose one of my best personal
  3. 0:04scalping strategies not only it produces
  4. 0:06decent results but the good news is that
  5. 0:09I've done zero optimization on it that
  6. 0:11means it has a very low chance of being
  7. 0:13overfit and I really like that and it
  8. 0:15even gives me confidence to add the size
  9. 0:17of the position before adding leverage
  10. 0:18to it it has a max throw down of minus
  11. 0:216% over the last year which is
  12. 0:23absolutely amazing so anyways let's get
  13. 0:25right into
  14. 0:26it the main indicator of this strategy
  15. 0:29is the M Cloud so let's add it to our
  16. 0:33chart all right this green line here is
  17. 0:36pretty much useless so I'm going to
  18. 0:37remove that all right the in rule of the
  19. 0:41strategy is very simple we want to go
  20. 0:43long when the trend here is bullish now
  21. 0:45what do I mean by that I need the
  22. 0:47conversion line which is this blue line
  23. 0:49here to be above the base line which is
  24. 0:51this red line right and you can see an
  25. 0:53example of that happening in here
  26. 0:54however we don't go long just yet we
  27. 0:57need confirmation and for that we wait
  28. 0:59until till the cloud itself which is
  29. 1:01made of two lines a span a and a span B
  30. 1:04right we need this also to show us an
  31. 1:06uptrend and that didn't happen until
  32. 1:09here so this would have been where we
  33. 1:11would have gone long in this strategy
  34. 1:13now in this example you might be
  35. 1:15thinking oh wouldn't have been better if
  36. 1:16you went long here well yeah it would
  37. 1:18have but this is an easy example trust
  38. 1:20me there's going to be lots of
  39. 1:21situations where there would have been a
  40. 1:23false breakout but because we have
  41. 1:25confirmation we wouldn't have fall into
  42. 1:27those traps and for a short position we
  43. 1:29would just do the opposite all right so
  44. 1:31let's go to Jesse and create a new
  45. 1:33strategy I'm going to name it Cloud
  46. 1:36scalper next I'm going to open my vs
  47. 1:38code editor which is way smarter than J
  48. 1:41built-in editor and I'm going to look
  49. 1:43for it Cloud scalper now first I'm going
  50. 1:46to define a new
  51. 1:48property and I'm going to call it Trend
  52. 1:51now in it I'm going to define the ichim
  53. 1:53cloud and we can do that simply by
  54. 1:55saying Cals
  55. 1:58ta. h
  56. 2:00cloud and I'm just going to pass the
  57. 2:03current
  58. 2:04candles and even though we can pass some
  59. 2:07parameters I'm not going to do that
  60. 2:09because I want to make sure that the
  61. 2:10strategy is as simple as possible to
  62. 2:13lower the chance of overfitting the
  63. 2:14strategy all right when would it be an
  64. 2:17uptrend I'm going to say if C Dot and as
  65. 2:20I mentioned on the chart I want to make
  66. 2:22sure the conversion line is above the
  67. 2:25Baseline right but I also want to make
  68. 2:28sure that the span a is above the span B
  69. 2:31again as I described it here so this is
  70. 2:33the conversion Line This Is The Base
  71. 2:34Line This is span a and this is span B
  72. 2:37all right if this is the case I want to
  73. 2:39return one if it's the other way around
  74. 2:42I want to return minus one and if it's
  75. 2:44neither I want to Simply return zero all
  76. 2:47right for the entry rule I want to
  77. 2:49Simply say if the current Trend equals 1
  78. 2:52for my short entry I want to say the
  79. 2:53opposite so return true if the current
  80. 2:56Trend equals minus one let's also remove
  81. 2:59this commment code and also this one
  82. 3:02let's say the entry rule is met and I
  83. 3:04want to enter a position the entry price
  84. 3:06is going to be the current price because
  85. 3:08I want to open the position using a
  86. 3:10market order and as for the quantity of
  87. 3:12the order or my position I want to risk
  88. 3:143% of my total capital and we can
  89. 3:16calculate that very easily using Jesse's
  90. 3:19risk to quantity utility function the
  91. 3:21first thing that it needs is the current
  92. 3:23capital and I'm going to pass the
  93. 3:26current available margin the second is
  94. 3:28the risk per capital and I'm going to
  95. 3:30pass 3% and next we have the entry price
  96. 3:33so I'm going to pass entry and then we
  97. 3:35need the stop loss now I forgot to do
  98. 3:37that so let's do that here now for the
  99. 3:39Stop Plus I want it to be the entry
  100. 3:42price minus the ATR indicator which I
  101. 3:45can get by saying ta. ATR and then
  102. 3:48simply passing the current candles and
  103. 3:50again I'm not going to change the
  104. 3:52parameters and I want to multiply that
  105. 3:54by 2.5 because I don't want the stop to
  106. 3:57be very close to the entry price because
  107. 3:59then you're going to miss out on so many
  108. 4:01good opportunities right so now that we
  109. 4:03have the stop I can pass it here and
  110. 4:05next we have the Precision which I'm not
  111. 4:07going to touch here but for the fee rate
  112. 4:10I'm going to pass the fee rate of the
  113. 4:13current exchange that I'm trading all
  114. 4:14right now that we have both the price
  115. 4:16and the quantity I can simply say self
  116. 4:18buy equals quantity and then the entry
  117. 4:21price as my go short method I'm going to
  118. 4:23do the opposite so again using the entry
  119. 4:25price the stop is now entry plus 2.5
  120. 4:28times of the current at R because it's
  121. 4:30for a short position and then for the
  122. 4:32quantity I did exactly the same however
  123. 4:34instead of calling The self. Bu to
  124. 4:36submit the order I'm using self. self
  125. 4:38right now what about taking profit for
  126. 4:40that I'm going to use the on open
  127. 4:42position method which will be executed
  128. 4:45as soon as the position is open and in
  129. 4:47it I'm going to say this if is for a
  130. 4:50long position which we can get by saying
  131. 4:53if self do is long in it I'm going to
  132. 4:55say this self. takeprofit equals now
  133. 4:59this this is again an order so we need
  134. 5:01both the quantity and the price as for
  135. 5:03the quantity I'm going to say the
  136. 5:05current position it's
  137. 5:08quantity and then as the price I'm going
  138. 5:10to say this the current price whatever
  139. 5:13it may be
  140. 5:15minus the current
  141. 5:18ATR again I passed the candles
  142. 5:21multiplied by 3.2 now notice that our
  143. 5:25profit margin is being a little bit more
  144. 5:27than our risk which means we're going to
  145. 5:29make more money on our winning trades
  146. 5:31than we would be losing on our losing
  147. 5:33trades now this was the takeprofit but
  148. 5:35what about the Stop Plus because yes I
  149. 5:37esfi the stop price here because I
  150. 5:39needed to use it here but I didn't
  151. 5:42submit the stop loss order ever and I
  152. 5:44could have done that here by the way in
  153. 5:46Jesse you can submit both the stop loss
  154. 5:48and the take profit right inside your go
  155. 5:50long or go short position but the
  156. 5:52problem is that you can only do that for
  157. 5:54futur trading not for stop trading so as
  158. 5:56a result I've learned to always do it
  159. 5:58inside my own open position Method All
  160. 6:01right so next I'm going to say self
  161. 6:03suplus equals the quantity of the
  162. 6:05current position and the price is going
  163. 6:07to be the current price minus 2.5 * the
  164. 6:10current ATR and next I'm going to say if
  165. 6:13it's a short position I simply want to
  166. 6:15do the opposite now we have both the
  167. 6:16inter Rule and the exit rule of the
  168. 6:18strategy and also the position sizing so
  169. 6:21now we can start the first back so let's
  170. 6:23go back to Jesse and open the back
  171. 6:25testing section and I'm going to choose
  172. 6:27cloud
  173. 6:31scaler and I'm picking the 15 minutes
  174. 6:33time frame BTC UCT on binance Perpetual
  175. 6:37Futures and the duration is since the
  176. 6:39beginning of
  177. 6:402024 up until yesterday I've turned on
  178. 6:44the fast mode and also the
  179. 6:49Benchmark now it didn't execute any back
  180. 6:52test so let's check out our in rule
  181. 6:54right here's the issue in here I said
  182. 6:56when the span a is bigger than span a it
  183. 6:58should have been
  184. 7:03B all right let's go back and rerun it
  185. 7:05one more time and there we go this chart
  186. 7:08doesn't seem normal it seems like it's
  187. 7:10not actually closing the position so
  188. 7:12let's go back to the code and check our
  189. 7:14exit rules so okay so you see the take
  190. 7:17profit for a long position it should
  191. 7:19have been plus the current ATR and for a
  192. 7:23short position it should have been minus
  193. 7:26all right so let's go back and re it one
  194. 7:28more time
  195. 7:30all right so there we go now this is
  196. 7:32natural you see we're not doing well
  197. 7:34against the market and the reason is
  198. 7:35we're taking too many trades you see we
  199. 7:37traded more than 1,000 times and we paid
  200. 7:40more than $6,000 in trading fees and of
  201. 7:42course all the numbers don't look good
  202. 7:44however I didn't expect to be profitable
  203. 7:47just yet because you can never find a
  204. 7:48good strategy by using simply one
  205. 7:51indicator all right let's go back to the
  206. 7:52Chart now the first thing that I like to
  207. 7:54use with this type of strategies is the
  208. 7:57adex indicator so let's add it to our
  209. 7:59chart all right so you see this is the
  210. 8:00adx and the way the adx works is that
  211. 8:03when its value is going up it means that
  212. 8:05the trend in Market is getting stronger
  213. 8:08and when it's slow it means we are more
  214. 8:10likely in a ranging market so I want to
  215. 8:12set a threshold at 50 and I only want to
  216. 8:15take trades when the adx is above this
  217. 8:17threshold so let's go back to the code
  218. 8:19and I'm going to define a new property
  219. 8:22and I'm going to call it adx and in it I
  220. 8:25will say this return true if ta. a adx
  221. 8:30and then I will pass the current candles
  222. 8:32I want its value to be above
  223. 8:3450 that's it and then I will go back to
  224. 8:38the shoot long method and I will simply
  225. 8:40say and self. adx and I will do that
  226. 8:44also for my short position so let's go
  227. 8:46back to Jesse and rerun the backest one
  228. 8:48more
  229. 8:49time there we go so you see it's not
  230. 8:52doing as bad as before because the
  231. 8:54number of Trades instead of being more
  232. 8:56than 1,000 it is now 129 which is is
  233. 8:59still too high by the way but anyways
  234. 9:01the max zon is minus 22 which is really
  235. 9:04good even at this point all right now I
  236. 9:06also want to do something else just to
  237. 9:08make sure that we are trading with the
  238. 9:10best time frame let's also add another
  239. 9:12back test for the time frame of 30
  240. 9:14minutes and another one for the
  241. 9:17hourly and just so we can see the
  242. 9:20results very quickly oh by the way in
  243. 9:22this one we're actually making some
  244. 9:24profit not bad and with this one we're
  245. 9:29do doing even better all right so let's
  246. 9:31open The Benchmark so we can see all the
  247. 9:33results simultaneously now the hourly
  248. 9:36let's add the time frame to this table
  249. 9:39right so the hourly is actually already
  250. 9:42doing great its Max R is minus 8.5 so I
  251. 9:46really like this so I'm just going to
  252. 9:49make a copy of this the results of the
  253. 9:52hourly time frame already look really
  254. 9:55great so even though I want to continue
  255. 9:58I'm going to do one thing I'm going to
  256. 10:00copy the code and in Jesse I will create
  257. 10:03a new strategy and I will call it
  258. 10:08Cloud
  259. 10:10scalper 1
  260. 10:13hour
  261. 10:17hourly and I will just paste it here all
  262. 10:20right let's go back to the chart and add
  263. 10:22the next indicator that I'm going to use
  264. 10:24which is BPW or a Ballinger band width
  265. 10:28I'm going to pick this one
  266. 10:30you see the value of the BBW it goes up
  267. 10:33when the fluctuation in the price is
  268. 10:35also high and then it comes down when we
  269. 10:37are again in a Range market now even
  270. 10:40though this is a turn following a
  271. 10:41strategy I don't want to take a long
  272. 10:43position when the price has already gone
  273. 10:45up very fast very quickly so I don't
  274. 10:47want its value to be more than five in
  275. 10:50these examples that you can see on the
  276. 10:52chart the value for it is actually below
  277. 10:55five so we would still take these trades
  278. 10:57but recently I found that when I add
  279. 11:00this very simple filter it improves my
  280. 11:02results so I'm going to back to the code
  281. 11:05and add another filter and I'm going to
  282. 11:08say
  283. 11:09property and then BBW and in it I will
  284. 11:13say return true when the current BBW is
  285. 11:16more than 5% now I'm going to make this
  286. 11:18into five and then just to make sure
  287. 11:21this value is between 0 and 100 I will
  288. 11:23multiply it by 100 to get the same
  289. 11:26result that I would on trading view next
  290. 11:28I will go to my entry Rule and simply
  291. 11:31add this and also here so let's go back
  292. 11:34to
  293. 11:35Jesse Let's Open The Benchmark page and
  294. 11:38rerun all the
  295. 11:42values all right we're getting an error
  296. 11:45it is saying that BBW doesn't
  297. 11:48exist okay let's
  298. 11:52see BBW okay it is called Ballinger
  299. 11:56bands with
  300. 11:59let's go back to the benchmarking page
  301. 12:02and rerun everything now while that is
  302. 12:04going I want to show you guys my
  303. 12:05favorite Dex called Apex which has
  304. 12:08instant order execution zero trading gas
  305. 12:10fees and very low trading fees the
  306. 12:12liquidity is also fine and most
  307. 12:14importantly because it is a de you don't
  308. 12:16need kyc or register or anything you
  309. 12:18just simply connect your metamask wallet
  310. 12:20and you start trading if you're going to
  311. 12:22sign up please consider using our link
  312. 12:24which will give you 5% trading fee
  313. 12:26discounts and and most importantly it
  314. 12:28will support me and my videos which I
  315. 12:30would really appreciate all right things
  316. 12:31got a little bit in the 50 minutes but
  317. 12:33not so much in the 30 and the hourly all
  318. 12:36right next I want to use a very simple
  319. 12:38indicator the EMA which I'm sure all of
  320. 12:41you guys already know so let's open it
  321. 12:43the moving average
  322. 12:45exponential let's remove this one and
  323. 12:49also hide the HMO
  324. 12:51cloud and I'm going to change its period
  325. 12:55to from the default which is 9 to 200
  326. 13:00however I won't simply use it like this
  327. 13:03trading the current time frame I wanted
  328. 13:05to trade the anchor time frame which if
  329. 13:08I want to do it on trading view I should
  330. 13:10go to the settings and here we can
  331. 13:12change the time frame from the chart to
  332. 13:14something else and I want it to be 4
  333. 13:17hours so you see now this line will move
  334. 13:19very slowly so it won't just jump on a
  335. 13:22trade as soon as the price moves towards
  336. 13:24a certain direction so let's go back to
  337. 13:26Jesse so first I want to define a new
  338. 13:28proper property so I will say
  339. 13:31property def big candles we could also
  340. 13:36call it anchor candles doesn't really
  341. 13:38matter and in it I will say return self
  342. 13:43getet candles the first parameter is the
  343. 13:46current exchange next it is the current
  344. 13:50symbol and as for the time frame I will
  345. 13:52pass 4 hours now I can Define the EMA I
  346. 13:57that I needed so I'm going to say
  347. 14:01longterm
  348. 14:05Trend and no it is not using that I'm
  349. 14:08going to say return one if T EMA and
  350. 14:13instead of passing the current Candles
  351. 14:15now I will pass the big
  352. 14:17candles and as for its period I will set
  353. 14:20number
  354. 14:22200 so actually I want to say if the
  355. 14:26current price is above the current EMA
  356. 14:31return
  357. 14:31one else return minus one for a
  358. 14:34downtrend all right so now I can go back
  359. 14:37to my inter Rule and add it here and one
  360. 14:41more time for the short position now
  361. 14:43let's go back to
  362. 14:45Jesse the benchmarking page and rerun
  363. 14:48everything one more
  364. 14:51time all right so the result doesn't
  365. 14:54look good but I actually went back and
  366. 14:58realized that I made another mistake in
  367. 15:00the source code so you see in here I
  368. 15:02wanted the BBW to be below five not more
  369. 15:05than that so let's go back and rerun
  370. 15:08everything one more time all right so
  371. 15:12the hourly looks incredibly good
  372. 15:15although the sharp isn't as high as the
  373. 15:1615 minutes so you
  374. 15:19see so on the 15 minutes time frame this
  375. 15:23looks
  376. 15:24fantastic this p&l is good the max R
  377. 15:27down ofus 6% is is absolutely amazing
  378. 15:30the win rate is at
  379. 15:3260% the sharp ratio is two the calmer
  380. 15:35ratio is five so this looks very
  381. 15:38promising and good all right now you
  382. 15:40might be asking yourself okay you say
  383. 15:42this is good but we're not even beating
  384. 15:44the market well here's the thing yes we
  385. 15:47didn't make as much as the market but
  386. 15:49the max thrown of our Equity curve is
  387. 15:52extremely low which means this allows me
  388. 15:55to add to the size of my position
  389. 15:57without worrying and that is why the
  390. 15:59sharp ratio and the calar ratio are so
  391. 16:01good even though we haven't beaten the
  392. 16:03market so let's go back to the source
  393. 16:05code and go to the goong method now if I
  394. 16:10simply multiply my quantity by a number
  395. 16:13such as let's say
  396. 16:18three actually let's do
  397. 16:23four and rerun everything just one last
  398. 16:28time
  399. 16:30all right so let's go back to the equity
  400. 16:32curve you see now we are indeed beating
  401. 16:36the market and yet my Max thrw down is
  402. 16:39minus 23% so and this isn't even the
  403. 16:42maximum risk that I'm willing to take up
  404. 16:44until minus 30% is perfectly fine for me
  405. 16:47so I can even go back and multiply this
  406. 16:49by let's say
  407. 16:55five and run it again
  408. 16:59all right so now with a Max Ron of minus
  409. 17:0328% which is still fine we are
  410. 17:06definitely beating the market if we made
  411. 17:09223% profit in almost one year the max
  412. 17:13starton is
  413. 17:16awesome the expectancy is
  414. 17:182.5% the win rate of course is the same
  415. 17:22and so are the sharp and the calmer they
  416. 17:24are a slightly changed but it doesn't
  417. 17:25really matter now the Third minutes also
  418. 17:29looks good but not as good as the 15
  419. 17:32minutes so I think it's fine to retire
  420. 17:35this one the hourly doesn't look bad but
  421. 17:38I don't think it looks as good as the
  422. 17:39one that we had before so let's also try
  423. 17:43back testing this one using Cloud
  424. 17:46scalper hourly the one that I created
  425. 17:48earlier so let's also backest this one
  426. 17:53so this does look good but the max is
  427. 17:55too low so to get better p&l I can also
  428. 17:58multiply this by numbers such as three
  429. 18:01at least so let's go and find the cloud
  430. 18:06scale per
  431. 18:09hourly let's find the quantity and
  432. 18:12multiply this by
  433. 18:18three let's rerun
  434. 18:20it okay this does look better but the
  435. 18:23max return is at minus
  436. 18:2524% not as big as this let's go to The
  437. 18:29Benchmark so you see if instead of
  438. 18:31looking at the p&l we look at the sharp
  439. 18:33ratio or even the calmer ratio we can
  440. 18:35clearly see which one is the winner the
  441. 18:3715 minutes is the winner because it has
  442. 18:39the highest sharp ratio and the calel
  443. 18:41ratio even though the hourly still looks
  444. 18:44pretty fine to me I'm going to leave it
  445. 18:46at here because the strategy is
  446. 18:48performing extremely well without me
  447. 18:50even optimizing it in any way which is
  448. 18:52great because it lowers the chance of
  449. 18:53the strategy getting overfit I'm going
  450. 18:55to submit this strategy to our
  451. 18:57strategies index page so you you guys
  452. 18:59can see the results for other time
  453. 19:00frames or time periods in time I will
  454. 19:02also try my best to create a premium
  455. 19:04version of this strategy and also submit
  456. 19:06it to our strategies now before I leave
  457. 19:08we're going to have a giveaway a random
  458. 19:10person who likes this video posts a
  459. 19:11comment and subscribes to the channel is
  460. 19:13going to win 1 million Bank token right
  461. 19:16let's pick the winner for the previous
  462. 19:17video and the winner is wow I'm blown
  463. 19:20away this is your best video ever I'd
  464. 19:22love to followup video thank you thank
  465. 19:24you so much for your positive comment
  466. 19:25please reach out to me so that I can
  467. 19:27send you your bnk tokens thanks for
  468. 19:28watching I'll see you in the next one
  469. 19:36[Music]
  470. 19:37[Applause]
  471. 19:39[Music]

About this transcript

This page contains the full transcript of Cloud Scalping Strategy in Python Makes 223% by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 3,454 words across 471 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.