Full transcript (1964 words)
Greed and fear, today we're going to talk about that. Hi and welcome to AlgoTest. I'm Chintan. Today we're going to talk about how these two emotions of greed and fear affect your strategy. We are going to demonstrate this through an option buying strategy on the call and the put with a twist. So, wait till the end >> [music] >> and check it out. So, hello everyone and we are at our platform algotest.in, the number one platform for algo trading in India. Today we are going to learn how to harness this greed and fear in an option buying algo strategy. So, first off, if you haven't signed up, I would request you to sign up. You can sign up very easily with your phone number, OTP, or through the Google sign in. All right, now let's get to it and log in to our page. So, this is the dashboard of the platform. Today we're going to look at a range breakout strategy. What is a range breakout strategy? How to think about it in terms of greed and fear is what we're going to discuss today. So, I've created two strategies. One to go long, the other to go short. One to buy a call option, the other to buy a put option. Usually when you're making a range breakout or any strategy, we club these two legs and we trade them together. But, this is where greed and fear come into factor. Why should you do it separately? Sometimes it's better to separate the legs into two different strategy, a long strategy and a short strategy >> [music] >> with different parameters so that you can harness these emotions better. Greed helps in going long, fear helps in going short. What does that mean? When the market is very greedy, I want to be buying a call. When the market is very fearful, I want to be buying a put. But, should their timings be the same? Should their SLs be the same? Should their range breakout time be the same? That's not necessary, which is what we are going to discuss today. All right? So, the first strategy that we are going to discuss is the long strategy, >> [music] >> meaning the CE buy. Obviously, I'm doing it on zero DTE. Why? Because the market is most greedy and most fearful on expiry day. What? Greedy to make money, fearful of not losing money. The idea is very simple. We are going to create a range breakout on Sensex. [music] All right? So, I selected the Sensex index. My entry time is 9:16. [music] My exit time is 3:15. And now, I am going to buy a call at the money only if the range made between 9:16 and 10:45 is broken. [music] Let me explain that better. So, what it says, we will start tracking the ATM call price between 9:16 and 10:45, we will take entry after 10:45 once the high of the selected strike, meaning the ATM strike at 9:16 in the range is breached. Now, let me give you an example. Let's say at 9:16, the ATM was 25,000. So, between 9:16 and 10:45, the 25,000 call made a high of 200 rupees and a low of 100 rupees. If after 10:45, the high of 200 rupees is breached, I'm going to buy that call. It's as simple as that. All right? Now, for the overall settings, I've put a max loss of around 1950, max target of 3250, lock in trail if the profit reaches 1300, lock the profit at 650. All right, these were all the values that I optimized over time. I kept on iterating, I used Asian 920, I used other tools, I used my know-how to optimize this. All right, you can do so as well. But, that is not the point of this video. The point of this video is to bifurcate greed and fear. Bifurcate long and short, and then club them together to see the results. All right, so we'll run this for only zero DTE. You can put the slippages, taxes, and charges, we'll do that right now. With your regular broker, you will be able to get a brokerage of 20 rupees, but with Upstox, you can get it for 10 rupees. All right, so it's up to you. Let's put it at 20 for this exercise, and there you go. Your auto your results. Some people might ask, "Why is it zero in Feb?" Because maybe in all expirations of Feb, the range was never broken. All right, it's as simple as that. No trade. For a buying setup, you don't have to trade every day. Sometimes, [music] for a whole month, there is no trade. Doesn't matter. All right, the margin required approximately is this much, and your ROIs and your overall profits are as per that. Very high drawdown, but that is very typical of a buying strategy. All right, we have already spoken about how capital required for a buying strategy is different from the margin required, and you can check out that video in the description box below. Moving on, now that our long strategy is complete, we will look at the short strategy. All right, so all these months, September, Feb, where the long entry never happened, maybe a short entry happened. All right, so let's check it out. And here is our PE strategy. In the PE strategy, I've tried to keep a lot of the parameters the same, but the one essential parameter that I have changed is the range time. You [clears throat] can see here that the range time [music] has changed from 10:45 to 10:35. All right. Obviously, you can change the overall stop loss, overall target, and trailing conditions. That's up to you, but the objective was to only change one parameter. All right. So, what am I doing? Let me explain again. From 9:16 to 10:35, I have selected a strike, the ATM strike of [music] 9:16. I am checking the range, the high and the low, and if the high is broken of the put, then I'm going to buy it. Basically, going short. For example, if between 9:16 and 10:35, the high was 150 and the low was 50, if 150 is broken, I'm going to buy it. That's as simple, and I'm going to put some risk management techniques. Obviously, these risk management [music] techniques are overall settings, hence they are checked only on [music] candle close. All right. So, let me backtest this as well. Another thing I want to talk about, why is the separation? Now, with the separation, I can run these strategies individually, so their overall stop loss, overall target, and lock conditions [music] are dealt separately rather than as a combined strategy. All right. So, I am treating greed as different, fear as different. All right. So, now let's check the results for zero DTE. All right. Somewhat okay. I think the call results were better. It doesn't matter. You know, we [clears throat] have to see the combined results. You can check these out. All right, the max drawdown is much higher. Doesn't matter. Do not worry. Just save these two strategies. [music] Now, what will we do? Yes, you guessed it right. We are going to create a basket. We are going to create a portfolio of these two strategies >> [music] >> and see how they run on a combined basis. All right, so just remember the margin required for the previous strategy was around 8,000 and for this is also 8,000. Let's assume the margin required is 20,000 for both these strategies combined. Just remember that. All right. Now, I am going to do this. I am going to go to portfolios. I am going to create a new portfolio, range breakout Sensex. Okay, let's put it greed and [music] fear. Let's find the strategies. Create them. This is it. Let's change the DT to zero and let's backtest it. Currently, I'm making a very simple >> [music] >> portfolio. All right, and let me put the slippages. And here are my results. All right, so my margin required was around 20,000 as we discussed. Brokerage is around 2,500 at 20 rupees an order. Taxes are also pretty minimal, not a problem. Overall profit 29 to 30,000. All right, return to max drawdown of three. Check this out. My drawdown is only 9,300. All right, which is way lower than their individual drawdowns. All right, so the long is helping when the short is in trouble and the short is helping when the long is in trouble. All right, now again, with having this portfolio, how can we optimize it further? All right. This is our correlation matrix. I made a detailed video on the correlation matrix earlier as well. Now, let's try to optimize it further. I've put everything here. I have put the DTE, I've put the slippage, and this is what I want to use now. Quantity multiplier. I can run maybe the call more than the put, and maybe the put more than the call. Here, what I've done, I'm running the put more than the call. All right, so let's see if it leads to a better result. And here it is. From 3.03, we are at 3.61. All right. So, we are running this on five lots. Two lots of call and three lots of put. All right. So, that makes it around 50,000 of margin required. Capital required is much more. Guys, check out the video, you'll know the difference between margin and capital. Great. Let's do the opposite then. Let's run this with three and two instead. And you can configure it as per your needs as well. Obviously, your overall profit is much better, but your drawdown has increased, [music] and your return to max drawdown is slightly lower. Now, what I'll do is actually run this over a longer period. Let's run this over 2 years. All right. So, this is just me playing around with the back tester and trying to explain [music] to you how sometimes it's better to bifurcate the strategy so that you can run them more efficiently. All right, so this is the 2-year result. All right. The 2-year result is oh, much much much better, actually. >> [music] >> Looks like it. All All Over a 2-year period, we are at 3.91. That's pretty good. Usually, for a buying strategy, the longer the period, the lower the results. And let's just switch it around here. This is what I meant. The put is really helping the call. So, the put of 3x [music] and a call of two, and my return to max drawdown has increased to 4.17. Essentially, my drawdown has reduced considerably. All right. [music] Even if I increase my slippage to say 2%, you will see the results are still pretty good. The capital required, essentially, is 50K for the margin and 50K for the max drawdown. That'll get it to around 1 lakh rupees. All right. [music] So, the overall profit on the 1 lakh is 1 lakh 30,000, approximately. All right. So, in conclusion, what did we learn today? We learned how greed and fear need to be dealt separately. Make two separate strategies to tackle them both. Sometimes, it is better to look at them individually and combine them later, rather than making one strategy that has both a long and a short leg. I hope you like this idea you learned today, and I hope to see you in other videos that we'll be making very soon. Thank you, and have a good day.