Ichimoku Cloud Strategy in Python Makes 257% — Transcript
Full transcript
- 0:00hey guys it's all today I'm going to
- 0:02write a new strategy using the hu Cloud
- 0:04indicator next I'm going to use this new
- 0:06indicator that I found in my previous
- 0:08video to improve the results of this
- 0:10strategy drastically so let's get right
- 0:12into
- 0:14it let's open the aimu cloud on trading
- 0:18View and this is how it looks like on
- 0:21the 4 hours time frame now the lines
- 0:23that we care about are these two the
- 0:25blue and red one and this Cloud I find
- 0:27this green line here really useless so
- 0:30I'm going to disable this it's called
- 0:32the laging span which is basically the
- 0:34price with a bit of lag so let's remove
- 0:37that to take a long position in this
- 0:39strategy we need this blue line which is
- 0:41called the conversion line to go above
- 0:43the red line which is called The Base
- 0:46Line this will show us the shortterm
- 0:47trend of the market and then we also
- 0:49need the cloud to be green in other
- 0:51words we need the green line to be above
- 0:53the red line now these two are called
- 0:55span a and span B now you don't have to
- 0:57know about the names but we're going to
- 0:58use it in a second all right so let's go
- 1:00to Jesse and create a new strategy and
- 1:03name it Ichi moku Cloud let's copy this
- 1:07name and open it in my pie charm ID
- 1:09which is way smarter all right so first
- 1:11let's define a new property and I'm
- 1:13going to call it the small
- 1:15Trend in it I'm going to say C equals ta
- 1:20hm cloud and I'm going to pass the
- 1:24current candles and I won't even change
- 1:25the default parameters and I'm going to
- 1:28say if C dot conversion line which again
- 1:32is this blue line is above this red line
- 1:35which is called the Bas line so if this
- 1:37one is above the Baseline return one for
- 1:41an uptrend otherwise return minus one
- 1:44for a downtrend now our entry rule is
- 1:47going to be if the small Trend equals 1
- 1:51and for short entries we will do the
- 1:54opposite we'll say if the small Trend
- 1:56equals minus one all right so let's say
- 1:59this condition is true and we are about
- 2:01to open a long position what should be
- 2:02our position sizing and entry price I
- 2:05realize that often times when the entry
- 2:07rule for this strategy is true for
- 2:09example in here the cloud is green and
- 2:12at this point the conversion line again
- 2:14the blue line is above the Bas line
- 2:16which is this red one the price always
- 2:18goes down a bit not always but most
- 2:20times so because of that I decided not
- 2:23to open the position using a market
- 2:24order as I usually do instead I want to
- 2:26use a limit order so I don't want to buy
- 2:28here I want to buy a little bit below
- 2:30this price now how do we decide where
- 2:32exactly to buy now we could use some
- 2:34kind of line such as the conversion line
- 2:36in this case would be a good choice but
- 2:38I wanted to make it Dynamic and and
- 2:40usually my go-to indicator for setting a
- 2:43price dynamically which would work with
- 2:44any trading symbol is the ATR I often
- 2:47use it for stplus but in this case I
- 2:49also want to use it for entry so I want
- 2:51to say one ATR below this value so the
- 2:54entry is going to be the current price
- 2:57minus ta ATR R and then I'm going to
- 3:01pass the current candles and that's it
- 3:04so my sub is going to be as always the
- 3:07inry price minus the ATR multiplied by
- 3:11some kind of
- 3:12multiplier and I'm going to use 2.5 for
- 3:15this one and as for the quantity of this
- 3:16position I'm going to use the risk to
- 3:18quantity utility function of Jessi which
- 3:20would allow us to limit the risk of this
- 3:22position to a certain number and I
- 3:24usually use three so that means if this
- 3:26trade goes against us we won't lose more
- 3:28than 3% of our capital you could go with
- 3:30five if your risk appetite allows you
- 3:32but I'm going to stick with three so the
- 3:35quantity equals utils risk to quantity
- 3:39the first value is the capital and I'm
- 3:42going to pass the available margin the
- 3:44next one is the risk I'm going to pass
- 3:46three next we have the entry going to
- 3:49pass the entry then the Stop and I will
- 3:52also set the fee rate to the current fee
- 3:55of the exchange that I'm
- 3:57trading all right now we can pass the
- 4:00buy order which is going to be the
- 4:02quantity and then the entry price and as
- 4:05for the short position I'm going to do
- 4:08the opposite so that means the entry is
- 4:10going to be the current price plus 1 ATR
- 4:13the stop is going to be the entry plus 2
- 4:16times of the ATR and the quantity is
- 4:19similar and instead of a buy order we
- 4:22use a sell order now the value of the
- 4:24shot cancel entry usually we don't
- 4:26really care about it if we are entering
- 4:27with a market order but if you are using
- 4:29a limit order or a sub order to enter
- 4:31the position like we are in this case
- 4:33which we are using a limit order to
- 4:35enter at a lower price it has to be true
- 4:38all right so now it's time to submit the
- 4:39subplus order for that I'm going to say
- 4:41when a new position is opened on open
- 4:44position I'm going to say if it's a long
- 4:46position using the is long property my
- 4:50subplus is going to be the current
- 4:55positions quantity and the price of it
- 4:59is going to to be the entry price of my
- 5:02position which is this minus the current
- 5:06ATR multiplied by 2.5 which is exactly
- 5:09the value that we entered here but
- 5:11because this value was defined inside
- 5:12the go short method we don't have access
- 5:15to it here sure we could Define this
- 5:17inside some kind of variable that we
- 5:19could also use here but because it was
- 5:21really easy to reuse I'm just redoing
- 5:24the calculation next I'm going to say l
- 5:26if it is a short position I will do the
- 5:29same except instead of subtracting the
- 5:31ATR from the entry price at one position
- 5:34I will add to it all right so now we are
- 5:36entering trades we are also exiting
- 5:38using the suplus but we're not taking
- 5:40profits so for taking the profit instead
- 5:42of using a take profit order I wanted to
- 5:44write the trend for as long as possible
- 5:46so I'm going to say if my entry
- 5:48condition is no longer valid in other
- 5:50words if the conversion line goes below
- 5:52the Baseline like it happen here or in
- 5:55here I want to close the position so
- 5:57this will let us that if there is really
- 5:58a strong Trend in the the market we can
- 6:00write it for as long as possible so I'm
- 6:02going to
- 6:02say update position if it's long
- 6:06position I will say if the small
- 6:11trend is minus one which is the opposite
- 6:13of our entry then I'm going to use this
- 6:17shortcut in Jessi which is used for
- 6:18liquidating everything which is simply
- 6:21self.
- 6:23liquidate and next I want to do the
- 6:25opposite for a short position so now we
- 6:28have our in rules with doing the
- 6:29position sizing we're submitting the
- 6:32stop loss and we Define our take profit
- 6:34condition so now we're ready to do a
- 6:36back test so let's go back to Jesse go
- 6:38to the back testing section the binance
- 6:40Perpetual Futures is fine let's choose
- 6:42the ichim cloud strategy the duration of
- 6:45since 2022 up until 2024 is fine for me
- 6:48because during that time we had one bare
- 6:51market and one kind of bull market so I
- 6:53finded a good period for this strategy
- 6:55the fast mode is on The Benchmark is
- 6:58also on all right so I'm going to start
- 7:00with the 15 minutes time frame let's
- 7:02start it and I want to also do another
- 7:05one with the 30
- 7:08minutes and another one with the 1 hour
- 7:12and another one with the 4
- 7:14hours now notice when I create a new tab
- 7:17using this button it will duplicate
- 7:19everything from the previous tab that's
- 7:21why I'm just changing the time frame all
- 7:23right so this is the results for the 15
- 7:25minutes this is for 30
- 7:28minutes the 1 hour and the 4 hours so so
- 7:32far the 1 hour looks the best now what's
- 7:35the P we have 8% profit with the max R
- 7:38ofus 38% so pretty horrible but that's
- 7:41fine because so far we just defined one
- 7:43inry condition which is never profitable
- 7:45because we always need at least a couple
- 7:47of Entry conditions for the strategy to
- 7:49be profitable so let's go back and
- 7:51Define a new property and I'm going to
- 7:54call it the big Trend and in it I'm
- 7:57going to first say C equals theal Cloud
- 8:00but this time instead of using the cion
- 8:02line and the Bas line I'm going to use
- 8:04the span a and span B which if you
- 8:05forgot it's this Cloud so this one is
- 8:07the span a and this one is the span B so
- 8:10if I want to say that when the cloud is
- 8:12green take a long position I'm going to
- 8:14say if the span a is bigger than span B
- 8:16then we are in uptrend all right so if C
- 8:20that span a is bigger than span B return
- 8:23one otherwise return minus one and I'm
- 8:26going to go here and add this condition
- 8:29so let's go back to Jesse now instead of
- 8:31going back and forth between four tabs
- 8:33to rerun this back test I want to use
- 8:35this new feature of Jesse which I just
- 8:37implemented and it may not even be out
- 8:39by the time you're watching this video
- 8:41which is this new page called Benchmark
- 8:43now you can see the metrics of all the
- 8:44other tabs that I had open but because
- 8:46it's on one page it's much easier to
- 8:48just compare the values Al together not
- 8:50only that now that I want to rerun the
- 8:52back tests instead of doing them
- 8:53individually I can just press this one
- 8:55button which will rerun all of them now
- 8:58here we can see the net Pro profit for
- 8:59all of them and it seems like the 1 hour
- 9:02is still the best the max Ron of the 1
- 9:04hour is still the lowest and if you want
- 9:07to go to the tab to look at the equity
- 9:09chart we can do that here all right so
- 9:11it looks like this indicator does have
- 9:13some potential but as it is expected
- 9:15with Trend following strategies it is
- 9:17getting slaughtered when it reaches a
- 9:18ranging market and to avoid the ranging
- 9:20Market I'm going to use the adx
- 9:22indicator which I always used for this
- 9:24purpose so let's go back and Define a
- 9:27new property let's call it the adx and
- 9:29in it I'm going to say whether or not
- 9:31the adx of the current candles is bigger
- 9:34than 50 and now we should also add it to
- 9:36our inry
- 9:38rules so let's go back to Jesse and
- 9:40rerun the back test so while this is
- 9:42going I wanted to quickly remind you
- 9:44guys that we have a Discord Community
- 9:45with more than 3,000 quants such as you
- 9:48and I we hang out there share ideas and
- 9:50help each other out and I would love to
- 9:51see you guys there all right look at
- 9:53that the p&l which is be negative for
- 9:55most of them is now positive for 4 hours
- 9:59for 1 hour and the 30 minutes but it's
- 10:02still negative for 50 minutes time frame
- 10:04the P looks the best still on the 1 hour
- 10:07but if we consider the max done it
- 10:09actually looks best on the 30 minutes
- 10:11all right so let's look at the equity
- 10:13curve and here it is on the hourly here
- 10:17it is on the 30 minutes 15 minutes and
- 10:21on the 4 hours now I think we're going
- 10:23to go with either the 1 hour or 30
- 10:25minutes now this result is already good
- 10:27enough for me but I want to use this new
- 10:29indicator that I found in my previous
- 10:30video and I found it really helpful with
- 10:32this type of a strategies it's called
- 10:34the choppiness index so let's define a
- 10:35new property and call it chop and I'm
- 10:39going to say whether or not the Chop is
- 10:42below 50 for this current value now it
- 10:45works a bit similar to the adx but you
- 10:47have to remember that its values are
- 10:49kind of against the adx so what I mean
- 10:51by that is in adx we want the value to
- 10:53be above 50 which would show us that
- 10:55there is enough volatility in the market
- 10:57but with the choppiness index indicator
- 10:59we want to make sure that there is less
- 11:01choppiness in other words Randomness in
- 11:03the market which is useful to us because
- 11:05our job is to look for the patterns in
- 11:06the market right we don't want
- 11:08Randomness all right so let's also add
- 11:09this
- 11:13condition and rerun everything one more
- 11:15time all right look at this the panl
- 11:18actually increased for both the 30
- 11:21minutes and the 1 hour but that's not
- 11:23really important most important part is
- 11:25the max actually came down to - 6.3 and-
- 11:297.7 which is really amazing the sharp
- 11:31ratio is 1.2 for both of them the calmer
- 11:34ratio which is actually my favorite
- 11:36metric because it considers the max Ron
- 11:39is 2.9 for this one so it's
- 11:41significantly better than this one now
- 11:43let's look at the equity curve and it
- 11:46looks amazing but because the Maxon is
- 11:49really low in this case it's - 7 and my
- 11:52risk tolerance is usually up until minus
- 11:5430% that means I can easily add to the
- 11:56size of this position so that means I
- 11:58can even add the size of my positions up
- 12:01to four in here so I will simply add my
- 12:04available margin by four go back and
- 12:08rerun everything one more
- 12:10time and now the profit on the 1 hour is
- 12:15257 and on the 30 minutes it is 166% the
- 12:19max Dron is minus 23% for the 30 minutes
- 12:23and on 1 hour it is minus 27% and notice
- 12:26that these ratios don't really change
- 12:28because it's still considering the
- 12:31pnl comparing to the max rodon so that's
- 12:34why these two are still the same number
- 12:35all right so let's look at the equity
- 12:37curve and now it looks like this so
- 12:39during these two years which we didn't
- 12:41really have a great Market we could have
- 12:43made up to 20
- 12:4657% with this
- 12:49one the profit was a bit lower but the
- 12:52max ear dardon is still lower so that
- 12:54means I can even increase my position
- 12:56size in this one to get maybe even
- 12:58better results
- 12:59but as for the equity curve to be honest
- 13:02I'm not sure which one looks
- 13:04better because with this one we ended up
- 13:06with more profits but with this one it
- 13:09seems a bit more stable to me so I'm not
- 13:12really sure which one to use I'm going
- 13:14to leave that decision to you but what
- 13:15I'm sure is that the result of the 15
- 13:17minutes time frame is not good and
- 13:19neither it is with the 4 hours time
- 13:21frame it's it's taking just too few
- 13:24trades and I'm not happy with that I'm
- 13:26going to submit the source code of this
- 13:28strategy alongside with this back test
- 13:30result for different periods and other
- 13:32symbols such as ethereum on our strategy
- 13:34directory on our website and as always
- 13:36we're going to have a giveaway a random
- 13:38person who likes this video posts a
- 13:40comment and subscribes to the channel is
- 13:41going to win 1 million Buck token all
- 13:43right let's pick the winner for the
- 13:44previous
- 13:46video and the winner is just found your
- 13:49channel And subscribe pretty interesting
- 13:51stuff thank you so much for your comment
- 13:53please reach out to me so that I can
- 13:54send you your bnk tokens thanks for
- 13:56watching and I'll see you in the next
- 13:58one
- 13:59oh w w
- 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.