Skip to content

Option pricing library for q by KX, includes implementations for Black Scholes, Monte Carlo, Cox-Ross-Rubenstein binomial and Garman–Kohlhagen models.

License

Notifications You must be signed in to change notification settings

jamiedumbill/q-option-pricing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

q-option-pricing

Option pricing library for q by KX, includes implementations for:

  • Black Scholes
  • Monte Carlo
  • Cox-Ross-Rubenstein binomial
  • Garman–Kohlhagen

Get Started

Install kdb+ from kx.com and rlwrap

Move to the q-option-pricing directory

cd ./q-option-pricing/

Start q (example for macOS)

rlwap ~/q/m64/q

Load the library

\l ./loadall.q

Examples of calculating the price of a call

q).bs.c.price[420;420.04;0.8;0.17;0.05]
34.02261
q).mc.c.price[420;420.04;0.8;0.17;0.05;1000]
33.89279
q).crr.c.price[420;420.04;0.8;0.17;0.05;1000]
34.01666

HTTP

Start a web server on port 5000

\p 5000

Using http server

About

Option pricing library for q by KX, includes implementations for Black Scholes, Monte Carlo, Cox-Ross-Rubenstein binomial and Garman–Kohlhagen models.

Topics

Resources

License

Stars

Watchers

Forks

Languages