Skip to playerSkip to main content
  • 1 day ago
Transcript
00:00Most traders chase complicated setups, hoping that the more complex the strategy, the higher the risk.
00:05But what if I told you that's really not the case, right? In this case, I'm going to be talking about one second.
00:10Recently, Mr. Mahesh Chandra Kaushik, one of the most followed financial educators on YouTube.
00:15And one of my personal favorites released a video introducing a new swing training strategy.
00:20Now, if you know Mr. Mahesh Kaushik's style, you'll know that he often blends simplicity.
00:25With unique market insights.
00:27So is this strategy any good?
00:28Well, I decided to...
00:30I put the strategy to the test by putting it through my Python backtesting engine.
00:33I not only backtested the exact rules...
00:35...that Mr. Mahesh described, but I ran multiple variations of it, ranked them using the risk-adjusted performance matrices.
00:40And I also found the best setting that gave me the most risk-adjusted return for the money.
00:44And...
00:45In today's video, I'll share exactly what I found, the scenarios I tested, the matrices I used and which...
00:50...creation gave me the most risk-adjusted performance.
00:52So, let's get started.
00:53So, let's get started.
00:55If this is your first time here, welcome.
00:56My name is Vivek, and I'm a financially independent algo trader.
00:58This channel is all about building our community...
01:00...of algo traders.
01:01We discuss everything about algo trading using Python...
01:02...building and backtesting trading strategies, market updates, and much more.
01:05Please do visit our community website fabtrader.in.
01:07Also, do check out my other YouTube channel, Fab Wealth, where I talk about my...
01:10...own financial independence journey and shared tools, methods, and strategies...
01:12...that helped me achieve my financial freedom.
01:15First of my thanks and gratitude to Mr. Mahesh...
01:20...and Rakaushik for providing this strategy.
01:22So, full credits to him for this idea.
01:24And I thoroughly...
01:25...enjoyed backtesting this, and I'm sure you'll also like it when you see the final outcome.
01:29So, I strongly urge you...
01:30...to visit his channel and watch his original video...
01:32...and like and subscribe if you already haven't done that.
01:35All right.
01:36His strategy is called the gap up strategy.
01:38But before we dive into the results...
01:40...let's step back and talk about the psychology behind this strategy...
01:43...and the exact edge it basically has.
01:45...that it's trying to exploit in the market right.
01:47At its core, the strategy is built on gap psychology.
01:50Think about it.
01:51When a stock gaps up more than 3% at the open...
01:53...it signals a very strong overnight...
01:55...demand, correct?
01:56Maybe it could be due to a positive news...
01:58...institutional buying or some momentums below...
02:00...from the global markets.
02:01If the stock not only gaps up, but also closes higher than its...
02:05...opened, it confirms that the buying pressure wasn't just one-off at the open...
02:08...it's sustained throughout the day, correct?
02:10So the strategy's real psychological edge is exploiting this post-cap follow-up through, right?
02:15So in short, the strategy isn't about just quick percentages...
02:17...it's about systematically capturing the continuation of a gap up...
02:20...while controlling the risk with predefined exits.
02:23If this is all confusing a little bit...
02:25...don't worry, when we discuss about the actual entry and exit rules...
02:27...things will become much clearer to you.
02:29Let's now...
02:30...talk about the entry rules and the capital allocation rules.
02:32So...
02:33...every day at 3pm, right?
02:35...we start scanning the 50-100 stocks, right?
02:37So the rule number one, as we discussed, is out of the 100 stocks...
02:40...if a stock opened that particular day with a gap up of a minimum of 3.14...
02:45...or more, we basically select those stocks.
02:49As a market...
02:50...is coming to a close, right?
02:51...on that particular day.
02:52The second rule is that the stock's price...
02:55...is higher than what it opened.
02:57That means that we have got to have a green candle...
03:00...for that particular stock for that day.
03:02If these two conditions are met...
03:04...we go ahead and...
03:05...buy that stock at around 3pm.
03:07The capital management rules are equally simple.
03:09We start with 4 lakh...
03:10...as an overall capital.
03:11We allocate Rs. 10,000 for every trade...
03:14...and then for the back...
03:15...for backtesting purposes...
03:16...I've considered the brokerage cost...
03:17...to be around Rs. 40...
03:18...per trade, right?
03:19Round trip...
03:20...to buy and sell together, right?
03:21So to recap on the entry rules one more time...
03:23...we look at the Nifty 100 universe...
03:25...and the rule number one is at 3pm...
03:27...before the market closes...
03:28...we scan the 100 stocks...
03:29...and find the ones that...
03:30...opened on that particular day...
03:31...with a gap of at least...
03:32...3.14%
03:33...right?
03:34And out of the stocks that have opened...
03:35...gap up...
03:36...we move to rule number 2...
03:37...where...
03:38...we see that the current price...
03:40...of that particular stock...
03:41...is still higher than the open price...
03:42...which means that...
03:43...there is a green candle...
03:44...for that particular day.
03:45If these two conditions are met...
03:46...we go ahead and buy that particular stock...
03:48...at the end of the day.
03:50...and now for the exit rules...
03:52...sell when the stock hits a profit target...
03:53...of either...
03:54...3.1...
03:55...or 6.28...
03:56...Mr. Mahesh is giving two options...
03:58...his preference is 6.28...
04:00...but people who want to churn...
04:01...their trades much faster...
04:02...they can also opt for 3.14...
04:04...and if you're wondering...
04:05...why this 3.14...
04:06...and 6.28...
04:07...his philosophy is that...
04:09...you know the pi...
04:10...the mathematical symbol pi...
04:11...is 3.14...
04:12...so the target is either pi...
04:13...or 2 pi...
04:14...and in case you have more...
04:15...than one open position...
04:16...for the same stock...
04:17...because that could happen...
04:18...because as per the entry rule...
04:19...the same stock could come...
04:20...back up again...
04:21...you know satisfy the same condition...
04:22...if it had again...
04:23...an another gap up...
04:24...and then you could buy...
04:25...the same stock one more time...
04:26...so like that...
04:27...you can have multiple positions...
04:28...for the same stock...
04:29...open at the same time...
04:30...if that is the case...
04:31...the profit target...
04:32...is always based on...
04:33...the average buy price...
04:34...one of our subscriber...
04:35...you know...
04:36...sent me a message...
04:37...saying that when you're...
04:38...trying to explain the rules...
04:39...can you explain it on a chart...
04:40...as well once...
04:41...so that...
04:40...for beginners...
04:41...it's a lot easier to...
04:42...you know...
04:43...kind of comprehend...
04:44...so the same rules...
04:45...I'm gonna explain to you...
04:46...with an example here...
04:45...this is Indigo...
04:46...right...
04:47...and then the...
04:48...the date is...
04:49...the 12th of May...
04:50...2025...
04:50...and this is one of the stocks...
04:51...that came into the scanner...
04:52...and we bought...
04:53...and sold...
04:54...as part of the rules...
04:55...and then...
04:55...you can clearly see...
04:56...that the previous day...
04:57...the price was here...
04:58...and then there was...
04:59...a sudden gap up here...
05:00...right...
05:01...so if you really...
05:00...want to see...
05:01...how much of the gap it was...
05:02...you know...
05:03...we would start measuring...
05:04...from the yesterday's...
05:05...the previous day's close...
05:05...and then to today's open...
05:06...right...
05:07...close to about 6%...
05:08...so 3.14% is...
05:09...is gap up...
05:10...so this...
05:11...this particular stock...
05:12...basically qualifies for that...
05:13...so at the end of the day...
05:14...or around...
05:15...after 3pm...
05:16...you know...
05:17...we enter the trade...
05:18...so this is where we enter...
05:19...right...
05:20...and this is the price...
05:21...we enter at...
05:20...and then you can clearly see...
05:22...that we hit the target...
05:23...of about 6.28...
05:24...on the...
05:25...27th of...
05:26...June...
05:27...so we enter the trade...
05:28...on 12th of May...
05:29...and then we hit the target...
05:30...of about 6.24...
05:32...on...
05:33...27th of June...
05:34...and this is how...
05:35...the trade is taken...
05:35...so that's just an example...
05:36...of how this works...
05:37...I have a general appeal...
05:38...to make...
05:39...close to 80% of the people...
05:40...who...
05:40...watch my videos...
05:41...don't seem to be subscribing...
05:42...as you're aware...
05:43...this community...
05:44...is just one person...
05:45...initiative...
05:45...indicated to help people...
05:46...on their fire...
05:47...and building journey...
05:48...running and maintaining...
05:49...this community...
05:50...takes time...
05:51...effort and risk...
05:50... refined doses...
05:50...from my side...
05:51one way...
05:53...you could support...
05:54...is by subscribing...
05:55...liking...
05:56...and sharing...
05:57...this content...
05:58...with your had...
05:59...for...
06:00...ASוכly...
06:01...as it's not...
06:02...is not...
06:03... transgender...
06:04just follow it. We try to do our own research on it and you know look at various variations and look
06:09at various scenarios and try and see if there is a better way of doing the same strategy.
06:12Is there a better version of that strategy that
06:14gives us a more risk you know adjusted return and that's what we're trying to do here. So what I've done is I've
06:19considered six such scenarios that I wanted to test. Scenario number one is the plain and simple scenario.
06:24That the actual strategy itself says the base strategy, which is we look for the 6.25 to 8.
06:29target and then multiple positions are allowed, right? Multiple positions are allowed meaning that
06:33if you have a stock.
06:34And then another time the same signal comes up with the same stock, you can still go ahead and buy it.
06:39The only way you would apply the target in that particular case is you take the
06:44average buy price of both and then your target should be 6.28% more than that, right? So that's the scenario.
07:00You
06:49The scenario number two is we'll fix the 6.28% asset target, but here we will limit only one position per stock, right?
06:54If you already have a stock that is currently in holding and a signal again comes up, you're not going to buy it, right?
06:58So you're going to
06:59avoid buying another one, right? That's what the scenario number two is. Scenario number three and four are very similar to one and two.
07:03Scenario number three and four are very similar to one and two.
07:04Except that the target is now only 3.14 which is 1pi, right? The scenario number one and two used a 2pi target.
07:09Here we're going to be using a 1pi. The advantage of using a 1pi is that you can quickly churn, right?
07:13You will get a target
07:14of about 3% easily, much easily than a 6.28%, right? So the idea is that again,
07:19the same variation, which is you tested with multiple positions open and with only one position per stock.
07:23Great.
07:24And finally, this is something that I wanted to check. What if we let the winner run, right?
07:27To a slightly higher...
07:29Because 8% sometimes we've seen it really doing well, right? So 5 and 6 is basically...
07:34moving our target up to 8% again with multiple positions and with only one position.
07:39So let's go ahead and test all these six scenarios and then see what happens and which one came up on the top.
07:44You might have seen this in my previous videos in terms of how we...
07:49compare these results and then find out which is better and what framework currently we use.
07:52This is a simple framework that I use that I basically...
07:54learned from a friend of mine. So we are...
07:56Although there are like thousands of, you know, indicators and...
07:59ratios for comparing and measuring strategy performances. I keep it simple. I only look at three aspects.
08:04which is returns, risk and probability, because sometimes the strategy will give very good returns, but you're taking probably too much...
08:09risk, right? So you need a mix of returns and risk. Sometimes the returns is good. The risk is also quite, you know...
08:14phenomenal. What happens is the strategy runs only... you get only one or two signals in a year which actually...
08:19absolutely makes no sense, right? Because then what happens is whatever backlisting you've done, if you're going to only trade one or...
08:24twice in a year, then the odds of something going wrong really, really goes up, right? Because it becomes a coin toss.
08:29at that point in time. So you need more trades so that your overall odds of, you know, strategy working in the longer term...
08:34becomes positive for you, right? So you need more trades for that probability to work. And that's where the probability comes. So we'll look at...
08:39all three, you know, aspects of it. And then the sweet spot that's between, right? The center spot here.
08:44where all three merges, that's the thing that we are going for, right? Our ranking sheet is based on this middle sweet spot.
08:49And, you know, when we look at the ranking sheet, it will make sense to you because we are specifically picking and choosing...
08:54the matrices for three areas and then coming up with a composite rank for all three and then finally choosing our win.
08:59So this is the Python implementation for the back testing.
09:04this is the framework that I'm talking about. So we tested all these scenarios using the code that you see here.
09:09So here's how the final results look like. And these are the six scenarios that we talked about.
09:14on this side. And then on the top, we are capturing the XIRR, the max drawdown, the win rate...
09:19the Sharpe ratio, the number of trades that we have taken, the probability aspect that I've talked about, and then the overall exposure that we are taking.
09:24right? In terms of the efficiency. So we are considering calmer ratio for this one, right? So...
09:29I ran all six scenarios for the same period, keeping all the other conditions the same.
09:34And then this is the results that I got. And then I've put XIRR in this case and not CAGR.
09:39It'll take a separate video to explain why and all that. I'm sure you're already aware of what the difference is.
09:44In short, the XIRR, the reason why we have considered XIRR for this one is because the cash flow has been very erratic.
09:49It's not a continuous flow of funds to it. And I'll explain to you when we look at the...
09:54The money, we are not investing in one shot, we are investing in...
09:59in parts over a period of time, right? Whenever you have a cash flow that's basically not very continuous...
10:04you know, then XIRR is what makes sense. CAGR makes sense when you have a lump sum.
10:07For example, if you put in all four lakhs...
10:09at one point in time, at one shot, and then you're measuring the...
10:11say, the performance after, say, three or four years, then the CAGR makes...
10:14a lot of sense. But in this case, XIRR makes the most sense, right?
10:17So, the scenario that...
10:19came up on the top was this one because the ranking is...
10:21the final performance ranked one is this one.
10:23And if you take a closer...
10:24to look at it, the XIRR returns for this one is...
10:26way above the rest of the ones, which is almost close to 70%.
10:29Right?
10:30And then we don't have the max drawdown because we are not closing anything...
10:32you know, we don't have a stop loss...
10:33we are not...
10:34closing anything in loss.
10:35So, that's why it is zero.
10:36The win rate is, of course, 100 because you're not closing anything...
10:39very naturally.
10:40The Sharpe ratio for this one is also the highest at around 5.23.
10:42So, you might ask what this...
10:44scenario is, the scenario number four is nothing but your target of 3.14, which is 1pi.
10:47Right?
10:48And then the second condition...
10:49here is only one open position of the stock is allowed.
10:51Right?
10:52You remember, you know, we looked at two scenarios.
10:53Right?
10:54One is 1pi.
10:54as target.
10:55And then two scenarios where the scenario...
10:56the first scenario is okay to take multiple positions...
10:59of the same stock.
11:00The second one is only one position per stock.
11:01Right?
11:02Until the target has hit, you don't take another position for that stock.
11:04And that's what this is about.
11:05Right?
11:06So, that is the scenario that basically came up on the top and came up as ranking number
11:09one.
11:09I've also captured some of the additional things like an average holding period, the
11:12net PNL and all that.
11:13So, the average...
11:14average holding period comes to about 22 days, which is actually not bad for a swing strategy.
11:17Right?
11:18So, everything basically...
11:19checks out.
11:20The only thing that I was keen on knowing is like, if we take the 3.14...
11:23Alright, I mean...
11:24you will have quickly, you know, trades churning.
11:26You would have your target being hit very quickly and all that.
11:29But with only one open position per stock, I was worried that we may not get enough trades.
11:33But if you really look at it...
11:34there's not a big difference here.
11:35255 versus like say 270 or 280, which is the average is around 255.
11:38You're getting enough trades...
11:39during that period.
11:40So, five year period, you had about 255 trades.
11:42By the way, if you're wondering how you can...
11:44run similar backtest on your own strategies, even if you have zero coding experience, I've
11:48built a complete core set...
11:49that teaches you exactly how to do it using Python and AI.
11:51It's completely beginner friendly and will help you not just to test...
11:54but also optimize and visualize your strategies just like the way I've done it here, right?
11:58So, please do...
11:59check out this course when you can.
12:01All right, let's quickly jump on to our strategy performance...
12:04dashboard.
12:05So, scenario number four, this is the winning scenario that we saw, right?
12:08Rank number one.
12:09And then what we see is the actual investment, which is the out-of-pocket cash that we've
12:13spent the peak amount of...
12:14investment that has gone out-of-pocket is around 1.5 lakhs only, right?
12:17Because given that the position size...
12:19there's only 10,000 rupees per trade, which is very less.
12:21And the overall number of trades has been only like 255 trades for the entire five...
12:24year period.
12:25Understandably, the investment amount has been very low.
12:28And 75k is the...
12:29across P&L and then 10k is brokerage.
12:31So, 65 is the net that we've got out of it.
12:34which is close to about 45%.
12:36The XIRR, we already saw, is close to about 70%.
12:39The CAGR, we need not pay too much attention to it because the nature of the strategy itself
12:43that CAGR doesn't really happen.
12:44The time in the market is only 12%.
12:46Understandably, you know, the number of trades have been very, very less in the past five...
12:49years.
12:50That's already reflected here.
12:51So, the interesting part is the equity curve...
12:54the white part that you see is the nifty returns during the same period.
12:57There is this orange part in the bottom, right?
12:59And this is...
12:59the strategy.
13:00So, clearly, you know, the strategy doesn't seem to, you know, be doing...
13:04that great compared to the nifty returns.
13:06And this is primarily because from a percentage of returns perspective...
13:09you know, this might give a wrong picture.
13:11If you really look at the XIRR perspective, you know, for the amount that you invest...
13:14at various points in time, the returns are pretty good.
13:16But if you really compare it, you know, on a wholesome level...
13:19in terms of the percentage of return terms with the nifty...
13:21the strategy hasn't done that well.
13:23Strategy...
13:24So, again, since we are not closing any positions and loss...
13:26there are no drawdowns...
13:27at least from a realized PNL perspective.
13:29There could be drawdowns in the unrealized PNL perspective...
13:31but that's something that, you know, is out of scope for this particular...
13:33backlist.
13:34Monthly returns and the yearly returns overall is what you see here.
13:39all typically less than around 5% per annum...
13:42this is what it's fetching because of the low number of...
13:44you know, the trades that we are currently taking.
13:46Let's look at the fund utilization.
13:48So...
13:49the white part is the fund, you know, that's going out of your pocket.
13:52This is the investment at various points...
13:54points in time.
13:55And then the brown part is the actual...
13:56you know, the portfolio of the growth, right?
13:58How much...
13:59your actual portfolio was growing side by side.
14:01You can clearly see that, you know, the level of investment has been pretty low.
14:04even after about, you know, a couple of years...
14:07it kind of stayed at that one point...
14:095 lakh mark, right?
14:10There's not a lot of opportunity for you to pump in a lot of money...
14:12you're compounding...
14:13because the number of trades being...
14:14taken is very, very low.
14:15And that's what this picture basically tells us.
14:17And what this is also telling us, you know...
14:19though, you know, the strategy says 4 lakhs and all that...
14:22we see that, you know, the amount is not getting utilized.
14:24Definitely not a good idea to keep all of that money in demand upfront.
14:27So whenever the strategy needs, it could be like...
14:29you know, invested.
14:30But otherwise, you know, keeping all that money aside for the strategy would be a waste of time.
14:34and waste of money as well.
14:35And this is the entire, you know, trade book available to you.
14:39So all the details that you just saw are all available in our community store.
14:42You can go ahead and take a look at it.
14:44So you'll basically get, you know, the Python backlisting code that we just saw.
14:47You can run as many iterations as you want.
14:49from it.
14:50And then the five-year backlist results, individual all trade books for all six scenarios are available there.
14:54The Stratranker, which is the ranking sheet, is available.
14:56You can take a look at it.
14:57There are more information.
14:58And then the...
14:59There's a detailed performance report of the Rank 1 scenario, which includes the equity curve drawdown, XIRR and all that.
15:04The ones that you saw as part of the dashboard, that detailed performance report is also available.
15:09And so go ahead and make full use of it.
15:10If you have any questions about this or have suggestions, please feel free to write to me.
15:14I'll be more than happy to include that in the next video.
15:17All right.
15:18Now...
15:19So the verdict, right?
15:20Is this strategy good, bad, ugly?
15:22You know, I'm going to leave that to you.
15:24Now...
15:25That's because now I want to hear from you.
15:26Which variation do you think that you would prefer?
15:28You know...
15:29The high wind rate, but the smaller profit or the fewer trades with the higher profit per trade.
15:32So comment below.
15:33And...
15:34You know, let's discuss.
15:35Also to let me know what you thought about the overall strategy itself.
15:37You know, your comments, your suggestions.
15:39Or your complaints.
15:40All that.
15:41You know, please mention that in the comment below.
15:42And then I would love to read that and respond back to you.
15:44I sincerely hope this deep dive gave you not just the results, but also the process that
15:48you can replicate on it.
15:49Or any strategy that you're interested in.
15:50So...
15:51Thanks again for watching.
15:52As always, trade smart, compound steadily.
15:53And I'll see you in the next video.
15:54Okay.
15:55If you genuinely found this video useful, please consider subscribing and liking the video.
15:59And I will see you soon in another video.
16:00And until then, take care and happy trading.
Comments

Recommended