[R-SIG-Finance] Barrier options
Samuel Le
Samuel.Le at srlglobal.com
Wed Nov 3 14:02:08 CET 2010
My quick and dirty way to compute the Greeks: the finite difference method.
For example to compute the Delta:
epsilon<-0.001
x1<-BarrierOption(barrType="downin", type="call", underlying=100+epsilon,strike=100, dividendYield=0.02, riskFreeRate=0.03,maturity=0.5, volatility=0.4, barrier=90)
x2<-BarrierOption(barrType="downin", type="call", underlying=100-epsilon,strike=100, dividendYield=0.02, riskFreeRate=0.03,maturity=0.5, volatility=0.4, barrier=90)
delta<-(x1-x2)/(2*epsilon)
You might want to create a wrapper function that would call the RQuantLib function BarrierOption, get the price, compute the Greeks by finite difference, and wraps everything into a data.frame / S4 object of the same format as the RQuantLib function.
Samuel
-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Megh
Sent: 03 November 2010 12:53
To: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Barrier options
Thanks everyone for showing interest on my problem. On installing QL I feel
some problems are there for vista+2.12.0 combination. I could install
perfectly in xp+2.10.1 machine without any problem. However I used rmetrics
package for valuation of barrier option.
But in fExoticOptions package there seems to be no option to find greeks of
barrier option. BarrierOption() function of RQuantLib() has option for
sensitivity as well, however all the examples I have tried give NaN value
for sensitivity:
> BarrierOption(barrType="downin", type="call", underlying=100,
+ strike=100, dividendYield=0.02, riskFreeRate=0.03,
+ maturity=0.5, volatility=0.4, barrier=90)
Concise summary of valuation for BarrierOption
value delta gamma vega theta rho divRho
3.7383 NaN NaN NaN NaN NaN NaN
Can anyone help me to calculate greeks as well for Barrier option?
Thanks,
--
View this message in context: http://r.789695.n4.nabble.com/Barrier-options-tp3021886p3025292.html
Sent from the Rmetrics mailing list archive at Nabble.com.
_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5587 (20101103) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5587 (20101103) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
More information about the R-SIG-Finance
mailing list