Skip to content

JavaScript library for Options valuation

License

Notifications You must be signed in to change notification settings

avoyager/joptions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

joptions

JavaScript library for Options pricing (Black-Scholes, Garman-Kohlhagen models)

  • Call and put prices for
    • regular options
    • binary options
    • currency options
  • Greeks
  • Implied volatility
var option = { type: 'c', S: 75, X: 90, T: 0.8, r: 0.02, volatility: 0.2 };
var callPrice = joptions.regular.price(option);
var option = { type: 'p', S: 175, X: 90, T: 0.5, r: 0.02, volatility: 0.35 };
var putPrice = joptions.binary.price(option);
var option = { type: 'c', S: 1.56, X: 1.6, T: 0.5, r: 0.06, rf: 0.08, volatility: 0.12 };
var callPrice = joptions.currency.price(option);
var option = { S: 75, X: 90, T: 0.8, r: 0.02, volatility: 0.2 };
var gamma = joptions.greeks.gamma(option);
var vega = joptions.greeks.vega(option);
var option = { type: 'p', S: 100, X: 95, P: 11.10, T: 0.5, r: 0.03 };
var impliedVolatility = joptions.volatility.implied(option);

About

JavaScript library for Options valuation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 100.0%