# convfactor

Bond conversion factors

## Syntax

``CF = convfactor(RefDate,Maturity,CouponRate)``
``CF = convfactor(___,Name,Value)``

## Description

example

````CF = convfactor(RefDate,Maturity,CouponRate)` computes a conversion factor for a bond futures contract.```

example

````CF = convfactor(___,Name,Value)` specifies options using one or more name-value pair arguments in addition to the input arguments in the previous syntax.```

## Examples

collapse all

This example shows how to calculate `CF`, given the following `RefDate`, `Maturity`, and `CouponRate`.

```RefDate = [datetime(2002,12,1); datetime(2003,3,1); datetime(2003,6,1); datetime(2003,9,1); datetime(2003,12,1); datetime(2003,9,1); datetime(2002,12,1); datetime(2003,6,1)]; Maturity = [datetime(2012,11,15); datetime(2012,8,15); datetime(2012,2,15); datetime(2011,2,15); datetime(2011,8,15); datetime(2010,8,15); datetime(2009,8,15); datetime(2010,2,15)]; CouponRate = [0.04; 0.04375; 0.04875; 0.05; 0.05; 0.0575; 0.06; 0.065]; CF = convfactor(RefDate, Maturity, CouponRate)```
```CF = 8×1 0.8539 0.8858 0.9259 0.9418 0.9403 0.9862 1.0000 1.0266 ```

This example shows how to calculate `cf`, given the following `RefDate`, `Maturity`, and `CouponRate` for a German bond.

`cf = convfactor(datetime(2009,3,10),datetime(2018,1,4), .04,.06,3)`
```cf = 0.8659 ```

## Input Arguments

collapse all

Reference dates for which conversion factor is computed (usually the first day of delivery months), specified as an `N`-by-`1` vector using a datetime array, string array, or date character vectors

To support existing code, `convfactor` also accepts serial date numbers as inputs, but they are not recommended.

Maturity date, specified as a `N`-by-`1` vector using a datetime array, string array, or date character vectors.

To support existing code, `convfactor` also accepts serial date numbers as inputs, but they are not recommended.

Annual coupon rates for underlying bond, specified as an `numBonds`-by-`1` vector in decimals.

Data Types: `double`

### Name-Value Arguments

Specify optional pairs of arguments as `Name1=Value1,...,NameN=ValueN`, where `Name` is the argument name and `Value` is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose `Name` in quotes.

Example: ```CF = convfactor(RefDate,Maturity,CouponRate,'Convention',2)```

Conversion factor convention, specified as the comma-separated pair consisting of `'Convention'` and a `N`-by-`1` vector using the following values:

• `1` = US Treasury bond (30-year) and Treasury note (10-year) futures contract

• `2` = US 2-year and 5-year Treasury note futures contract

• `3` = German Bobl, Bund, Buxl, and Schatz

• `4` = UK gilts

• `5` = Japanese Government Bonds (JGBs)

Data Types: `double`

Irregular first coupon date, specified as the comma-separated pair consisting of `'FirstCouponDate'` and a `N`-by-`1` vector using a datetime array, string array, or date character vectors.

To support existing code, `convfactor` also accepts serial date numbers as inputs, but they are not recommended.

Reference semiannual yield, specified as the comma-separated pair consisting of `'RefYield'` and an `N`-by-`1` vector in decimals.

Data Types: `double`

Forward starting date of payments, specified as the comma-separated pair consisting of `'StartDate'` and a `N`-by-`1` vector using a datetime array, string array, or date character vectors.

To support existing code, `convfactor` also accepts serial date numbers as inputs, but they are not recommended.

## Output Arguments

collapse all

Conversion factors against the 6% yield par-bond, returned as an `N`-by-`1` vector.

collapse all

### Conversion Factors

Conversion factors of US Treasury bonds and other government bonds are based on a bond yielding 6%.

Optionally, you can specify other types of bonds and yields using inputs for `RefYield` and `Convention`. For US Treasury bonds, verify the output of `convfactor` by comparing the output against the quotations provided by the Chicago Board of Trade (`https://www.cmegroup.com/company/cbot.html`).

For German bonds, verify the output of `convfactor` by comparing the output against the quotations provided by Eurex (`https://www.eurexchange.com`).

For UK Gilts, verify the output of `convfactor` by comparing the output against the quotations provided by Euronext (`https://www.euronext.com`).

For Japanese Government Bonds, verify the output of `convfactor` by comparing the output against the quotations provided by the Tokyo Stock Exchange (`https://www.jpx.co.jp/english/`).

 Burghardt, G., T. Belton, M. Lane, and J. Papa. The Treasury Bond Basis. McGraw-Hill, 2005.

 Krgin, Dragomir. Handbook of Global Fixed Income Calculations. John Wiley & Sons, 2002.