Financial Derivatives Toolbox    
instaddfield

Add new instruments to an instrument collection

Syntax

Arguments

FieldList
String or number of fields (NFIELDS)-by-1 cell array of strings listing the name of each data field. FieldList cannot be named with the reserved names Type or Index.
DataList
Number of instruments (NINST)-by-M array or NFIELDS-by-1 cell array of data contents for each field. Each row in a data array corresponds to a separate instrument. Single rows are copied to apply to all instruments to be worked on. The number of columns is arbitrary, and data is padded along columns.
ClassList
(Optional) String or NFIELDS-by-1 cell array of strings listing the data class of each field. The class determines how DataList is parsed. Valid strings are 'dble', 'date', and 'char'. The 'FieldClass', ClassList pair is always optional. ClassList is inferred from existing fieldnames or from the data if not entered.
TypeString
String specifying the type of instrument added. Instruments of different types can have different fieldname collections.
InstSet
Variable containing a collection of instruments. Instruments are classified by type; each type can have different data fields. The stored data field is a row vector or string for each instrument.

Description

Use instaddfield to create your own types of instruments or to append new instruments to an existing collection. Argument value pairs can be entered in any order.

InstSet = instaddfield('FieldName', FieldList, 'FieldClass', ClassList, 'Data', DataList, 'Type', TypeString) create an instrument variable.

InstSetNew = instaddfield(InstSet, 'FieldName', FieldList, 'Data', DataList,'Type',TypeString) adds instruments to an existing instrument set, InstSet. The output InstSetNew is a new instrument set containing the input data.

Examples

Build a portfolio around July options.

Enter three call options with data fields Strike, Price, and Opt.

Add a futures contract and set the input parsing class.

Add a put option.

Make a placeholder for another put.

Add a cash instrument.

See Also

instdisp, instget, instgetcell, instsetfield


  instadd instbond