Skip to playerSkip to main content
  • 1 day ago
Transcript
00:00You know, a lot of 9 to 5 professionals are constantly on the lookout for trading systems
00:03that are simple, time efficient, and profitable. Something that fits around their job schedule.
00:07The goal isn't to find a magic formula for profits, but a disciplined data-backed approach
00:10that helps them participate in the market consistently and intelligently. In one of
00:14my earlier videos, we explored exactly that, the mid-cap shop strategy, which was a modified
00:19version of the well-known nifty shop concept. If you haven't watched that video yet, I highly
00:23recommend checking that out first, because today's video builds directly on top of that.
00:27In this video, we are taking that same framework and applying it to a brand new universe, the
00:32NSE Small Cap 50 Stocks. I've run multiple backtests using different input parameters, capital allocation
00:38methods, and target variations, and the results are mind-blowing. So stick around till the end,
00:42because I'll not only walk you through the backtest findings, but I'll also share which
00:45parameter settings worked best for this version of this strategy.
00:51Always do your own research and consult with a qualified financial tax and legal professional
00:54before making any financial decision. For those who are new, the original nifty shop strategy was
00:58introduced by Mr. Maheshinder Kaushik, a respected financial educator on YouTube. The idea was
01:02refreshingly simple, right? Identify stocks that have fallen significantly below their 20-day moving
01:06average, buy them when they are oversold, and exit when they recover by about 5%. It's a pure mean
01:11reversion strategy, no complicated indicators, no fancy setups, just a disciplined rule-based system that
01:16works beautifully on daily data. I first implemented and backtested this strategy on nifty 50 stocks,
01:21which gave decent stable returns. But the curiosity didn't stop there. I wondered what if we push this
01:26one a step further, right? If large cap are steady and mid cap are fast, what about small caps, the
01:30real high energy segment of the market, right? So that's where the small cap shop strategy comes in.
01:35The concept remains the same. It's still a swing trading system, still long only, and still designed
01:40for people who can spare just a few minutes a day. But this time, we use the NSE small cap 50 universe,
01:44the top 50 stocks from the small cap category, known for its higher volatility and faster price action.
01:50The hypothesis was simple. Small caps could help hit that 5% target faster, improve our rotation and
01:55also boost returns if managed carefully with proper capital controls. Now let's talk about the strategy
02:01rules. Most of you would have watched the previous videos, so I don't really want to bore you down
02:05with the details. So I'll try to breeze through the rules as quickly as I can. Every evening just before
02:10the market close, say around 3.15 PM, we identified top five stocks that are farthest below their 20-day
02:16moving average. We sort that list to have the ones that have fallen the most from their respective
02:2020 TMA. Then we go down that list one by one. If we are not holding that particular stock,
02:26we buy it using the allocated capital, right? Remember, but we buy only one stock per day.
02:31If all five stocks are already part of the portfolio, we switch to the averaging mode.
02:36In the averaging mode, the rules again are very simple. Step number one, we look at our existing
02:39holdings and then we pick those stocks within our holdings that have fallen more than 3%
02:44from their buy price. Step number two, among these stocks, remove any stocks where we already
02:50have averaged it twice. That is, you bought it the first time, then the price fell below
02:543%, so you averaged it once. Again, after some time, the stock fell an additional 3% or more,
03:00and then you averaged again. Now you have three open active positions for that particular stock.
03:05If this is the case, you skip that stock because we are going to limit only three maximum open
03:08positions per stock. So step number three, among the stocks that are left, select one stock that
03:14has fallen the most and buy it one more time. Again, only one averaging per day allowed. I trust this
03:22is clear. Again, if you're unclear, I suggest that you take a look at our mid cap shop video one more
03:26time. On the exit side, it's pretty straightforward. We sell the stock when any of our open positions hit
03:32the 6% target. That's it. You start at around 3.15pm, and then this whole process, including the
03:37buying and the selling, is all done within the next 5 to 10 minutes, and it's as simple as that.
03:41There are no limits on how many stocks you can sell per day, so sell all the stocks that have
03:45achieved your 6% target. For this strategy again, I tested multiple position sizing approaches, starting
03:50with the static allocation, which is nothing but, you know, you're allocating a set amount for each
03:54trade. For example, say 10,000 or 20,000 per trade, right? Then comes the dynamic allocation method,
03:59in which your position size is a percentage of the total available cash. For example,
04:032 or 3% of your portfolio size is your position size, right? Then finally, the divisor method,
04:08where the position size changes with the portfolio value. So you divide the total portfolio balance
04:13by a divisor, for example, say 40, and then use that as your position size. And again, if this is all
04:19confusing, please take a look at the mid cap shop video, where I've explained this in detail.
04:24I have a general appeal to make. Close to 80% of the people who watch my videos don't seem to be
04:28subscribing. As you're aware, this community is just one person initiative dedicated to help
04:34people on their fire and wealth building journey. Running and maintaining this community takes time,
04:38effort and resources from my side. One way you could support this community is by subscribing,
04:43liking and also sharing this content with your friends. This will motivate me to do more such
04:47videos and keep this community alive. Thank you. For people who are new to trading and wondering what the
04:52nifty small cap 50 is all about, you can go to nsaindia.com. And then under market data and indices,
04:57you'll find the list of indices here. And then if you look through the list, you would find the
05:01nifty small cap 50 here. And these are the 50 top stocks within the small cap universe. And this is
05:08what we would be trading on. And if you are wondering how to find the top five stocks that have fallen
05:13farthest down from the 20 day moving average, I've built a small Python screener here. This Python
05:19screener basically picks up the list of nifty small cap 50 lists from NSE directly and then runs
05:24through the logic and then gives you the top five stocks that have fallen the most from the 20 day
05:29EMA. So this is a daily screener that you could actually run during just before the market close
05:35and then you would get the list of those five stocks. And this particular code is included within
05:39the backtesting package here, the link to which you can find within the video description.
05:45And now we come to the backtesting Python script itself. This is the script that I had built
05:49to test this particular strategy. And here you could see as input, we've given all the small
05:54cap 50 stocks here from the list that I showed you from the NSE side. And that's given as input.
05:59In terms of the backtesting period, we start from the 1st of January 2020. So the COVID period is
06:04also included. So that way we can also see how the strategy would have performed during the COVID
06:08period as well. And then all the test results from this backtesting is stored within this particular
06:15file name. And this is the main class where the backtesting really happens here.
06:19So as part of this backtesting, there are multiple parameters that we need to consider,
06:22right? Starting from the position size, we have three different position sizes.
06:25And then if it is static, then we have, we are considering 10,000 and 20,000 for the fresh buy,
06:30which is when you buy the stock for the first time, if you don't have it in the holding.
06:33And then you have, when you're averaging it, you use a different position size,
06:36which is again, 10,000 and 20,000, 10,000 for the first buy, and then the 20,000 for the averaging buy,
06:41right? So, so there are again, four combinations within that particular item itself. And then in case of
06:46dynamic, I've given 1.5%, 2%, and 2.5%, again, one for the fresh buy and one for the averaging,
06:53right? In terms of divisors, we start from 10 divisors, 20, 30, and 40, similarly for the fresh and
06:59the averaging buy, right? And then the target parameters, originally the, you know, the default,
07:04you know, target was 6%, but we are also considering three and 8% just to see, you know,
07:09which one does better and which one basically gives us the most risk-adjusted return, right?
07:14The average trigger percentage, which is the percentage a stock has to fall before we start
07:18averaging, right? We discussed about a 3% rule, right? If the stock falls below 3%, then it is
07:22ready for averaging. In this case, I've considered three and 5% also just to again see, you know,
07:27which is the most optimum average trigger percent that we could use. And finally, how many maximum
07:31positions can we hold for a stock? And during the rules, I explained about three, right? Maximum three
07:36positions, which is one fresh buy and two average position. But I've also just for fun,
07:41considered five to see if that would make a difference and it can give us better returns,
07:45right? So as you can appreciate, there are multiple permutations and combinations of these input
07:51parameters. And then what I've basically done is set up the script to test every single scenario.
07:57There were close to about 350 scenarios that this particular Baptist script tested. And then,
08:02when I got the output for each of those scenarios, then I sorted it based on the
08:06highest return and found out the best setting that gave us the most return, right? So that was
08:11the overall scope of this backtesting. So like I said, after the 350 odd combinations of testing
08:18completed, the backtesting script would record all the final results from each of those backtesting
08:22into this consolidated final CSV file, which is also included as part of the backtesting script.
08:28So you can really take a look at every single scenario and the associated trade book also.
08:32And now the final results of the testing that you've all been waiting for,
08:35this is the final consolidated sheet that I was talking about. And, you know, this is basically
08:39ranked on the scenarios that basically gave us the maximum net PNL percentage here, which is
08:43this particular iteration, which is iteration number 161, right? And it is a divisor mode iteration,
08:50where we are going for a fresh buy of 10 divisor. And then for the averaging also, we use a 10 divisor.
08:55The target percentage is six, the average down percentage is going to be 3%. And then the maximum
09:00positions that we can hold is three, right? So for this particular combination,
09:04we got a net PNL of about 17.2 lakhs, right? Remember, we started off with a 4 lakh initial
09:08capital, but what I really found out was not all 4 lakhs was deployed. So even if we consider that
09:13entire 4 lakhs as the initial capital, given the 7.22 returns, we got about a 430% return in the
09:19last five years, five years and eight months. And that's the total findings from this backtesting.
09:23So this entire list along with all the combinations you can find, and then you can also find the
09:30individual trade books for each of these iterations are also available as part of the backtesting
09:34package. So as usual, we'll finish off by looking at the actual strategy performance in our dashboard.
09:40So for people who are new, this is the dashboard that I built and I personally use to track the
09:43performance of my strategies. So in this case, we're going to be looking at the iteration 161, which
09:48basically was the topmost, right? The one that had the maximum returns. And this is what it basically
09:53looks like. So we had about 692 total trades. And then the actual investment, this is what I was
09:58talking about. Though we started off with the 4 lakh investment, the actual out-of-pocket investment
10:03that went into the strategy was only 3.2 lakhs, right? So the gross PNL was about 17.5 lakhs. And then
10:09after all the brokerages paid, we had 17.22 lakhs. So if you really consider the actual money that
10:14went out-of-pocket, which is 3.2 lakhs and the net PNL, we are actually looking at a net PNL,
10:19which is higher than what we saw on that particular sheet, because that was calculated based on the
10:234 lakh capital. And this number is calculated based on the actual money that was deployed,
10:28which is 537 percentage in the last five years and eight months, which is really, really good.
10:32And the average holding period is about 59 days, 59 calendar days. So we have an XIRR, which is a very
10:37healthy 48% here. A quick look at the equity curve. The brown one is the strategy and white one is
10:43the Nifty 50. I know the comparison is, you know, some people might say you'll have to compare it
10:48with the small cap 100, but I've done that as well. And then the strategy beats the index, you know,
10:54a fair and square on that one as well, right? So, and this is the monthly returns heat map.
10:57So you can look at the numbers for yourself for each of the month and for the entire year.
11:02And then if you look at the year on year strategy versus benchmark, the strategy is beating the benchmark
11:07every single year. And then you can see the comparison here vis-a-vis with the Nifty 50 returns.
11:11This infographic gives you the portfolio growth versus the out-of-pocket investment. Like I was
11:16telling the, we started off with the 4 lakh investment, but the entire 4 lakh was not invested,
11:19close to about 3.2 was only invested throughout. But this just gives, you know, the comparison of
11:24how the out-of-pocket, you know, fares up with the overall portfolio, how much it grew, right?
11:29During that period. So the entire trade book for this particular scenario that was tested,
11:33this is all provided here. So you can take a look at it like, like this for every single scenario
11:37iteration that we tested, there are separate trade books and all of each of those trade book is also
11:40included within the backlisting package. If you've enjoyed this video, don't forget to like,
11:45subscribe and share it with your trading friends. It really helps the channel grow and do check out
11:49our community website fabrader.in. You might find a lot of similar useful stuff there, right?
11:53So until next time, this is Vivek from Fabrader wishing you profitable trades and peaceful wealth building.
Comments