# option-pricing-tree

> Option pricing with tri/bi-nomial tree

Latest version **1.0.1** (published 2018-05-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install option-pricing-tree
pnpm add option-pricing-tree
yarn add option-pricing-tree
bun add option-pricing-tree
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-05-09 |
| First published | 2018-05-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 46.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Calvin Lai |
| Maintainers | calvinkit620 |

## Links

- npm: https://www.npmjs.com/package/option-pricing-tree
- Repository: https://calvinkit@github.com/calvinkit/tree
- Homepage: https://github.com/calvinkit/tree#readme
- Issues: https://github.com/calvinkit/tree/issues
- npm.io page: https://npm.io/package/option-pricing-tree

## Recent versions

- 1.0.1 (latest) — 2018-05-09
- 1.0.0 — 2018-05-02

## README

<div align="center">
<h1>option-pricing-tree</h1>
<a href="https://npmjs.com/package/option-pricing-tree">
<img src="https://img.shields.io/npm/v/option-pricing-tree.svg" alt="npm version" />
</a>
<a href="https://npmjs.com/package/option-pricing-tree">
<img src="https://img.shields.io/npm/dt/option-pricing-tree.svg" alt="npm downloads" />
</a>
<br/>
<br/>
<p>
option-pricing-tree is a JavaScript module for pricing options using bi/tri-nomial tree under black scholes assumption.
</p>
</div>

## Option Pricing
This module implement the bi/tri nomial tree pricing, under log normal black scholes model/assumption. 

## Installation
This module works on node and in the browser. It is available as the 'option-pricing-tree' package on [npm](https://www.npmjs.com/package/option-pricing-tree).

### npm

```
npm install option-pricing-tree
```

## Usage

```javascript
var Tree = require('option-pricing-tree');
var tree = new Tree('trinomial','european','call',1,100,100,0.1,0);
var value = tree.build(1000);
```

Data can be passed into the model as an points array, or as xArray, yArray. The last (2nd or 3rd, depends on what's the input format) parameter can be used to configure the model. 
For details, please consult regression package documentation.


## API

### `new Tree(tree_type, exercise_style, option_type, expiry_in_years, strike, underlying, vol, rate)`
- `tree_type`: Either binomial, or trinomial
- `exercise_style`: Either european or american
- `option_type`: Either call, put, or straddle
- `expiry_in_years`: Eg. 1 for 1y, or 0.5 for 6 months
- `strike`: Strike of the option 
- `underlying`: Underlying price 
- `vol`: (Implied) Annualized log-normal volatility
- `rate`: Risk-free rate

---
_Source: https://npm.io/package/option-pricing-tree · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
