FRA
Description
Create and price a FRA
(forward rate agreement) instrument
object for one or more FRA instruments using this workflow:
Use
fininstrument
to create aFRA
instrument object for one or more FRA instruments.Use
ratecurve
to specify an interest-rate model for theFRA
instrument object.Use
finpricer
to specify aDiscount
pricing method for one or moreFRA
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
Syntax
Description
creates a FRAObj
= fininstrument(InstrumentType
,'StartDate
',start_date,'Maturity
',maturity_date,'Rate
',rate_value)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.
sets optional properties using additional
name-value pairs in addition to the required arguments in the previous
syntax. For example, FRAObj
= fininstrument(___,Name,Value
)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.
Input Arguments
InstrumentType
— Instrument type
string with value "FRA"
| string array with values of "FRA"
| character vector with value 'FRA'
| cell array of character vectors with values of
'FRA'
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
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")
FRA
Name-Value Pair ArgumentsStartDate
— FRA start date
datetime array | string array | date character vector
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.
Maturity
— FRA maturity date
datetime array | string array | date character vector
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.
Rate
— FRA coupon rate
scalar decimal | vector of decimals
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
FRA
Name-Value Pair ArgumentsBasis
— Day count basis
0
(actual/actual) (default) | scalar integer from 0
to 13
| vector of integers from 0
to 13
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
— Principal amount
100
(default) | scalar numeric | numeric vector
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
BusinessDayConvention
— Business day convention
"actual"
(default) | string | string array | character vector | cell array of character vectors
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
— Holidays used in computing business days
NaT
(default) | datetime array | string array | date character vector
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.
Name
— User-defined name for instrument
" "
(default) | string | string array | character vector | cell array of character vectors
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
StartDate
— FRA start date
scalar datetime | vector of datetimes
FRA start date, returned as a scalar datetime or an
NINST
-by-1
vector of
datetimes.
Data Types: datetime
Maturity
— FRA maturity date
scalar datetime | vector of datetimes
FRA maturity date, returned as a scalar datetime or an
NINST
-by-1
vector of
datetimes.
Data Types: datetime
Rate
— FRA coupon rate
scalar decimal | vector of decimals
FRA coupon rate, returned as a scalar decimal or an
NINST
-by-1
vector of
decimals.
Data Types: double
Basis
— Day count basis
[0 0]
(actual/actual) (default) | scalar integer from 0
to 13
| vector of integers from 0
to 13
Day count basis, returned as a scalar integer or an
NINST
-by-1
vector of integers.
Data Types: double
Principal
— Principal amount
100
(default) | scalar numeric | numeric vector
Principal amount, returned as a scalar numeric or an
NINST
-by-1
numeric vector.
Data Types: double
BusinessDayConvention
— Business day convention
"actual"
(default) | scalar string | string array
Business day convention, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
Holidays
— Holidays used in computing business days
NaT
(default) | datetimes
Holidays used in computing business days, returned as an
NINST
-by-1
vector of
datetimes.
Data Types: datetime
Name
— User-defined name for instrument
" "
(default) | scalar string | string array
User-defined name for the instrument, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
Object Functions
cashflows | Compute cash flow for FixedBond , FloatBond ,
Swap , FRA , STIRFuture ,
OISFuture , OvernightIndexedSwap , or
Deposit instrument |
Examples
Price FRA
Instrument Using ratecurve
and Discount
Pricer
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
Price Multiple FRA
Instruments Using ratecurve
and Discount
Pricer
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
FRA Instrument
A forward rate agreement (FRA) instrument is an over-the-counter contract between two parties, setting the interest rate for a future date.
The FRA buyer agrees to borrow a specified amount at a predetermined rate, and the FRA seller agrees to lend that amount at the same rate. FRAs are cash-settled based on the net difference between the contract interest rate and the market's floating rate, with the notional amount used to calculate this cash amount.
Version History
Introduced in R2020aR2022b: Serial date numbers not recommended
Although FRA
supports serial date numbers,
datetime
values are recommended instead. The
datetime
data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime
values, use the datetime
function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y = 2021
There are no plans to remove support for serial date number inputs.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)