Click or drag to resize

How to develop a Rollover

Future contracts are traded for a limited tenure. For example the future contracts as traded in National Stock Exchange, India generally has a tenure for 3 (three) months. Thus if we want to populate any chart it will be limited for 3 (three) months only. With this limited data it is very difficult to make any meaningful studies particularly on lower time granularity. To overcome this difficulty data feed providers or brokers provides, what is known as Continuous data. However in case the connection does not provides continuous data ArthaChitra can merge data from various expiries and can build a "Continuous" chart. Please click here to know more about it.

The RolloverBase script types lets user define how the data will sliced from various contracts via the GetExpiry(DateTime) method.

Example
C#
public override Expiry GetExpiry(DateTime tradeDate)
{
    //return a Expiry object
}

You have to define the expiry date of the contract and a rollover date. Rollover date is the 'From' date from which date you want to append the data for the contract. While Expiry date is the 'To' date till you want to slice the data from the contract.

Let us further illustrate how the data is sliced from varios expiries. Say, you are viewing a continuous chart from say 3rd October '15 to 3rd November '15. The data for the said chart spans 2 expiries. Lets say the expiries are defined in the Instrument Definition as:

Expiry Date

Rollover Date

26 Nov 201530 Oct 2015
29 Oct 201525 Sep 2015

In such scenario the chart will pull data from the Oct 15 series and Nov 15 series as

Series

From Date

To Date

Oct 201503 Oct 201529 Oct 2015
Nov 201530 Oct 201503 Nov 2015

Now say, there's hardly any volume in the Oct 15 series contract on 28 Oct 15 and 29 Oct 15 (traders have rollover to the next expiry and all the volume has shifted to the Nov 15 expiry) and you want to load the data for the said two dates from the Nov 15 expiry. In such scenario just set the rollover date for the Nov 15 series to 28 Oct 15. Now ArthaChitra will load the data as follows:

Series

From Date

To Date

Oct 201503 Oct 201527 Oct 2015
Nov 201528 Oct 201503 Nov 2015

By default ArthaChitra defines the rollover date as previous expiry date + 1 (one) day.