Main Content

instcf

Construct cash flow instrument

Description

InstSet = instcf(CFlowAmounts,CFlowDates,Settle) creates a new instrument set containing CashFlow instruments.

example

InstSet = instcf(InstSet,CFlowAmounts,CFlowDates,Settle) adds CashFlow instruments to an existing instrument set.

example

InstSet = instcf(___,Basis) adds an optional argument.

example

[FieldList,ClassList,TypeString] = instcf lists field meta-data for the CashFlow instrument.

example

Examples

collapse all

Create a new instrument variable with the following information:

CFlowAmounts =[5 NaN 5.5 105; 5 0 6 105];
CFlowDates = [732678, NaN, 733408,733774; 
              732678, 733034, 733408, 734774];
Settle= 'Jan-1-2015';
Basis = 1;

Create the new cash flow instruments.

InstSet = instcf(CFlowAmounts,CFlowDates,Settle,Basis)
InstSet = struct with fields:
        FinObj: 'Instruments'
    IndexTable: [1x1 struct]
          Type: {'CashFlow'}
     FieldName: {{4x1 cell}}
    FieldClass: {{4x1 cell}}
     FieldData: {{4x1 cell}}

Display the cash flow instruments.

instdisp(InstSet)
Index Type     CFlowAmounts                                CFlowDates                                               Settle         Basis
1     CashFlow 5           NaN           5.5           105 01-Jan-2006      NaN        01-Jan-2008   01-Jan-2009    01-Jan-2015    1    
2     CashFlow 5             0             6           105 01-Jan-2006   23-Dec-2006   01-Jan-2008   28-Sep-2011    01-Jan-2015    1    
 

Input Arguments

collapse all

Instrument variable, specified only when adding CashFlow instruments to an existing instrument set. For more information on the InstSet variable, see instget.

Data Types: struct

Cash flow amounts, specified as a number of instruments (NINST) by maximum number of cash flows (MOSTCFS) matrix of cash flow amounts. Each row is a list of cash flow values for one instrument. If an instrument has fewer than MOSTCFS cash flows, the end of the row is padded with NaNs.

Data Types: double

Cash flow dates, specified as an NINST-by-MOSTCFS vector using serial date numbers. Each entry contains the date of the corresponding cash flow in CFlowAmounts.

Data Types: double

Settlement date on which the cash flows are priced, specified as a scalar serial date number or date character vector.

Data Types: double | char

(Optional) Day-count basis, specified as scalar or an NINST-by-1 vector.

  • 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

Output Arguments

collapse all

Variable containing a collection of instruments, returned as a structure. Instruments are broken down by type and each type can have different data fields. Each stored data field has a row vector or string for each instrument. For more information on the InstSet variable, see instget.

Name of each data field for a CashFlow instrument, returned as an NFIELDS-by-1 cell array of character vectors.

Data class for each field, returned as an NFIELDS-by-1 cell array of character vectors. The class determines how arguments are parsed. Valid character vectors are 'dble', 'date', and 'char'.

Type of instrument, returned as a character vector. For a CashFlow instrument, TypeString = 'CashFlow'.

Version History

Introduced before R2006a