Built-In Namespace _global_
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)
Returns the average of the sum of all vector elements
|
|
camarillaPoints(highList, lowList, closeList)
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)
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)
Exponential moving average
|
|
floorPivots(highList, lowList, closeList)
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)
Returns the MACD
|
|
mae(series1, series2)
Returns the MAE erro (mean absolute error)
|
|
max(values)
Max value in a series
|
|
mean(values)
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
|
|
rmse(series1, series2)
Returns the RMSE error (squared MSE)
|
|
roc(closePrices, order)
Returns the Rate of Change value (ROC)
|
|
rsi(closePrices, order)
Returns the RSI (Relative Strength Index)
|
|
sd(values)
Standar deviation of values in a serie.
|
|
sumVector(vector)
Returns the sum of all elements in a vector
|
|
sumWindow(serie)
|
|
tomDemarksPoints(highList, lowList, openList, closeList)
Returns the Tom Demark points, the predicted low and highs
of the period.
|
|
vpt(closeList, volumeList)
Returns the VPT (Volume-price Trend)
|
|
windowOp(values, value, fun)
This is an internal function and is not supposed to be used directly.
|
|
wma(series, weights)
Weighted moving average.
|
|
woodiesPoints(highList, lowList, closeList)
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.
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.
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)
Returns the average of the sum of all vector elements
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} vector
- values array
- Returns:
- {value} the average of the all elements
camarillaPoints(highList, lowList, closeList)
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.
Defined in: trendyways.js.
- Parameters:
- highList
- lowList
- closeList
{array}
combineVectors(serie1, serie2, fun)
Combine two vectors using the provided function.
Both series must have the same length.
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} serie1
- {array} serie2
- {function} fun
- Returns:
- {array} values fun(serie1, serie2)
{array}
diffVectors(series1, series2)
Returns a vector containing the difference of the parameters.
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} series1
- first values array
- {array} series2
- second values array
- Returns:
- {array} series1 - series2
{array}
divVector(v1, v2)
Returns the values of the first vector divided by the second
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} v1
- values array
- {array} v2
- values array
- Returns:
- {array} v1 / v2
ema(serie, period)
Exponential moving average
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- serie
- period
floorPivots(highList, lowList, closeList)
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.
Defined in: trendyways.js.
- Parameters:
- highList
- lowList
- closeList
{object}
macd(closePrices)
Returns the MACD
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} closePrices
- list of closing prices
- Returns:
- {object} object containing the macd, signal and hist series.
mae(series1, series2)
Returns the MAE erro (mean absolute error)
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- series1
- series2
{value}
max(values)
Max value in a series
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- values
- Returns:
- {value} the max element in the series
{value}
mean(values)
Mean of values in a serie
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} values
- array of numerical values
- Returns:
- {value} mean of the series
{value}
mfi(highPrices, lowPrices, closePrices, volumes)
Returns the Money-flow Index
Defined in: trendyways.js.
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.
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.
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.
Defined in: trendyways.js.
- Parameters:
- series1
- series2
{array}
obv(closeList, volumeList)
On-Balance Volume (obv).
Defined in: trendyways.js.
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.
Defined in: trendyways.js.
- Parameters:
- {array} serie
- values array
- Returns:
- {array} values array ^ 2
rmse(series1, series2)
Returns the RMSE error (squared MSE)
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- series1
- series2
{array}
roc(closePrices, order)
Returns the Rate of Change value (ROC)
Defined in: trendyways.js.
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
- Returns:
- {array} list containing the ROC series
{array}
rsi(closePrices, order)
Returns the RSI (Relative Strength Index)
Defined in: trendyways.js.
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)
Standar deviation of values in a serie.
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} values
- array of numerical values
- Returns:
- {value} standard deviation of the series values.
{value}
sumVector(vector)
Returns the sum of all elements in a vector
Defined in: trendyways.js.
Defined in: trendyways.js.
- Parameters:
- {array} vector
- values array
- Returns:
- {value} the sum of all elements
sumWindow(serie)
Defined in: trendyways.js.
- Parameters:
- serie
tomDemarksPoints(highList, lowList, openList, closeList)
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.
Defined in: trendyways.js.
- Parameters:
- highList
- lowList
- openList
- closeList
{array}
vpt(closeList, volumeList)
Returns the VPT (Volume-price Trend)
Defined in: trendyways.js.
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)
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.
Defined in: trendyways.js.
- Parameters:
- {array} values
- values array
- {value} value
- size of the window
- {function} fun
- function to apply on each chunk
- Returns:
- {array} values returned by the given function in each chunck
wma(series, weights)
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.
Defined in: trendyways.js.
- Parameters:
- series
- weights
woodiesPoints(highList, lowList, closeList)
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.
Defined in: trendyways.js.
- Parameters:
- highList
- lowList
- closeList