Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the wallstreetflets Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 18:14:32 2021 GMT+0.
• Introduction | What wallstreetflets is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
wallstreetflets (wsf) is a utility library to compute the so-called Greeks and other properties of derivative securities (specifically options) using the Black-Scholes model.
The meat and potatoes of the library are two functions:
compute-greeks
which takes certain parameters that one can scrape from most finance sites and computes the greeks for the specified option and returns them as a plist; andprint-greeks
which takes the plist and prints it in a readable form to stdoutAt the time of writing, MSFT is trading at $212.65 per share and the 19 Feb $190 Put has 33 days to expiry with an implied volatility of 35.19%. To compute the Greeks for this put:
CL-USER> (wsf:compute-greeks 0.3519 190 212.65 33 t)
(:DELTA -0.13178630823047255d0 :GAMMA 0.009490863086237849d0 :VEGA
0.13654531297316355d0 :THETA -0.0727376753241109d0 :RHO
-0.026847670995063383d0)
CL-USER>
One of the inputs to the Black-Scholes model is the "risk-free rate" which is a theoretical value. Customarily for US securities the interest rate on a US Treasury Bill with the same maturity is used as a proxy. Wallstreetflets scrapes data from the US Treasury website to calculate the risk-free rate, but in the event the website cannot be reached or scraped, a fallback rate of 0.1% is used.
Users can configure this fallback rate with the exported symbol *fallback-rate*
.
There might be bugs herein that might cost you money. Before investing carry out your own due diligence, including on the source code of this library.
I develop primarily on/for SBCL and occasionally test this code on CCL. No other Common Lisp implementations are tested but pull requests are welcome.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The wallstreetflets system |
Nathan Van Ymeren <nathan.vany@gmail.com>
GPL v3
Wall Street FLETs: A library for calculating Options Greeks
1.0
wallstreetflets.asd (file)
wallstreetflets.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The wallstreetflets.asd file | ||
• The wallstreetflets/wallstreetflets.lisp file |
Next: The wallstreetflets/wallstreetflets․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
wallstreetflets.asd
wallstreetflets (system)
Previous: The wallstreetflets․asd file, Up: Lisp files [Contents][Index]
wallstreetflets (system)
wallstreetflets.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The wallstreetflets package |
Wall Street FLETs: Calculate Options Greeks based on scraped data
wallstreetflets.lisp (file)
wsf
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
wallstreetflets.lisp (file)
Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Computes the Greeks for the given Option, as specified by the arguments, and returns them as a plist. The final argument is optional and if set to T (true) will compute a Put option, otherwise a Call is assumed. For a function that prints the calculated Greeks to stdout see PRINT-GREEKS
wallstreetflets.lisp (file)
Computes the Greeks for the given Option and prints them to stdout. If you want to consume this info programmatically then you probably want the function COMPUTE-GREEKS
wallstreetflets.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
Previous: Internal special variables, Up: Internal definitions [Contents][Index]
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
Scrapes US Treasury Bond yields for interpolation in another function
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
Numeric approximation of the CDF of a gaussian/normal distribution
wallstreetflets.lisp (file)
PDF of the Standard Gaussian/Normal distribution
wallstreetflets.lisp (file)
Expects a time-to-maturity/days-to-expiry value in calendar days
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
Trapezoidal integral approximation
wallstreetflets.lisp (file)
wallstreetflets.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L W |
---|
Jump to: | F L W |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A C D F G I L P R T V |
---|
Jump to: | A C D F G I L P R T V |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S W |
---|
Jump to: | P S W |
---|