This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = { | |
max: function(array) { | |
return Math.max.apply(null, array); | |
}, | |
min: function(array) { | |
return Math.min.apply(null, array); | |
}, | |
range: function(array) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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); |