Class Index | File Index

Classes


Built-In Namespace _global_

Method Summary
Method Attributes Method Name and Description
 
absVector(vector)
Returns the vector containing absolutes values of the input
 
atr(values)
Returns the ATR (Average True Value).
 
avgVector(vector, targetAttr)
Returns the average of the sum of all vector elements
 
Returns the Camarilla points: supports (s1,s2,3 and s4)) and resistance values (r1, r2, r3 and r4).
 
combineVectors(serie1, serie2, fun)
Combine two vectors using the provided function.
 
diffVectors(series1, series2, targetAttr)
Returns a vector containing the difference of the parameters.
 
divVector(v1, v2)
Returns the values of the first vector divided by the second
 
ema(serie, period, targetAttr, newAttr)
Exponential moving average
 
floorPivots(values)
Returns the Floor pivot level, three support levels (s1,s2 and s3) and three resistance levels (r1, r2 and r3) of the given data series.
 
macd(closePrices, targetAttr)
Returns the MACD
 
mae(series1, series2)
Returns the MAE erro (mean absolute error)
 
max(values)
Max value in a series
 
mean(values, targetAttr)
Mean of values in a serie
 
mfi(highPrices, lowPrices, closePrices, volumes)
Returns the Money-flow Index
 
min(values)
Min value in a series
 
momentum(closePrices, order)
Returns the Momentum
 
mse(series1, series2)
Returns the MSE error of two series
 
obv(closeList, volumeList)
On-Balance Volume (obv).
 
powVector(serie)
Returns a vector to the 2nd power
 
resolveParam(objects, list)
This is an internal function and is not supposed to be used directly.
 
rmse(series1, series2)
Returns the RMSE error (squared MSE)
 
roc(closePrices, order, targetAttr)
Returns the Rate of Change value (ROC)
 
rsi(closePrices, order)
Returns the RSI (Relative Strength Index)
 
sd(values, targetAttr)
Standar deviation of values in a serie.
 
sumVector(vector, targetAttr)
Returns the sum of all elements in a vector
 
sumWindow(serie)
 
Returns the Tom Demark points, the predicted low and highs of the period.
 
valueIfUndef(object, value)
returns the given value if the object is undefined
 
vpt(closeList, volumeList)
Returns the VPT (Volume-price Trend)
 
windowOp(values, value, fun, targetAttr)
This is an internal function and is not supposed to be used directly.
 
wma(series, weights, targetAttr)
Weighted moving average.
 
woodiesPoints(values)
Returns the Woodies points: pivot, supports (s1 and s2) and resistance values (r1 and r2).
Method Detail
{array} absVector(vector)
Returns the vector containing absolutes values of the input
Defined in: trendyways.js.
Parameters:
{array} vector
values array
Returns:
{array} the absolute values of the given array

{array} atr(values)
Returns the ATR (Average True Value). ATR is provided after 14th element.
Defined in: trendyways.js.
var atr = atr ([{high:48.7, low:45.3, close:46}, ...])
console.log(atr)  // [{tr:2.4, atr:0}, ... 13 empty atr's, ... ,{atr:_value_, tr:_value_} ]
Parameters:
{array} values
containing {high,low,close}
Returns:
{array} list containing {tr,atr} values for each period.

{value} avgVector(vector, targetAttr)
Returns the average of the sum of all vector elements
Defined in: trendyways.js.
Parameters:
{array} vector
values array
targetAttr
Returns:
{value} the average of the all elements

camarillaPoints(values)
Returns the Camarilla points: supports (s1,s2,3 and s4)) and resistance values (r1, r2, r3 and r4). These values for a given day are calculated based on the day before so expect n values as output for a given list of n days. Note that the three lists must have the same length. Params: - higList: list of high values - lowList: list of low values - closeList: list of closing values The result is a list of elements with fields: - s1: predicted s1 support. - s2: predicted s2 support. - s3: predicted s3 support. - s4: predicted s4 support. - r1: predicted r1 resistance. - r2: predicted r2 resistance. - r3: predicted r3 resistance. - r4: predicted r4 resistance.
Defined in: trendyways.js.
Parameters:
values

{array} combineVectors(serie1, serie2, fun)
Combine two vectors using the provided function. Both series must have the same length.
Defined in: trendyways.js.
Parameters:
{array} serie1
{array} serie2
{function} fun
Returns:
{array} values fun(serie1, serie2)

{array} diffVectors(series1, series2, targetAttr)
Returns a vector containing the difference of the parameters.
Defined in: trendyways.js.
Parameters:
{array} series1
first values array
{array} series2
second values array
targetAttr
Returns:
{array} series1 - series2

{array} divVector(v1, v2)
Returns the values of the first vector divided by the second
Defined in: trendyways.js.
Parameters:
{array} v1
values array
{array} v2
values array
Returns:
{array} v1 / v2

ema(serie, period, targetAttr, newAttr)
Exponential moving average
Defined in: trendyways.js.
Parameters:
serie
period
targetAttr
newAttr

floorPivots(values)
Returns the Floor pivot level, three support levels (s1,s2 and s3) and three resistance levels (r1, r2 and r3) of the given data series. These values for a given day are calculated based on the day before so expect n values as output for a given list of n days. Note that all three must have the same length. Params: - higList: list of high values - lowList: list of low values - cliseList: list of closing values The result is a list of elements with fields: - r3: resistence third level - r2: resistance second level - r1: resistance first level - pl: pivot level - s3: support third level - s2: support second level - s1: support first level
Defined in: trendyways.js.
Parameters:
values

