Skip to content

Instantly share code, notes, and snippets.

View NishchalSharma's full-sized avatar

Nishchal Sharma NishchalSharma

  • Kullu Himachal Pradesh India
View GitHub Profile
@NishchalSharma
NishchalSharma / javascript option stuff.js
Last active July 8, 2022 04:50 — forked from aasmith/javascript option stuff.js
black scholes & IV in javascript
/* Returns probability of occuring below and above target price. */
function probability(price, target, days, volatility) {
var p = price;
var q = target;
var t = days / 365;
var v = volatility;
var vt = v*Math.sqrt(t);
var lnpq = Math.log(q/p);
/* Returns probability of occuring below and above target price. */
function probability(price, target, days, volatility) {
var p = price;
var q = target;
var t = days / 365;
var v = volatility;
var vt = v*Math.sqrt(t);
var lnpq = Math.log(q/p);