quantlib.js

0.1.2 • Public • Published

QuantLib in Pure JavaScript npm version Bower version Twitter Follow

This project is still at very early stage, DO Expect Bugs

Template classes, enumerations will be added for later

Getting started

npm install quantlib.js

or

bower install quantlib.js

Usage

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();
9

Function 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});

Readme

Keywords

Package Sidebar

Install

npm i quantlib.js

Weekly Downloads

0

Version

0.1.2

License

MIT

Last publish

Collaborators

  • quantlab
  • jerryyangjin