Generic Series

Some financial instruments, like futures and bonds, need to be rolled when approaching the expiration/maturity date. This calls for special considerations:

  1. The rolls can cause jumps in the prices, that need to be adjusted when using historical data (typically, accumulated forward or backward adjustments).
  2. If a position is held through a rolling date, it is necessary to book a roll at the prevailing spread.
  3. There can be more than one criterion of choosing the rolling time and the security to roll into (at a specified date, by open interest, etc).
  4. These operations require extra historical information, like contract specifications (first notice date, last trading date, etc), historical open interests, auction dates, rolling spreads, etc

SAMOA can handle all these aspects using the concept of Generic Series. A generic series is a synthetic instrument that gets automatically adjusted and rolled.

NOTE: To make the discussion more concrete, I’ll show examples around two generic series: the TY future, and the 10Y US Treasury Note.

Historical dates

Each generic series has a table of contracts (or bonds) with some important dates. For instance:

TY FUTURE

  • List of contracts:
select top 5 * from Contracts where Market='TY' order by LastTrade desc 

image 

10Y NOTE

  • Auctions:
select top 8 Sector, AuctionDate, IssueDate, Maturity, Code from Auctions where Sector='10y' order by AuctionDate desc 

image 

Rolling methods

There usually are several ways of choosing how to roll a security. SAMOA has some pre-programmed methods for rolling, although custom rolls can also be created.

Pre-defined rolling methods for futures:

  1. OI: Roll when the Open Interest (OI) of a back contract surpasses the OI of the front contract. This method could perfectly skip a contract if its OI is not higher than a neighboring contracts. This situation happens often in commodity futures. 
    image
  2. OI1MNoSkip: Same as OI, but no skipping is allowed. Each contract has to become front contract for at least 1 month before switching to the next one.
  3. OI2MNoSkip: Same as OI1MNoSkip, but using a 2 month window.
  4. FirstNotice: The switch always happens the day before the First Notice date, and no contract can be skipped.

Pre-defined rolling methods for bills / notes and bonds:

  1. IssueDate: It always rolls on the issue date.
  2. Auction+1: It always rolls the day after the auction.

Examples of custom rolls:

  1. DTRolls: This custom futures’ roll was created to mimic the rolling dates used by one particular provider of tick data, which only collected data for what they considered the front contract.
  2. DT-FirstNotice: a merge between DTRolls and FirstNotice.
  3. DT-OI: a merge between DTRolls and OI.
  4. DT-OI1MNoSkip: a merge between DTRolls and OI1MNoSkip.

     

Table “GenericSeries”

All the generic series are defined in the table GenericSeries. This table consists of a list of (Date, Code) pairs, where “Code” is the id of a security. The remaining fields are just used to partition the data.

TY FUTURE

  • Front contracts using the method DT-OI1MNoSkip:
select top 10 Today, Code from GenericSeries where InstrumentType='TYFut' and Generic='Front' and Method='DT-OI1MNoSkip' and Today>'1982-05-24' order by today

image

10Y NOTE

  • List of old tens, switching by the method “Auction+1”:
select top 10 Today, Code from GenericSeries where InstrumentType='10y' and generic='1o10Y' and Method='Auction+1' and Today>'2009-02-09' order by today

image

NOTE: on 2009-02-12 the old 10Y switched from the “T 4 09/15/2018” to the “T 3.75 11/15/2018”.

Calculating rolls

Once a generic series is defined in the table “GenericSeries”, a whole list of calculations happen automatically. For instance the rolling spreads and the forward and backward adjustments.

TY FUTURE

  • Rolling spreads:
select top 5 * from dbo.ssGetGenericSwitches('Front', 'TYFut', 'DT-OI1MNoSkip' ) order by lastdate 

image

10Y NOTE

  • Rolling spreads:
select top 5 * from dbo.ssGetGenericSwitches('10Y', '10Y', 'IssueDate' ) order by lastdate 

image

Examples of functions for Generic Series

TY FUTURE

  • Was the H00 the front contract on 2000-02-20?:
select dbo.ssCodeToGeneric('H00', '2000-02-20', 'OI1MNoSkip', 'USFut') as 'USH00 on 2000-02-20 (by OI1MNoSkip)' 

image

  • Give me the front contract for TY on 2008-05-28):
select dbo.ssToFrontContract('TY', '2008-05-28', NULL) as 'ssToFrontContract'

image

  • Get the previous and the next contract for U80:
