Next: Cash.help, Previous: Forward.help, Up: Octave octarisk Classes [Contents][Index]
Class for setting up Option objects. Possible underlyings are financial instruments or indizes. Therefore the following Option types are introduced:
In the following, all methods and attributes are explained and a code example is given.
Methods for Option object obj:
Attributes of Option objects:
For illustration see the following example: An American equity Option with 10 years to maturity, an underlying index, a volatility surface and a discount curve are set up and the Option value (123.043), volatility spread and the Greeks are calculated by the Willowtree model and retrieved:
disp('Pricing American Option Object (Willowtree)') c = Curve(); c = c.set('id','IR_EUR','nodes',[730,3650,4380], ... 'rates_base',[0.0001001034,0.0045624391,0.0062559362], ... 'method_interpolation','linear'); v = Surface(); v = v.set('axis_x',3650,'axis_x_name','TERM','axis_y',1.1, ... 'axis_y_name','MONEYNESS'); v = v.set('values_base',0.210360082233); v = v.set('type','IndexVol'); i = Index(); i = i.set('value_base',286.867623322,'currency','USD'); o = Option(); o = o.set('maturity_date','29-Mar-2026','currency','USD', ... 'timesteps_size',5,'willowtree_nodes',30); o = o.set('strike',368.7362,'multiplier',1,'sub_Type','OPT_AM_P'); o = o.set('pricing_function_american','Willowtree'); o = o.calc_value('31-Mar-2016','base',i,c,v); o = o.calc_greeks('31-Mar-2016','base',i,c,v); value_base = o.getValue('base') theo_omega = o.get('theo_omega') disp('Calibrating volatility spread over yield:') o = o.set('value_base',100); o = o.calc_vola_spread('31-Mar-2016',i,c,v); o.getValue('base')
Dependencies of class:
Next: Cash.help, Previous: Forward.help, Up: Octave octarisk Classes [Contents][Index]