Module 10   Trading SystemsChapter 15

Calendar Spreads

View chapters →

15.1 – The classic approach

I had briefly introduced the concept of calendar spreads in Chapter 10 of the Futures Trading module. Traditionally calendar spreads are dealt with a price based approach. Here is a quick recap on how this is done –

  1. Calculate the fair value of current month contract
  2. Calculate the fair value of the mid-month contract
  3. Look for relative mispricing between the two contracts

Based on the mispricing, you either buy the current month contract and sell the mid-month contract or sell the current month contract and buy the mid-month contract. Here is an example of a Calendar Spread –

  1. Buy TCS Futures expiring 28th June 2018 @ 1846
  2. Sell TCS Futures expiring 28th July 2018 @ 1851

Here you buy and sell the futures of the same stock, but of contracts belonging to different expiries like showcased above.  The difference between prices of the two contracts is what is expected to made here. The risk is extremely low in calendar spreads so therefore the money you make on calendar spreads is also small. If you are trader like me, who is averse to risk, then this is something you may like.

This approach to performing a calendar spread is a decent one.

By the way, if you are not familiar with what I’m discussing, then I’d suggest you read Chapter 10 in the Futures Trading module to get a quick perspective on the classic calendar spreads approach.  I think it forms a crucial foundation on top of which you can build other variant/styles of calendar spreads.

So let’s get started straight away.

15.2 – Calendar spread logic

If you have read the chapters on pair trading, then understanding the calendar spread logic is quite straightforward. This simplified approach assumes that the current price of futures is a reflection of everything known in the market. The known set of information can extend from news on the stock, corporate action, discount/premium, fair value, and literally everything out there which is relevant to the stock.

Now, if the above assumption is valid, then probably we can use the price itself as a trigger to identify opportunities to set up a calendar spread trade. This kind of simplifies the whole approach. Calendar spreads are a low-risk strategy so therefore do not expect big bucks from this strategy. However, since you simultaneously buy-sell the same asset, you take out the directional risk involved in the trade, hence it does make sense to top up the leverage. Also, unlike pair trade, the calendar spread trades can be ultra-short term in nature, with most of the trades closing within the same day. Before I take up an example to explain this, I’ll quickly give you an overview of this is done.

Start with downloading the continuous futures closing prices of the stock for both near month and next month contracts.

Calculate the daily historic difference between the two contracts and generate a time series. Calculate the mean and standard deviation of the time series. Using the mean and standard deviation data we can estimate the range for the difference. A trading signal is triggered when the difference between the two contracts move to mean plus or minus 1 standard deviation and the trade is closed when the difference collapses to mean.

You get the point, don’t you ☺

15.3 – Calendar spread example

I’ve taken the example of SBIN to illustrate calendar spreads. I have download the continuous futures data from Zerodha Pi (Zerodha’s desktop trading application) for last 200 trading days. I have got the closing prices on excel sheet, and this is how it looks –

The next step is to calculate the difference between the two contracts. It is advisable to subtract the price of near month contract from the current month contract. This is because, all else equal, the futures price of Near month contract is always higher than the previous month contract owing to the ‘cost of carry’. Chapter 10 of futures module explains this in more detail.

The difference is calculated and the time series data is generated, as shown below –

I will now calculate the mean and standard deviation on this time series. The mean will give me an estimate on how much of the difference is acceptable on a ‘day to day’ basis and at the same time, the standard deviation will give me a sense of variation in this difference. Here is the snapshot.

You can calculate the mean and standard deviation on excel using the ‘=Average ()’ and ‘=stdev()’ functions respectively.

The mean of 1.227 tells me that, all else equal, the difference between the two contracts should be 1.227 or in that vicinity. This essentially means, there is no trade opportunity if the spread (or the difference) between the two contracts hovers around this value.

We now use the standard deviation value and the mean value to calculate the range of the spread –

  • Upper range = 1.227 + 0.4935 = 1.7205
  • Lower Range = 1.227 – 0.4935 = 0.7335

I had mentioned that the spread can hover around 1.227, but I had not quantified ‘vicinity’, which is quite important. The range calculation does just that, it helps us quantify the range within which (vicinity) the spread can vary on a daily basis.. Any value of the spread outside this range gives us an opportunity to set up a calendar spread.

If the spread has increased beyond the upper range of 1.7205, it means either the near month contract has increased in value or the current month contract has reduced in value.

The rule of thumb in any arbitrage is to always buy the asset in the cheaper market and sell the same asset in the expensive market, hence the trade here would be to buy the current month contract and sell the near month contract.

Likewise, if the spread has fallen below the lower range value i.e 0.7335, this means the current month has become expensive and near month has become cheaper. Hence, the trade here is to sell the current month and buy the near month contract.

With this logic in perspective, let’s evaluate the if SBIN has given us any opportunities over the last 200 trading days.

15.4 – Spotting opportunities

Keeping the above pointers in perspective, we can conclude the following –

  1. Sell the spread when the spread increases beyond 1.7205. Sell spread means, sell the near month contract and buy the current month contract
  2. Buy the spread when the spread shrinks below 0.7335. Buy spread means, buy the near month contract and sell the current month contract.

If you find it hard to figure out which contract to buy and which one to sell when a signal originates, then simply think in terms of the near month contract. Sell spread means sell the near month (therefore buy current month) and buy spread means buy the near-month (therefore sell the current month contract).

