GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - prodipta/bsoption: Package for option pricing and volatility calibration for index (and FX) options

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
R
R
 
 
data
data
 
 
man
man
 
 
.Rbuildignore
.Rbuildignore
 
 
.gitignore
.gitignore
 
 
DESCRIPTION
DESCRIPTION
 
 
NAMESPACE
NAMESPACE
 
 
README.md
README.md
 
 
bsoption.Rproj
bsoption.Rproj
 
 

Repository files navigation

bsoption

The goal of this R package (bsoption) is to provide a quick platform for pricing index (and currency) exchange traded options. This also include a SABR and quadratic smile volatility calibration method. Also user can extract implied and realized distributions and use a given underlying distribution to price options for relative value analysis.

Installation

You can install bsoption from github with:

# install.packages("devtools")
devtools::install_github("prodipta/bsoption")

Example

This is a basic example which shows you how to calibrate a SABR vol from market prices of options. The dataframe opt_chain is provided with the package:

?opt_chain
sabrVol <- calibrate(opt_chain,as.Date("2017-07-11"),model="sabr")
quadVol <- calibrate(opt_chain,as.Date("2017-07-11"))
k <- seq(90,110,0.5)
vols1 <- getVol(sabrVol,100,k)
vols2 <- getVol(quadVol,100,k)
plot(k,vols1,type="n")
lines(k,vols1,col="red")
lines(k,vols2,col="blue")

Following example shows how to extract implied probability distribution and use that to price an option

voldist <- impliedDistribution(sabrVol)
plot(voldist$k,voldist$p,type="n")
lines(voldist$k,voldist$p,col="blue")
distributionPricer(100,101,voldist,type="call")

Following example shows how to exatract implied volatility and use the main pricing function to price options. These functions can handle fractional day pricing (the date argument should be in POSIX format in YYYY:MM:DD HH:MM).

vol <- bsImpliedVol(as.Date("2017-07-13"),9879.55,10000,as.Date("2017-07-27"),25.40,type="call")
bsPlainVanillaOption(as.Date("2017-07-13"),9879.55,10000,as.Date("2017-07-27"),vol ,type="call")

About

Package for option pricing and volatility calibration for index (and FX) options

Topics

option-pricingsabrvolatility

Resources

Readme
Activity

Stars

8 stars

Watchers

4 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.