Skip to content

Commit

Permalink
Some definition from
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal66 committed Aug 21, 2016
1 parent 84d98ba commit cbd3f2b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion methods/indicators/SMA.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
// required indicators
/**
* The first value for the Smoothed Moving Average is calculated as a Simple Moving Average (SMA):
SUM1=SUM (CLOSE, N)
SMMA1 = SUM1/ N
The second and subsequent moving averages are calculated according to this formula:
SMMA (i) = (SUM1 – SMMA1+CLOSE (i))/ N
Where:
SUM1 – is the total sum of closing prices for N periods;
SMMA1 – is the smoothed moving average of the first bar;
SMMA (i) – is the smoothed moving average of the current bar (except the first one);
CLOSE (i) – is the current closing price;
N – is the smoothing period.
*/

// required indicators
var Indicator = function(weight) {
this.weight = weight;
this.prices = [];
Expand Down

0 comments on commit cbd3f2b

Please sign in to comment.