In the excel sheet, I now look for the historical opportunities. I will identify the sell spread opportunities first. To do this, I simply have to apply a filter, to filter out all values above 1.7205. I’ve done the same, here are the results –

As you can see, on 6 occasions, the spread increases beyond 1.7205 or the first standard deviation levels. On all these occasions, there was a trigger to sell, implying the spread would fall back to mean.

In fact, here is how the spread behaved –

Signal Date Sell spread value Trade closing date Buy spread value P&L
31-08-2017 2.45 1-09-2017 1.35 1.1
28-092017 2.6 29-09-2017 1.15 1.45
30-11-2017 2.35 01-12-2017 1.55 0.8
28-12-2012 3.8 29-12-2017 1.45 2.35
22-02-2018 2.5 23-03-2018 1.3 1.2
26-04-2018 1.85 27-04-2018 0.6 1.25

As you can notice, signals originate around month ends, probably due to expiry dynamics. Also, every trade has resulted in a profit (although small) and closed the very next day.

Let us see how the buy spread trades have performed. I have filtered for all values below 0.7335, and here are the results –

There are close to 28 trade here and not all of them are successful. Of course, the losses are as small as the profits, if not smaller. I’ll let you do the exact calculation, like the way I’ve shown for the short trades.

I hope this example gives you a general sense of how to carry out calendar spread. I’m sure you’d agree that this is far simpler and intuitive compared to the classic approach to calendar spreads.

I have summarized my thoughts on Calendar spreads here and this will also double up as the key takeaways for this chapter –

  1. The expected profits and losses are small in calendar spreads
  2. Directional risk is eliminated, hence you go can go full throttle on leverage
  3. All the short trades in SBIN were successful but longs were not – this implies that I would only look for short opportunities in SBI. In other words, you need to backtest the P&L profile of each futures contract and figure out which contract you can go long on and which contract you can go short on
  4. Since the P&L is small, ensure your trading costs are minimum, a discount broker like Zerodha is most suited for such trades J
  5. Trades usually close within a day or two
  6. Trades usually originate around expiry due to expiry dynamics

Think about this, if you can backtest this across the entire universe of equity and commodities futures contract, you will essentially have at least a signal or 2 every day!

I’d love to hear your thoughts, so please do post your queries.

Download the Excel Sheet

PS: I won’t be posting any new chapters for a while, but that does not mean I’m not working on new content, it is just that the delivery format will be different and way more exciting!

Stay tuned ☺

444 comments

View all comments →
  1. Balu Ashok Kumar says:

    Based on the mispricing, you either buy the current month contract and sell the mid-month contract or sell the current month contract and buy the mid-month contract. Here is an example of a Calendar Spread –

    Buy TCS Futures expiring 28th June 2018 @ 1846
    Sell TCS Futures expiring 28th June 2018 @ 1851 ( Pls correct this)

    • Karthik Rangappa says:

      Ah, silly typo, will fix it 🙂

      • Sagar Kumar says:

        Zerodha varsity is very helpful for people like me who are new to stock market, there are 10 module 9 have the option to download it as a pdf but the 10th module doesn’t have this option please provide this option for module then also it will be very helpful and people like me can read it offline also.
        Hope you will do this thanks in advance

  2. Thirumal Sharma says:

    First comment! You are a savior Karthik sir. Thanks a ton.

  3. Nidhi says:

    Thank you sir for a such simple and effective way.. this is where your style of teaching is so different..please look into teaching momentum investing in near future..this one topic i really want you to cover..hope you look into this soon
    thanks and you are doing very good to many in markets..God Bless…

    • Karthik Rangappa says:

      Momentum investing is a part of the plan, Nidhi. However, I will have to prioritise one something else for now 🙂

      • Tejeshwar says:

        Hey Karthik i really learnt a lot from varsity and it has helped me trade better, can you please do chapters related to market profile and order flow analysis?

  4. manoj says:

    Team..how would you execute this trade. As in how would you buy/sell sbin current month contract on last day of expiry and then carry to next day. like in eg of sbin we are buying current month contract on 31st August which will close that same day..but technically above we are closing on 1st sept..

    • Karthik Rangappa says:

      The data source is the continuous data, Manoj which means the action is always in the Current and Near month contracts. If the contract has expired, then the trade naturally moves to the next month contract (which is now considered current).

      • Manoj says:

        Thanks Karthik

        So how many days are good for calculating mean. Also once you spot the difference between near month and current month which is above the mean and standard based on closing, should we initiate trade next morning. What if opening price of next day falls below or in range of our mean and std deviation

        • Karthik Rangappa says:

          Manoj, no point waiting here. You initiate the trade as and when you spot the opportunity. I’d suggest you take the last 200 days avg as look back period.

          • Vinayak says:

            So does this mean we need to rollover our position and take up p/l by square off current trade.

          • Karthik Rangappa says:

            The ideal situation is when you can square off the position before the expiry. However, if you are not in a situation to do so, then you can rollover.

      • Aagam says:

        Sir so we need to rollover both the future contracts which will lead to additional charges??

  5. MD ABBAS ALI MULLICK says:

    Respected
    Sir please inform me details about REFERRAL benefits. My REFERRAL CANDIDATE trade hassle free but I can’t get any benefit. So please inform me details. On thing is your ZERODHA SUPPORT TEAM NOT SUPPORT PROPERLY to open new account. My business EXECUTIVES ROOPA, can’t co operate with my REFERRAL friends. She don’t pic up my FONE or not CALL ME BACK

View all comments →
Post a comment