0.1.2 • Published 9 years ago
quantlib.js v0.1.2
QuantLib in Pure JavaScript

This project is still at very early stage, DO Expect Bugs
Template classes, enumerations will be added for later
Getting started
npm install quantlib.jsor
bower install quantlib.jsUsage
Load the library
- Browser
$ql will be created after loading js file
- Node.js
var $ql = require('quantlib.js');
Class
class names are same as QuantLib project.
use new to create object
// create a new Matrix object
var m1 = new $ql.Matrix({
"rows":6,
"columns":9
});> m1
Matrix { ptr: 13611328 }
> m1.rows();
6
> m1.columns();
9Function Overloading
Function names are same as QuantLib, and all functions takes one parameter: opts
If function has no paramter, just call it without paramter, otherwise pass a JSON object to the function, in this object put paramter: value elements, the paramter name must match QuantLib functions.
Inheritance
// Calendar is TARGET's base class
var tgt = new $ql.TARGET();
var d = new $ql.Date({"d":19,"m":3,"y":2014});
// calling menthods from base class
tgt.isHoliday({"d":d});
tgt.isBusinessday({"d":d});