{object} macd(closePrices, targetAttr)
Returns the MACD
Defined in: trendyways.js.
Parameters:
{array} closePrices
list of closing prices
targetAttr
Returns:
{object} object containing the macd, signal and hist series.

mae(series1, series2)
Returns the MAE erro (mean absolute error)
Defined in: trendyways.js.
Parameters:
series1
series2

{value} max(values)
Max value in a series
Defined in: trendyways.js.
Parameters:
values
Returns:
{value} the max element in the series

{value} mean(values, targetAttr)
Mean of values in a serie
Defined in: trendyways.js.
Parameters:
{array} values
array of numerical values
targetAttr
Returns:
{value} mean of the series

{value} mfi(highPrices, lowPrices, closePrices, volumes)
Returns the Money-flow Index
Defined in: trendyways.js.
Parameters:
{array} highPrices
list of high prices
{array} lowPrices
list of low prices
{array} closePrices
list of closing prices
{array} volumes
list of volumes
Returns:
{value} the money-flow index

{value} min(values)
Min value in a series
Defined in: trendyways.js.
Parameters:
{array} values
array of numerical values
Returns:
{value} min value in the series

{array} momentum(closePrices, order)
Returns the Momentum
Defined in: trendyways.js.
var m = momemtum ([12,34,23, 81], 1) 
console.log(m)  // [22, -11, 58]
Parameters:
{array} closePrices
list of closing prices
{value} order
order of the momentum
Returns:
{array} list containing the momentum series

mse(series1, series2)
Returns the MSE error of two series
Defined in: trendyways.js.
Parameters:
series1
series2

{array} obv(closeList, volumeList)
On-Balance Volume (obv).
Defined in: trendyways.js.
Parameters:
{array} closeList
list of closing prices
{array} volumeList
list of volumes
Returns:
{array} the OBV values list

{array} powVector(serie)
Returns a vector to the 2nd power
Defined in: trendyways.js.
Parameters:
{array} serie
values array
Returns:
{array} values array ^ 2

{value} resolveParam(objects, list)
This is an internal function and is not supposed to be used directly. This function moves the window of size value along the values, applying the defined function on each chunk.
Defined in: trendyways.js.
Parameters:
{object} objects
list
{attrs} list
of attributes to look for
Returns:
{value} object attribute

rmse(series1, series2)
Returns the RMSE error (squared MSE)
Defined in: trendyways.js.
Parameters:
series1
series2

{array} roc(closePrices, order, targetAttr)
Returns the Rate of Change value (ROC)
Defined in: trendyways.js.
var roc = roc ([12, 11, 15, 10], 1) 
console.log(roc)  // [-0.09, 0.36, -0.33]
Parameters:
{array} closePrices
list of closing prices
{value} order
order of the ROC
targetAttr
Returns:
{array} list containing the ROC series

{array} rsi(closePrices, order)
Returns the RSI (Relative Strength Index)
Defined in: trendyways.js.
var rsi = rsi ([45.34, 44, ..., 42,9, 45.23], 14) 
console.log(rsi)  // [70.53, 66.32, ..., 56.05]
Parameters:
{array} closePrices
list of closing prices
{value} order
RSI order (typically 14)
Returns:
{array} list containing the RSI for each period

{value} sd(values, targetAttr)
Standar deviation of values in a serie.
Defined in: trendyways.js.
Parameters:
{array} values
array of numerical values
targetAttr
Returns:
{value} standard deviation of the series values.

{value} sumVector(vector, targetAttr)
Returns the sum of all elements in a vector
Defined in: trendyways.js.
Parameters:
{array} vector
values array
targetAttr
Returns:
{value} the sum of all elements

sumWindow(serie)

Defined in: trendyways.js.
Parameters:
serie

tomDemarksPoints(values)
Returns the Tom Demark points, the predicted low and highs of the period. These values for a given day are calculated based on the day before so expect n values as output for a given list of n days. Note that three lists must have the same length. Params: - higList: list of high values - lowList: list of low values - cliseList: list of closing values The result is a list of elements with fields: - low: predicted low value. - high: predicted high value.
Defined in: trendyways.js.
Parameters:
values

valueIfUndef(object, value)
returns the given value if the object is undefined
Defined in: trendyways.js.
Parameters:
{obj} object
to check
{val} value
to return

{array} vpt(closeList, volumeList)
Returns the VPT (Volume-price Trend)
Defined in: trendyways.js.
Parameters:
{array} closeList
list of closing prices
{array} volumeList
list of volume
Returns:
{array} vpt values array

{array} windowOp(values, value, fun, targetAttr)
This is an internal function and is not supposed to be used directly. This function moves the window of size value along the values, applying the defined function on each chunk.
Defined in: trendyways.js.
Parameters:
{array} values
values array
{value} value
size of the window
{function} fun
function to apply on each chunk
targetAttr
Returns:
{array} values returned by the given function in each chunck

wma(series, weights, targetAttr)
Weighted moving average. The order of the mean (the number of elements to sum) is based on the weight's length. The sum of weights should be 1.
Defined in: trendyways.js.
Parameters:
series
weights
targetAttr

woodiesPoints(values)
Returns the Woodies points: pivot, supports (s1 and s2) and resistance values (r1 and r2). These values for a given day are calculated based on the day before so expect n values as output for a given list of n days. Note that the three lists must have the same length. Params: - higList: list of high values - lowList: list of low values - closeList: list of closing values The result is a list of elements with fields: - pivot: predicted pivot value. - s1: predicted support (s1). - r1: predicted resistance (r1). - r2: predicted secondary resistance (r2). - s2: predicted secondary support (s2).
Defined in: trendyways.js.
Parameters:
values

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Sep 25 2017 06:29:52 GMT+0100 (IST)