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

