Next: Position.help, Previous: CapFloor.help, Up: Octave octarisk Classes [Contents][Index]
Class for setting up various Bond objects. Cash flows are generated specific for each Bond sub type and subsequently discounted to calculate the Bond value. All bonds can have embedded options (Option pricing according to Hull-White model).
In the following, all methods and attributes are explained and a code example is given.
Methods for Bond object obj:
Attributes of Bond objects:
For illustration see the following example: A 9 month floating rate note instrument will be calibrated and priced. The resulting spread over yield value (0.00398785481397732), base value (99.7917725092950) and effective duration (3.93109370316470e-005)is retrieved:
disp('Pricing Floating Rate Bond Object and calculating sensitivities') b = Bond(); b = b.set('Name','Test_FRN','coupon_rate',0.00,'value_base',99.7527, ... 'coupon_generation_method','backward','compounding_type','simple'); b = b.set('maturity_date','30-Mar-2017','notional',100, ... 'compounding_type','simple','issue_date','21-Apr-2011'); b = b.set('term',3,'term_unit','months','last_reset_rate',-0.0024,'sub_Type','FRN','spread',0.003); r = Curve(); r = r.set('id','REF_IR_EUR','nodes',[30,91,365,730], ... 'rates_base',[0.0001002740,0.0001002740,0.0001001390,0.0001000690], ... 'method_interpolation','linear'); b = b.rollout('base',r,'30-Jun-2016'); c = Curve(); c = c.set('id','IR_EUR','nodes',[30,90,180,365,730], ... 'rates_base',[0.0019002740,0.0019002740,0.0019002301,0.0019001390,0.001900069], ... 'method_interpolation','linear'); b = b.set('clean_value_base',99.7527,'spread',0.003); b = b.calc_spread_over_yield('30-Jun-2016',c); b.get('soy') b = b.calc_value('30-Jun-2016','base',c); b.getValue('base') b = b.calc_sensitivities('30-Jun-2016',c,r); b.get('eff_duration')
Dependencies of class:
Next: Position.help, Previous: CapFloor.help, Up: Octave octarisk Classes [Contents][Index]