Skip to content

Commit

Permalink
docs: Small adjustments to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Martin authored and umamialex committed Oct 29, 2015
1 parent ebb46e8 commit 6c66888
Show file tree
Hide file tree
Showing 24 changed files with 3,488 additions and 17 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
financier
Financier
=========

A Node.js module that helps with calculations concerning stocks and portfolios.

## Introduction

Financier is a simple, object-oriented way of managing a portfolio. This module
was built to calculate the risk in the Bridge Jump Portfolio Management game.
Financier is a simple, object-oriented way of managing a portfolio.
Please feel free to request any features. Code contributions are always welcome!

## Mirrors
[Bitbucket](https://bitbucket.org/suitupalex/financier) | [Github](https://github.com/suitupalex/financier)

## Installation

Expand All @@ -22,7 +25,7 @@ var Portfolio = financier.Portfolio;
```

## Usage
Here is an example featuring comprehensive usage of financier.
Here is an example featuring comprehensive usage of Financier.

```js
// Load financier.
Expand Down Expand Up @@ -60,7 +63,8 @@ var securities = [
{
stock: stocks.AIG,
value: 630.99,
}, {
},
{
stock: stocks.C,
value: 902.11
}
Expand Down Expand Up @@ -99,8 +103,8 @@ market value. (Initialized when added to a portfolio.)

#### Stock.push(_Float_ open, _Float_ close, _Boolean_ _[Opt]_ wait)
Add a tick of data to the stock history. This new return is stored in
`Stock.returns`. Default behaviour immediately recalculates
the overall average on returns.
`Stock.returns`. Default behaviour immediately recalculates the overall average on
returns.

The parameters `open` and `close` are `floats` representing the price of the stock.
If `wait` is `true`, the average is not calculated.
Expand All @@ -115,7 +119,7 @@ AAPL.push(106.5, 112.3);
Calculate the average of all the returns. This new average is both returned and
stored in `Stock.average`.

It is only necesarry to call this function if you are adding returns in bulk.
It is only necessary to call this function if you are adding returns in bulk.

```js
function randomValue() {
Expand Down Expand Up @@ -144,7 +148,7 @@ var clientPortfolio = new Portfolio();

* __stocks__ - `Object` Stocks included in the portfolio.
* __value__ - `Float` Total market value for the stock.
* __risk__ - `Flat` Risk for the entire portfolio.
* __risk__ - `Float` Risk for the entire portfolio.
* __cache__ - `Cache` Cache of portfolio securities.

#### Portfolio.addStock(_Stock_ stock, _Float_ value, _Boolean_ _[Opt]_ clone)
Expand Down Expand Up @@ -202,10 +206,10 @@ is called.

#### Portfolio.calculateWeights()
Calculate and update `Stock.weight` for all securities in the portfolio. This
function is called whenever a securities in the portfolio are altered.
function is called whenever securities in the portfolio are altered.

#### _Float_ Portfolio.calculateCovariance(_Stock_ stockA, _Stock_ stockB)
Calculate the coveriance between two stocks. If `stockA` and `stockB` are the same
Calculate the covariance between two stocks. If `stockA` and `stockB` are the same
instance of `Stock` the function returns 1 by definition.

While it is better to create a `Portfolio` to calculate covariance, this function can
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions node_modules/sylvester/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions node_modules/sylvester/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

219 changes: 219 additions & 0 deletions node_modules/sylvester/README.rdoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions node_modules/sylvester/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions node_modules/sylvester/lib/node-sylvester/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c66888

Please sign in to comment.