declare @code nvarchar(50) = 'U80' ;
select @code as 'Code', dbo.ssNextGenericCode(@code, 'Front', 'USFut', null, 1) as 'Next'
select @code as 'Code', dbo.ssNextGenericCode(@code, 'Front', 'USFut', null, 0) as 'Previous'

image

10Y NOTE

  • Was ‘T 6.25 02/15/2003’ on-the-run 10Y on 7/12/1993?:
select dbo.ssCodeToGeneric('T 6.25 02/15/2003', '7/12/1993', 'Auction+1','10Y') as 'T 4.5 11/15/2015 on 7/12/1993 (by Auction+1)' 

image

  • Was next bond to the single old 10Y is the double old 10Y:
select dbo.ssTsyNextGeneric('1o10Y', 1) as 'ssTsyNextGeneric' 

image

  • The next bond to the single old 10Y is the double old 10Y:
select dbo.ssTsyNextGeneric('1o10Y', 1) as 'ssTsyNextGeneric' 

image 

  • The previous bond to the single old 10Y is the on-the-run 10Y:
select dbo.ssTsyNextGeneric('1o10Y', 0) as 'ssTsyNextGeneric' 

image

P&L calculations

SAMOA knows how to adjust P&L calculations with the rolls when using Generic Series. Let’s look at an example.

TY FUTURE

Let’s say that on 2007-11-25 you buy 10 contracts of TY at 114.01, and you sell them on 2008-06-01 at 112.16+ (prices in 32nds). In summary:

  • Initial data
declare @t0 datetime = '2007-11-25 08:45:00';
declare @p0 decimal(18,5) = dbo.ssDisplayToPrice('114.01', 32, 0);
declare @t1 datetime = '2008-06-01 00:00:00';
declare @p1 decimal(18,5) = dbo.ssDisplayToPrice('112.164', 32, 0);
select @t0 as '@t0', dbo.ssToFrontContract('TY', @t0, null) as '@c0', dbo.ssPriceToDisplay(@p0, 32, 0) as '@p0'
union all
select @t1 as '@t1', dbo.ssToFrontContract('TY', @t1, null) as '@c1', dbo.ssPriceToDisplay(@p1, 32, 0) as '@p1';

image

As you can see, on 2007-11-25 the front contract for TY was TYZ07, while on 2008-06-01 the front contract was TYU08. Obviously there are rolls involved by holding this position.

  • Let’s see those rolls:
select top 3 Code, LastDate, dbo.ssPriceToDisplay(CloseF, 32, 0) as CloseF, dbo.ssPriceToDisplay(CloseB, 32, 0) as CloseB, NextCode from dbo.ssGetGenericSwitches('Front', 'TYFut', 'DT-OI1MNoSkip' ) where LastDate >= '2007-11-25' order by lastdate 

image

With all this input data, we can calculate the final P&L of this trade.

  • Method 1: Using the function ssPLInfo_PL and manual rolls.

    The function ssPLInfo_PL( instrument, q, p0, p1) calculates the P&L of a trade that buys q of instrument at p0 and sells it at p1. It knows how to calculate the value of a point for different instruments. Therefore, using the rolls information from the previous table, the final P&L would be:

select dbo.ssPLInfo_PL('TYZ07', 10, @p0, 114) + dbo.ssPLInfo_PL('TYH08', 10, 113.265625, 117.140625) + dbo.ssPLInfo_PL('TYM08', 10, 115.765625, 113.703125) + dbo.ssPLInfo_PL('TYU08', 10, 112.15625, @p1) as 'ssPLInfo_PL + Manual Rolls' 

image

We can see that we made $21,406.3

  • Method 2: Manual calculation using the function ssPLInfo_ToAdjusted.

    If we don’t want to deal with rolls, we can adjust p0 and p1 by the rolls using the function ssPLInfo_ToAdjusted(instrument, @t0, @p0 ), and calculate the P&L manually:

select 10 * dbo.ssPLInfo_ValuePt('TY') * (dbo.ssPLInfo_ToAdjusted('TY', @t1, @p1) - dbo.ssPLInfo_ToAdjusted('TY', @t0, @p0 ) ) as 'Manual + ssPLInfo_ToAdjusted' 

image 

  • Method 3: Using the function ssPLInfo_PL

    The function ssPLInfo_PL(instrument, q, p0, p1, t0, t1) will automatically make the roll adjustments for us:

select dbo.ssPLInfo_PL('TY', 10, @p0, @p1, @t0, @t1) as 'ssPLInfo_PL' 

image

Tags: , , ,

Reader's Comments »

  1. [...] Generic Series [...]

Leave a Reply

CAPTCHA Image Audio Version
Reload Image