Main Content

FRA

FRA instrument object

Since R2020a

Description

Create and price a FRA (forward rate agreement) instrument object for one or more FRA instruments using this workflow:

  1. Use fininstrument to create a FRA instrument object for one or more FRA instruments.

  2. Use ratecurve to specify an interest-rate model for the FRA instrument object.

  3. Use finpricer to specify a Discount pricing method for one or more FRA instruments.

For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

For more information on the available models and pricing methods for a FRA instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

FRAObj = fininstrument(InstrumentType,'StartDate',start_date,'Maturity',maturity_date,'Rate',rate_value) creates a FRA object for one or more FRA instruments by specifying InstrumentType and sets the properties for the required name-value pair arguments StartDate, Maturity, and Rate. For more information on a FRA instrument, see More About.

example

FRAObj = fininstrument(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, FRAObj = fininstrument("FRA",'StartDate',datetime(2016,1,30),'Maturity',datetime(2019,1,30),'Rate',0.025,'Principal',100,'Basis',1,'BusinessDayConvention',"follow",'Name',"FRA_instrument") creates a FRA instrument with a principal of 100 and a maturity of January 30, 2019. You can specify multiple name-value pair arguments.

example

Input Arguments

expand all

Instrument type, specified as a string with the value of "FRA", a character vector with the value of 'FRA', an NINST-by-1 string array with values of "FRA", or an NINST-by-1 cell array of character vectors with values of 'FRA'.

Data Types: char | cell | string

Name-Value Arguments

Specify required and 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: FRAObj = fininstrument("FRA",'StartDate',datetime(2016,1,30),'Maturity',datetime(2019,1,30),'Rate',0.025,'Principal',100,'Basis',1,'BusinessDayConvention',"follow",'Name',"FRA_instrument")

Required FRA Name-Value Pair Arguments

expand all

FRA start date, specified as the comma-separated pair consisting of 'StartDate' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

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

If you use date character vectors or strings, the format must be recognizable by datetime because the StartDate property is stored as a datetime.

FRA maturity date, specified as the comma-separated pair consisting of 'Maturity' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

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

If you use date character vectors or strings, the format must be recognizable by datetime because the Maturity property is stored as a datetime.

FRA coupon rate, specified as the comma-separated pair consisting of 'Rate' and a scalar decimal or an NINST-by-1 vector of decimals.

Data Types: double

Optional FRA Name-Value Pair Arguments

expand all

Day count basis, specified as the comma-separated pair consisting of 'Basis' and scalar value or an NINST-by-1 vector of integers from the following:

  • 0 — actual/actual

  • 1 — 30/360 (SIA)

  • 2 — actual/360

  • 3 — actual/365

  • 4 — 30/360 (PSA)

  • 5 — 30/360 (ISDA)

  • 6 — 30/360 (European)

  • 7 — actual/365 (Japanese)

  • 8 — actual/actual (ICMA)

  • 9 — actual/360 (ICMA)

  • 10 — actual/365 (ICMA)

  • 11 — 30/360E (ICMA)

  • 12 — actual/365 (ISDA)

  • 13 — BUS/252

For more information, see Basis.

Data Types: double

Principal amount, specified as the comma-separated pair consisting of 'Principal' and a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Business day convention, specified as the comma-separated pair consisting of 'BusinessDayConvention' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array. The selection for business day convention determines how nonbusiness days are treated. Nonbusiness days are defined as weekends plus any other date that businesses are not open (for example, statutory holidays). Values are:

  • "actual" — Nonbusiness days are effectively ignored. Cash flows that fall on non-business days are assumed to be distributed on the actual date.

  • "follow" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day.

  • "modifiedfollow" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day. However if the following business day is in a different month, the previous business day is adopted instead.

  • "previous" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day.

  • "modifiedprevious" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day. However if the previous business day is in a different month, the following business day is adopted instead.

Data Types: char | cell | string

Holidays used in computing business days, specified as the comma-separated pair consisting of 'Holidays' and dates using an NINST-by-1 vector of a datetime array, string array, or date character vectors. For example:

H = holidays(datetime('today'),datetime(2025,12,15));
FRAObj = fininstrument("FRA",'StartDate',datetime(2016,1,30),'Maturity',datetime(2025,12,15),'Rate',0.025,'Holidays',H)

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

User-defined name for one of more instruments, specified as the comma-separated pair consisting of 'Name' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array.

Data Types: char | cell | string

Properties

expand all

FRA start date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

FRA maturity date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

FRA coupon rate, returned as a scalar decimal or an NINST-by-1 vector of decimals.

Data Types: double

Day count basis, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Principal amount, returned as a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Business day convention, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Holidays used in computing business days, returned as an NINST-by-1 vector of datetimes.

Data Types: datetime

User-defined name for the instrument, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Object Functions

cashflowsCompute cash flow for FixedBond, FloatBond, Swap, FRA, STIRFuture, OISFuture, OvernightIndexedSwap, or Deposit instrument

Examples

collapse all

This example shows the workflow to price a FRA (forward rate agreement) instrument when you use a ratecurve and a Discount pricing method.

Create FRA Instrument Object

Use fininstrument to create a FRA instrument object.

FRAObj = fininstrument("FRA",'StartDate',datetime(2020,9,15),'Maturity',datetime(2022,9,15),'Rate',0.0175)
FRAObj = 
  FRA with properties:

                     Rate: 0.0175
                    Basis: 2
                StartDate: 15-Sep-2020
                 Maturity: 15-Sep-2022
                Principal: 100
    BusinessDayConvention: "actual"
                 Holidays: NaT
                     Name: ""

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,9,15);
Type = 'zero';
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
 
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create Discount Pricer Object

Use finpricer to create a Discount pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

outPricer = finpricer("Discount",'DiscountCurve',myRC)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price FRA Instrument

Use price to compute the price and sensitivities for the FRA instrument.

[Price, outPR] = price(outPricer, FRAObj,["all"])
Price = 
3.4176
outPR = 
  priceresult with properties:

       Results: [1x2 table]
    PricerData: []

outPR.Results
ans=1×2 table
    Price       DV01  
    ______    ________

    3.4176    0.001368

This example shows the workflow to price multiple FRA (forward rate agreement) instruments when you use a ratecurve and a Discount pricing method.

Create FRA Instrument Object

Use fininstrument to create a FRA instrument object for three FRA instruments.

FRAObj = fininstrument("FRA",'StartDate',datetime([2020,9,15 ; 2020,10,15 ; 2020,11,15]),'Maturity',datetime([2022,9,15 ; 2022,10,15 ; 2022,11,15]),'Rate',0.0175)
FRAObj=3×1 FRA array with properties:
    Rate
    Basis
    StartDate
    Maturity
    Principal
    BusinessDayConvention
    Holidays
    Name

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,9,15);
Type = 'zero';
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
 
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create Discount Pricer Object

Use finpricer to create a Discount pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

outPricer = finpricer("Discount",'DiscountCurve',myRC)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price FRA Instruments

Use price to compute the prices and sensitivities for the FRA instruments.

[Price, outPR] = price(outPricer, FRAObj,["all"])
Price = 3×1

    3.4176
    3.4121
    3.4063

outPR=1×3 priceresult array with properties:
    Results
    PricerData

outPR.Results
ans=1×2 table
    Price       DV01  
    ______    ________

    3.4176    0.001368

ans=1×2 table
    Price       DV01   
    ______    _________

    3.4121    0.0013938

ans=1×2 table
    Price       DV01   
    ______    _________

    3.4063    0.0014204

More About

expand all

Version History

Introduced in R2020a

expand all