Skip to content

Instantly share code, notes, and snippets.

View ceoaliongroo's full-sized avatar

Carlos Mantilla ceoaliongroo

View GitHub Profile
/* 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);