Cloud Scalping Strategy in Python Makes 223% — Transcript
Full transcript
- 0:00hey guys so in this video I'm going to
- 0:02disclose one of my best personal
- 0:04scalping strategies not only it produces
- 0:06decent results but the good news is that
- 0:09I've done zero optimization on it that
- 0:11means it has a very low chance of being
- 0:13overfit and I really like that and it
- 0:15even gives me confidence to add the size
- 0:17of the position before adding leverage
- 0:18to it it has a max throw down of minus
- 0:216% over the last year which is
- 0:23absolutely amazing so anyways let's get
- 0:25right into
- 0:26it the main indicator of this strategy
- 0:29is the M Cloud so let's add it to our
- 0:33chart all right this green line here is
- 0:36pretty much useless so I'm going to
- 0:37remove that all right the in rule of the
- 0:41strategy is very simple we want to go
- 0:43long when the trend here is bullish now
- 0:45what do I mean by that I need the
- 0:47conversion line which is this blue line
- 0:49here to be above the base line which is
- 0:51this red line right and you can see an
- 0:53example of that happening in here
- 0:54however we don't go long just yet we
- 0:57need confirmation and for that we wait
- 0:59until till the cloud itself which is
- 1:01made of two lines a span a and a span B
- 1:04right we need this also to show us an
- 1:06uptrend and that didn't happen until
- 1:09here so this would have been where we
- 1:11would have gone long in this strategy
- 1:13now in this example you might be
- 1:15thinking oh wouldn't have been better if
- 1:16you went long here well yeah it would
- 1:18have but this is an easy example trust
- 1:20me there's going to be lots of
- 1:21situations where there would have been a
- 1:23false breakout but because we have
- 1:25confirmation we wouldn't have fall into
- 1:27those traps and for a short position we
- 1:29would just do the opposite all right so
- 1:31let's go to Jesse and create a new
- 1:33strategy I'm going to name it Cloud
- 1:36scalper next I'm going to open my vs
- 1:38code editor which is way smarter than J
- 1:41built-in editor and I'm going to look
- 1:43for it Cloud scalper now first I'm going
- 1:46to define a new
- 1:48property and I'm going to call it Trend
- 1:51now in it I'm going to define the ichim
- 1:53cloud and we can do that simply by
- 1:55saying Cals
- 1:58ta. h
- 2:00cloud and I'm just going to pass the
- 2:03current
- 2:04candles and even though we can pass some
- 2:07parameters I'm not going to do that
- 2:09because I want to make sure that the
- 2:10strategy is as simple as possible to
- 2:13lower the chance of overfitting the
- 2:14strategy all right when would it be an
- 2:17uptrend I'm going to say if C Dot and as
- 2:20I mentioned on the chart I want to make
- 2:22sure the conversion line is above the
- 2:25Baseline right but I also want to make
- 2:28sure that the span a is above the span B
- 2:31again as I described it here so this is
- 2:33the conversion Line This Is The Base
- 2:34Line This is span a and this is span B
- 2:37all right if this is the case I want to
- 2:39return one if it's the other way around
- 2:42I want to return minus one and if it's
- 2:44neither I want to Simply return zero all
- 2:47right for the entry rule I want to
- 2:49Simply say if the current Trend equals 1
- 2:52for my short entry I want to say the
- 2:53opposite so return true if the current
- 2:56Trend equals minus one let's also remove
- 2:59this commment code and also this one
- 3:02let's say the entry rule is met and I
- 3:04want to enter a position the entry price
- 3:06is going to be the current price because
- 3:08I want to open the position using a
- 3:10market order and as for the quantity of
- 3:12the order or my position I want to risk
- 3:143% of my total capital and we can
- 3:16calculate that very easily using Jesse's
- 3:19risk to quantity utility function the
- 3:21first thing that it needs is the current
- 3:23capital and I'm going to pass the
- 3:26current available margin the second is
- 3:28the risk per capital and I'm going to
- 3:30pass 3% and next we have the entry price
- 3:33so I'm going to pass entry and then we
- 3:35need the stop loss now I forgot to do
- 3:37that so let's do that here now for the
- 3:39Stop Plus I want it to be the entry
- 3:42price minus the ATR indicator which I
- 3:45can get by saying ta. ATR and then
- 3:48simply passing the current candles and
- 3:50again I'm not going to change the
- 3:52parameters and I want to multiply that
- 3:54by 2.5 because I don't want the stop to
- 3:57be very close to the entry price because
- 3:59then you're going to miss out on so many
- 4:01good opportunities right so now that we
- 4:03have the stop I can pass it here and
- 4:05next we have the Precision which I'm not
- 4:07going to touch here but for the fee rate
- 4:10I'm going to pass the fee rate of the
- 4:13current exchange that I'm trading all
- 4:14right now that we have both the price
- 4:16and the quantity I can simply say self
- 4:18buy equals quantity and then the entry
- 4:21price as my go short method I'm going to
- 4:23do the opposite so again using the entry
- 4:25price the stop is now entry plus 2.5
- 4:28times of the current at R because it's
- 4:30for a short position and then for the
- 4:32quantity I did exactly the same however
- 4:34instead of calling The self. Bu to
- 4:36submit the order I'm using self. self
- 4:38right now what about taking profit for
- 4:40that I'm going to use the on open
- 4:42position method which will be executed
- 4:45as soon as the position is open and in
- 4:47it I'm going to say this if is for a
- 4:50long position which we can get by saying
- 4:53if self do is long in it I'm going to
- 4:55say this self. takeprofit equals now
- 4:59this this is again an order so we need
- 5:01both the quantity and the price as for
- 5:03the quantity I'm going to say the
- 5:05current position it's
- 5:08quantity and then as the price I'm going
- 5:10to say this the current price whatever
- 5:13it may be
- 5:15minus the current
- 5:18ATR again I passed the candles
- 5:21multiplied by 3.2 now notice that our
- 5:25profit margin is being a little bit more
- 5:27than our risk which means we're going to
- 5:29make more money on our winning trades
- 5:31than we would be losing on our losing
- 5:33trades now this was the takeprofit but
- 5:35what about the Stop Plus because yes I
- 5:37esfi the stop price here because I
- 5:39needed to use it here but I didn't
- 5:42submit the stop loss order ever and I
- 5:44could have done that here by the way in
- 5:46Jesse you can submit both the stop loss
- 5:48and the take profit right inside your go
- 5:50long or go short position but the
- 5:52problem is that you can only do that for
- 5:54futur trading not for stop trading so as
- 5:56a result I've learned to always do it
- 5:58inside my own open position Method All
- 6:01right so next I'm going to say self
- 6:03suplus equals the quantity of the
- 6:05current position and the price is going
- 6:07to be the current price minus 2.5 * the
- 6:10current ATR and next I'm going to say if
- 6:13it's a short position I simply want to
- 6:15do the opposite now we have both the
- 6:16inter Rule and the exit rule of the
- 6:18strategy and also the position sizing so
- 6:21now we can start the first back so let's
- 6:23go back to Jesse and open the back
- 6:25testing section and I'm going to choose
- 6:27cloud
- 6:31scaler and I'm picking the 15 minutes
- 6:33time frame BTC UCT on binance Perpetual
- 6:37Futures and the duration is since the
- 6:39beginning of
- 6:402024 up until yesterday I've turned on
- 6:44the fast mode and also the
- 6:49Benchmark now it didn't execute any back
- 6:52test so let's check out our in rule
- 6:54right here's the issue in here I said
- 6:56when the span a is bigger than span a it
- 6:58should have been
- 7:03B all right let's go back and rerun it
- 7:05one more time and there we go this chart
- 7:08doesn't seem normal it seems like it's
- 7:10not actually closing the position so
- 7:12let's go back to the code and check our
- 7:14exit rules so okay so you see the take
- 7:17profit for a long position it should
- 7:19have been plus the current ATR and for a
- 7:23short position it should have been minus
- 7:26all right so let's go back and re it one
- 7:28more time
- 7:30all right so there we go now this is
- 7:32natural you see we're not doing well
- 7:34against the market and the reason is
- 7:35we're taking too many trades you see we
- 7:37traded more than 1,000 times and we paid
- 7:40more than $6,000 in trading fees and of
- 7:42course all the numbers don't look good
- 7:44however I didn't expect to be profitable
- 7:47just yet because you can never find a
- 7:48good strategy by using simply one
- 7:51indicator all right let's go back to the
- 7:52Chart now the first thing that I like to
- 7:54use with this type of strategies is the
- 7:57adex indicator so let's add it to our
- 7:59chart all right so you see this is the
- 8:00adx and the way the adx works is that
- 8:03when its value is going up it means that
- 8:05the trend in Market is getting stronger
- 8:08and when it's slow it means we are more
- 8:10likely in a ranging market so I want to
- 8:12set a threshold at 50 and I only want to
- 8:15take trades when the adx is above this
- 8:17threshold so let's go back to the code
- 8:19and I'm going to define a new property
- 8:22and I'm going to call it adx and in it I
- 8:25will say this return true if ta. a adx
- 8:30and then I will pass the current candles
- 8:32I want its value to be above
- 8:3450 that's it and then I will go back to
- 8:38the shoot long method and I will simply
- 8:40say and self. adx and I will do that
- 8:44also for my short position so let's go
- 8:46back to Jesse and rerun the backest one
- 8:48more
- 8:49time there we go so you see it's not
- 8:52doing as bad as before because the
- 8:54number of Trades instead of being more
- 8:56than 1,000 it is now 129 which is is
- 8:59still too high by the way but anyways
- 9:01the max zon is minus 22 which is really
- 9:04good even at this point all right now I
- 9:06also want to do something else just to
- 9:08make sure that we are trading with the
- 9:10best time frame let's also add another
- 9:12back test for the time frame of 30
- 9:14minutes and another one for the
- 9:17hourly and just so we can see the
- 9:20results very quickly oh by the way in
- 9:22this one we're actually making some
- 9:24profit not bad and with this one we're
- 9:29do doing even better all right so let's
- 9:31open The Benchmark so we can see all the
- 9:33results simultaneously now the hourly
- 9:36let's add the time frame to this table
- 9:39right so the hourly is actually already
- 9:42doing great its Max R is minus 8.5 so I
- 9:46really like this so I'm just going to
- 9:49make a copy of this the results of the
- 9:52hourly time frame already look really
- 9:55great so even though I want to continue
- 9:58I'm going to do one thing I'm going to
- 10:00copy the code and in Jesse I will create
- 10:03a new strategy and I will call it
- 10:08Cloud
- 10:10scalper 1
- 10:13hour
- 10:17hourly and I will just paste it here all
- 10:20right let's go back to the chart and add
- 10:22the next indicator that I'm going to use
- 10:24which is BPW or a Ballinger band width
- 10:28I'm going to pick this one
- 10:30you see the value of the BBW it goes up
- 10:33when the fluctuation in the price is
- 10:35also high and then it comes down when we
- 10:37are again in a Range market now even
- 10:40though this is a turn following a
- 10:41strategy I don't want to take a long
- 10:43position when the price has already gone
- 10:45up very fast very quickly so I don't
- 10:47want its value to be more than five in
- 10:50these examples that you can see on the
- 10:52chart the value for it is actually below
- 10:55five so we would still take these trades
- 10:57but recently I found that when I add
- 11:00this very simple filter it improves my
- 11:02results so I'm going to back to the code
- 11:05and add another filter and I'm going to
- 11:08say
- 11:09property and then BBW and in it I will
- 11:13say return true when the current BBW is
- 11:16more than 5% now I'm going to make this
- 11:18into five and then just to make sure
- 11:21this value is between 0 and 100 I will
- 11:23multiply it by 100 to get the same
- 11:26result that I would on trading view next
- 11:28I will go to my entry Rule and simply
- 11:31add this and also here so let's go back
- 11:34to
- 11:35Jesse Let's Open The Benchmark page and
- 11:38rerun all the
- 11:42values all right we're getting an error
- 11:45it is saying that BBW doesn't
- 11:48exist okay let's
- 11:52see BBW okay it is called Ballinger
- 11:56bands with
- 11:59let's go back to the benchmarking page
- 12:02and rerun everything now while that is
- 12:04going I want to show you guys my
- 12:05favorite Dex called Apex which has
- 12:08instant order execution zero trading gas
- 12:10fees and very low trading fees the
- 12:12liquidity is also fine and most
- 12:14importantly because it is a de you don't
- 12:16need kyc or register or anything you
- 12:18just simply connect your metamask wallet
- 12:20and you start trading if you're going to
- 12:22sign up please consider using our link
- 12:24which will give you 5% trading fee
- 12:26discounts and and most importantly it
- 12:28will support me and my videos which I
- 12:30would really appreciate all right things
- 12:31got a little bit in the 50 minutes but
- 12:33not so much in the 30 and the hourly all
- 12:36right next I want to use a very simple
- 12:38indicator the EMA which I'm sure all of
- 12:41you guys already know so let's open it
- 12:43the moving average
- 12:45exponential let's remove this one and
- 12:49also hide the HMO
- 12:51cloud and I'm going to change its period
- 12:55to from the default which is 9 to 200
- 13:00however I won't simply use it like this
- 13:03trading the current time frame I wanted
- 13:05to trade the anchor time frame which if
- 13:08I want to do it on trading view I should
- 13:10go to the settings and here we can
- 13:12change the time frame from the chart to
- 13:14something else and I want it to be 4
- 13:17hours so you see now this line will move
- 13:19very slowly so it won't just jump on a
- 13:22trade as soon as the price moves towards
- 13:24a certain direction so let's go back to
- 13:26Jesse so first I want to define a new
- 13:28proper property so I will say
- 13:31property def big candles we could also
- 13:36call it anchor candles doesn't really
- 13:38matter and in it I will say return self
- 13:43getet candles the first parameter is the
- 13:46current exchange next it is the current
- 13:50symbol and as for the time frame I will
- 13:52pass 4 hours now I can Define the EMA I
- 13:57that I needed so I'm going to say
- 14:01longterm
- 14:05Trend and no it is not using that I'm
- 14:08going to say return one if T EMA and
- 14:13instead of passing the current Candles
- 14:15now I will pass the big
- 14:17candles and as for its period I will set
- 14:20number
- 14:22200 so actually I want to say if the
- 14:26current price is above the current EMA
- 14:31return
- 14:31one else return minus one for a
- 14:34downtrend all right so now I can go back
- 14:37to my inter Rule and add it here and one
- 14:41more time for the short position now
- 14:43let's go back to
- 14:45Jesse the benchmarking page and rerun
- 14:48everything one more
- 14:51time all right so the result doesn't
- 14:54look good but I actually went back and
- 14:58realized that I made another mistake in
- 15:00the source code so you see in here I
- 15:02wanted the BBW to be below five not more
- 15:05than that so let's go back and rerun
- 15:08everything one more time all right so
- 15:12the hourly looks incredibly good
- 15:15although the sharp isn't as high as the
- 15:1615 minutes so you
- 15:19see so on the 15 minutes time frame this
- 15:23looks
- 15:24fantastic this p&l is good the max R
- 15:27down ofus 6% is is absolutely amazing
- 15:30the win rate is at
- 15:3260% the sharp ratio is two the calmer
- 15:35ratio is five so this looks very
- 15:38promising and good all right now you
- 15:40might be asking yourself okay you say
- 15:42this is good but we're not even beating
- 15:44the market well here's the thing yes we
- 15:47didn't make as much as the market but
- 15:49the max thrown of our Equity curve is
- 15:52extremely low which means this allows me
- 15:55to add to the size of my position
- 15:57without worrying and that is why the
- 15:59sharp ratio and the calar ratio are so
- 16:01good even though we haven't beaten the
- 16:03market so let's go back to the source
- 16:05code and go to the goong method now if I
- 16:10simply multiply my quantity by a number
- 16:13such as let's say
- 16:18three actually let's do
- 16:23four and rerun everything just one last
- 16:28time
- 16:30all right so let's go back to the equity
- 16:32curve you see now we are indeed beating
- 16:36the market and yet my Max thrw down is
- 16:39minus 23% so and this isn't even the
- 16:42maximum risk that I'm willing to take up
- 16:44until minus 30% is perfectly fine for me
- 16:47so I can even go back and multiply this
- 16:49by let's say
- 16:55five and run it again
- 16:59all right so now with a Max Ron of minus
- 17:0328% which is still fine we are
- 17:06definitely beating the market if we made
- 17:09223% profit in almost one year the max
- 17:13starton is
- 17:16awesome the expectancy is
- 17:182.5% the win rate of course is the same
- 17:22and so are the sharp and the calmer they
- 17:24are a slightly changed but it doesn't
- 17:25really matter now the Third minutes also
- 17:29looks good but not as good as the 15
- 17:32minutes so I think it's fine to retire
- 17:35this one the hourly doesn't look bad but
- 17:38I don't think it looks as good as the
- 17:39one that we had before so let's also try
- 17:43back testing this one using Cloud
- 17:46scalper hourly the one that I created
- 17:48earlier so let's also backest this one
- 17:53so this does look good but the max is
- 17:55too low so to get better p&l I can also
- 17:58multiply this by numbers such as three
- 18:01at least so let's go and find the cloud
- 18:06scale per
- 18:09hourly let's find the quantity and
- 18:12multiply this by
- 18:18three let's rerun
- 18:20it okay this does look better but the
- 18:23max return is at minus
- 18:2524% not as big as this let's go to The
- 18:29Benchmark so you see if instead of
- 18:31looking at the p&l we look at the sharp
- 18:33ratio or even the calmer ratio we can
- 18:35clearly see which one is the winner the
- 18:3715 minutes is the winner because it has
- 18:39the highest sharp ratio and the calel
- 18:41ratio even though the hourly still looks
- 18:44pretty fine to me I'm going to leave it
- 18:46at here because the strategy is
- 18:48performing extremely well without me
- 18:50even optimizing it in any way which is
- 18:52great because it lowers the chance of
- 18:53the strategy getting overfit I'm going
- 18:55to submit this strategy to our
- 18:57strategies index page so you you guys
- 18:59can see the results for other time
- 19:00frames or time periods in time I will
- 19:02also try my best to create a premium
- 19:04version of this strategy and also submit
- 19:06it to our strategies now before I leave
- 19:08we're going to have a giveaway a random
- 19:10person who likes this video posts a
- 19:11comment and subscribes to the channel is
- 19:13going to win 1 million Bank token right
- 19:16let's pick the winner for the previous
- 19:17video and the winner is wow I'm blown
- 19:20away this is your best video ever I'd
- 19:22love to followup video thank you thank
- 19:24you so much for your positive comment
- 19:25please reach out to me so that I can
- 19:27send you your bnk tokens thanks for
- 19:28watching I'll see you in the next one
- 19:36[Music]
- 19:37[Applause]
- 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.