YouTube2Text

Ichimoku Cloud Strategy in Python Makes 257% — Transcript

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

Full transcript

  1. 0:00hey guys it's all today I'm going to
  2. 0:02write a new strategy using the hu Cloud
  3. 0:04indicator next I'm going to use this new
  4. 0:06indicator that I found in my previous
  5. 0:08video to improve the results of this
  6. 0:10strategy drastically so let's get right
  7. 0:12into
  8. 0:14it let's open the aimu cloud on trading
  9. 0:18View and this is how it looks like on
  10. 0:21the 4 hours time frame now the lines
  11. 0:23that we care about are these two the
  12. 0:25blue and red one and this Cloud I find
  13. 0:27this green line here really useless so
  14. 0:30I'm going to disable this it's called
  15. 0:32the laging span which is basically the
  16. 0:34price with a bit of lag so let's remove
  17. 0:37that to take a long position in this
  18. 0:39strategy we need this blue line which is
  19. 0:41called the conversion line to go above
  20. 0:43the red line which is called The Base
  21. 0:46Line this will show us the shortterm
  22. 0:47trend of the market and then we also
  23. 0:49need the cloud to be green in other
  24. 0:51words we need the green line to be above
  25. 0:53the red line now these two are called
  26. 0:55span a and span B now you don't have to
  27. 0:57know about the names but we're going to
  28. 0:58use it in a second all right so let's go
  29. 1:00to Jesse and create a new strategy and
  30. 1:03name it Ichi moku Cloud let's copy this
  31. 1:07name and open it in my pie charm ID
  32. 1:09which is way smarter all right so first
  33. 1:11let's define a new property and I'm
  34. 1:13going to call it the small
  35. 1:15Trend in it I'm going to say C equals ta
  36. 1:20hm cloud and I'm going to pass the
  37. 1:24current candles and I won't even change
  38. 1:25the default parameters and I'm going to
  39. 1:28say if C dot conversion line which again
  40. 1:32is this blue line is above this red line
  41. 1:35which is called the Bas line so if this
  42. 1:37one is above the Baseline return one for
  43. 1:41an uptrend otherwise return minus one
  44. 1:44for a downtrend now our entry rule is
  45. 1:47going to be if the small Trend equals 1
  46. 1:51and for short entries we will do the
  47. 1:54opposite we'll say if the small Trend
  48. 1:56equals minus one all right so let's say
  49. 1:59this condition is true and we are about
  50. 2:01to open a long position what should be
  51. 2:02our position sizing and entry price I
  52. 2:05realize that often times when the entry
  53. 2:07rule for this strategy is true for
  54. 2:09example in here the cloud is green and
  55. 2:12at this point the conversion line again
  56. 2:14the blue line is above the Bas line
  57. 2:16which is this red one the price always
  58. 2:18goes down a bit not always but most
  59. 2:20times so because of that I decided not
  60. 2:23to open the position using a market
  61. 2:24order as I usually do instead I want to
  62. 2:26use a limit order so I don't want to buy
  63. 2:28here I want to buy a little bit below
  64. 2:30this price now how do we decide where
  65. 2:32exactly to buy now we could use some
  66. 2:34kind of line such as the conversion line
  67. 2:36in this case would be a good choice but
  68. 2:38I wanted to make it Dynamic and and
  69. 2:40usually my go-to indicator for setting a
  70. 2:43price dynamically which would work with
  71. 2:44any trading symbol is the ATR I often
  72. 2:47use it for stplus but in this case I
  73. 2:49also want to use it for entry so I want
  74. 2:51to say one ATR below this value so the
  75. 2:54entry is going to be the current price
  76. 2:57minus ta ATR R and then I'm going to
  77. 3:01pass the current candles and that's it
  78. 3:04so my sub is going to be as always the
  79. 3:07inry price minus the ATR multiplied by
  80. 3:11some kind of
  81. 3:12multiplier and I'm going to use 2.5 for
  82. 3:15this one and as for the quantity of this
  83. 3:16position I'm going to use the risk to
  84. 3:18quantity utility function of Jessi which
  85. 3:20would allow us to limit the risk of this
  86. 3:22position to a certain number and I
  87. 3:24usually use three so that means if this
  88. 3:26trade goes against us we won't lose more
  89. 3:28than 3% of our capital you could go with
  90. 3:30five if your risk appetite allows you
  91. 3:32but I'm going to stick with three so the
  92. 3:35quantity equals utils risk to quantity
  93. 3:39the first value is the capital and I'm
  94. 3:42going to pass the available margin the
  95. 3:44next one is the risk I'm going to pass
  96. 3:46three next we have the entry going to
  97. 3:49pass the entry then the Stop and I will
  98. 3:52also set the fee rate to the current fee
  99. 3:55of the exchange that I'm
  100. 3:57trading all right now we can pass the
  101. 4:00buy order which is going to be the
  102. 4:02quantity and then the entry price and as
  103. 4:05for the short position I'm going to do
  104. 4:08the opposite so that means the entry is
  105. 4:10going to be the current price plus 1 ATR
  106. 4:13the stop is going to be the entry plus 2
  107. 4:16times of the ATR and the quantity is
  108. 4:19similar and instead of a buy order we
  109. 4:22use a sell order now the value of the
  110. 4:24shot cancel entry usually we don't
  111. 4:26really care about it if we are entering
  112. 4:27with a market order but if you are using
  113. 4:29a limit order or a sub order to enter
  114. 4:31the position like we are in this case
  115. 4:33which we are using a limit order to
  116. 4:35enter at a lower price it has to be true
  117. 4:38all right so now it's time to submit the
  118. 4:39subplus order for that I'm going to say
  119. 4:41when a new position is opened on open
  120. 4:44position I'm going to say if it's a long
  121. 4:46position using the is long property my
  122. 4:50subplus is going to be the current
  123. 4:55positions quantity and the price of it
  124. 4:59is going to to be the entry price of my
  125. 5:02position which is this minus the current
  126. 5:06ATR multiplied by 2.5 which is exactly
  127. 5:09the value that we entered here but
  128. 5:11because this value was defined inside
  129. 5:12the go short method we don't have access
  130. 5:15to it here sure we could Define this
  131. 5:17inside some kind of variable that we
  132. 5:19could also use here but because it was
  133. 5:21really easy to reuse I'm just redoing
  134. 5:24the calculation next I'm going to say l
  135. 5:26if it is a short position I will do the
  136. 5:29same except instead of subtracting the
  137. 5:31ATR from the entry price at one position
  138. 5:34I will add to it all right so now we are
  139. 5:36entering trades we are also exiting
  140. 5:38using the suplus but we're not taking
  141. 5:40profits so for taking the profit instead
  142. 5:42of using a take profit order I wanted to
  143. 5:44write the trend for as long as possible
  144. 5:46so I'm going to say if my entry
  145. 5:48condition is no longer valid in other
  146. 5:50words if the conversion line goes below
  147. 5:52the Baseline like it happen here or in
  148. 5:55here I want to close the position so
  149. 5:57this will let us that if there is really
  150. 5:58a strong Trend in the the market we can
  151. 6:00write it for as long as possible so I'm
  152. 6:02going to
  153. 6:02say update position if it's long
  154. 6:06position I will say if the small
  155. 6:11trend is minus one which is the opposite
  156. 6:13of our entry then I'm going to use this
  157. 6:17shortcut in Jessi which is used for
  158. 6:18liquidating everything which is simply
  159. 6:21self.
  160. 6:23liquidate and next I want to do the
  161. 6:25opposite for a short position so now we
  162. 6:28have our in rules with doing the
  163. 6:29position sizing we're submitting the
  164. 6:32stop loss and we Define our take profit
  165. 6:34condition so now we're ready to do a
  166. 6:36back test so let's go back to Jesse go
  167. 6:38to the back testing section the binance
  168. 6:40Perpetual Futures is fine let's choose
  169. 6:42the ichim cloud strategy the duration of
  170. 6:45since 2022 up until 2024 is fine for me
  171. 6:48because during that time we had one bare
  172. 6:51market and one kind of bull market so I
  173. 6:53finded a good period for this strategy
  174. 6:55the fast mode is on The Benchmark is
  175. 6:58also on all right so I'm going to start
  176. 7:00with the 15 minutes time frame let's
  177. 7:02start it and I want to also do another
  178. 7:05one with the 30
  179. 7:08minutes and another one with the 1 hour
  180. 7:12and another one with the 4
  181. 7:14hours now notice when I create a new tab
  182. 7:17using this button it will duplicate
  183. 7:19everything from the previous tab that's
  184. 7:21why I'm just changing the time frame all
  185. 7:23right so this is the results for the 15
  186. 7:25minutes this is for 30
  187. 7:28minutes the 1 hour and the 4 hours so so
  188. 7:32far the 1 hour looks the best now what's
  189. 7:35the P we have 8% profit with the max R
  190. 7:38ofus 38% so pretty horrible but that's
  191. 7:41fine because so far we just defined one
  192. 7:43inry condition which is never profitable
  193. 7:45because we always need at least a couple
  194. 7:47of Entry conditions for the strategy to
  195. 7:49be profitable so let's go back and
  196. 7:51Define a new property and I'm going to
  197. 7:54call it the big Trend and in it I'm
  198. 7:57going to first say C equals theal Cloud
  199. 8:00but this time instead of using the cion
  200. 8:02line and the Bas line I'm going to use
  201. 8:04the span a and span B which if you
  202. 8:05forgot it's this Cloud so this one is
  203. 8:07the span a and this one is the span B so
  204. 8:10if I want to say that when the cloud is
  205. 8:12green take a long position I'm going to
  206. 8:14say if the span a is bigger than span B
  207. 8:16then we are in uptrend all right so if C
  208. 8:20that span a is bigger than span B return
  209. 8:23one otherwise return minus one and I'm
  210. 8:26going to go here and add this condition
  211. 8:29so let's go back to Jesse now instead of
  212. 8:31going back and forth between four tabs
  213. 8:33to rerun this back test I want to use
  214. 8:35this new feature of Jesse which I just
  215. 8:37implemented and it may not even be out
  216. 8:39by the time you're watching this video
  217. 8:41which is this new page called Benchmark
  218. 8:43now you can see the metrics of all the
  219. 8:44other tabs that I had open but because
  220. 8:46it's on one page it's much easier to
  221. 8:48just compare the values Al together not
  222. 8:50only that now that I want to rerun the
  223. 8:52back tests instead of doing them
  224. 8:53individually I can just press this one
  225. 8:55button which will rerun all of them now
  226. 8:58here we can see the net Pro profit for
  227. 8:59all of them and it seems like the 1 hour
  228. 9:02is still the best the max Ron of the 1
  229. 9:04hour is still the lowest and if you want
  230. 9:07to go to the tab to look at the equity
  231. 9:09chart we can do that here all right so
  232. 9:11it looks like this indicator does have
  233. 9:13some potential but as it is expected
  234. 9:15with Trend following strategies it is
  235. 9:17getting slaughtered when it reaches a
  236. 9:18ranging market and to avoid the ranging
  237. 9:20Market I'm going to use the adx
  238. 9:22indicator which I always used for this
  239. 9:24purpose so let's go back and Define a
  240. 9:27new property let's call it the adx and
  241. 9:29in it I'm going to say whether or not
  242. 9:31the adx of the current candles is bigger
  243. 9:34than 50 and now we should also add it to
  244. 9:36our inry
  245. 9:38rules so let's go back to Jesse and
  246. 9:40rerun the back test so while this is
  247. 9:42going I wanted to quickly remind you
  248. 9:44guys that we have a Discord Community
  249. 9:45with more than 3,000 quants such as you
  250. 9:48and I we hang out there share ideas and
  251. 9:50help each other out and I would love to
  252. 9:51see you guys there all right look at
  253. 9:53that the p&l which is be negative for
  254. 9:55most of them is now positive for 4 hours
  255. 9:59for 1 hour and the 30 minutes but it's
  256. 10:02still negative for 50 minutes time frame
  257. 10:04the P looks the best still on the 1 hour
  258. 10:07but if we consider the max done it
  259. 10:09actually looks best on the 30 minutes
  260. 10:11all right so let's look at the equity
  261. 10:13curve and here it is on the hourly here
  262. 10:17it is on the 30 minutes 15 minutes and
  263. 10:21on the 4 hours now I think we're going
  264. 10:23to go with either the 1 hour or 30
  265. 10:25minutes now this result is already good
  266. 10:27enough for me but I want to use this new
  267. 10:29indicator that I found in my previous
  268. 10:30video and I found it really helpful with
  269. 10:32this type of a strategies it's called
  270. 10:34the choppiness index so let's define a
  271. 10:35new property and call it chop and I'm
  272. 10:39going to say whether or not the Chop is
  273. 10:42below 50 for this current value now it
  274. 10:45works a bit similar to the adx but you
  275. 10:47have to remember that its values are
  276. 10:49kind of against the adx so what I mean
  277. 10:51by that is in adx we want the value to
  278. 10:53be above 50 which would show us that
  279. 10:55there is enough volatility in the market
  280. 10:57but with the choppiness index indicator
  281. 10:59we want to make sure that there is less
  282. 11:01choppiness in other words Randomness in
  283. 11:03the market which is useful to us because
  284. 11:05our job is to look for the patterns in
  285. 11:06the market right we don't want
  286. 11:08Randomness all right so let's also add
  287. 11:09this
  288. 11:13condition and rerun everything one more
  289. 11:15time all right look at this the panl
  290. 11:18actually increased for both the 30
  291. 11:21minutes and the 1 hour but that's not
  292. 11:23really important most important part is
  293. 11:25the max actually came down to - 6.3 and-
  294. 11:297.7 which is really amazing the sharp
  295. 11:31ratio is 1.2 for both of them the calmer
  296. 11:34ratio which is actually my favorite
  297. 11:36metric because it considers the max Ron
  298. 11:39is 2.9 for this one so it's
  299. 11:41significantly better than this one now
  300. 11:43let's look at the equity curve and it
  301. 11:46looks amazing but because the Maxon is
  302. 11:49really low in this case it's - 7 and my
  303. 11:52risk tolerance is usually up until minus
  304. 11:5430% that means I can easily add to the
  305. 11:56size of this position so that means I
  306. 11:58can even add the size of my positions up
  307. 12:01to four in here so I will simply add my
  308. 12:04available margin by four go back and
  309. 12:08rerun everything one more
  310. 12:10time and now the profit on the 1 hour is
  311. 12:15257 and on the 30 minutes it is 166% the
  312. 12:19max Dron is minus 23% for the 30 minutes
  313. 12:23and on 1 hour it is minus 27% and notice
  314. 12:26that these ratios don't really change
  315. 12:28because it's still considering the
  316. 12:31pnl comparing to the max rodon so that's
  317. 12:34why these two are still the same number
  318. 12:35all right so let's look at the equity
  319. 12:37curve and now it looks like this so
  320. 12:39during these two years which we didn't
  321. 12:41really have a great Market we could have
  322. 12:43made up to 20
  323. 12:4657% with this
  324. 12:49one the profit was a bit lower but the
  325. 12:52max ear dardon is still lower so that
  326. 12:54means I can even increase my position
  327. 12:56size in this one to get maybe even
  328. 12:58better results
  329. 12:59but as for the equity curve to be honest
  330. 13:02I'm not sure which one looks
  331. 13:04better because with this one we ended up
  332. 13:06with more profits but with this one it
  333. 13:09seems a bit more stable to me so I'm not
  334. 13:12really sure which one to use I'm going
  335. 13:14to leave that decision to you but what
  336. 13:15I'm sure is that the result of the 15
  337. 13:17minutes time frame is not good and
  338. 13:19neither it is with the 4 hours time
  339. 13:21frame it's it's taking just too few
  340. 13:24trades and I'm not happy with that I'm
  341. 13:26going to submit the source code of this
  342. 13:28strategy alongside with this back test
  343. 13:30result for different periods and other
  344. 13:32symbols such as ethereum on our strategy
  345. 13:34directory on our website and as always
  346. 13:36we're going to have a giveaway a random
  347. 13:38person who likes this video posts a
  348. 13:40comment and subscribes to the channel is
  349. 13:41going to win 1 million Buck token all
  350. 13:43right let's pick the winner for the
  351. 13:44previous
  352. 13:46video and the winner is just found your
  353. 13:49channel And subscribe pretty interesting
  354. 13:51stuff thank you so much for your comment
  355. 13:53please reach out to me so that I can
  356. 13:54send you your bnk tokens thanks for
  357. 13:56watching and I'll see you in the next
  358. 13:58one
  359. 13:59oh w w
  360. 14:03[Music]

About this transcript

This page contains the full transcript of Ichimoku Cloud Strategy in Python Makes 257% by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 2,767 words across 360 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.