Script Engine Std Library
Collection of standard TA (technical analysis) functions.
Functions
- prop(name, descr)
Declare new script property
- autoPrec() ⇒
number Get precision of ohlc dataset
- ts(x) ⇒
TS Creates a new time-series & records each x. Returns an array. Id is auto-genrated
- tstf(x, tf) ⇒
TS Creates a new time-series & records each x. Uses Sampler to aggregate the values Return the an array. Id is auto-genrated
- sample(x, type, tf) ⇒
TS Creates a new custom sampler. Return the an array. Id is auto-genrated
- nz(x, [v]) ⇒
* Replaces the variable if it's NaN
- na(x) ⇒
boolean Is the variable NaN ?
- nf(x, [v]) ⇒
* Replaces the var with NaN if Infinite
- add(x, y) ⇒
TS Adds values / time-series
- sub(x, y) ⇒
TS Subtracts values / time-series
- mult(x, y) ⇒
TS Multiplies values / time-series
- div(x, y) ⇒
TS Divides values / time-series
- neg(x) ⇒
TS Returns a negative value / time-series
- abs(x) ⇒
number Absolute value
- acos(x) ⇒
number Arccosine function
- signal(type, data)
Emits an event to DataCube
- signalif(cond, type, data)
Emits an event if cond === true
- alma(src, len, offset, sigma) ⇒
TS Arnaud Legoux Moving Average
- asin(x) ⇒
number Arcsine function
- atan(x) ⇒
number Arctangent function
- atr(len) ⇒
TS Average True Range
- avg(...args) ⇒
number Average of arguments
- since(cond)
Candles since the event occured (cond === true)
- bb(src, len, mult) ⇒
Array.<TS> Bollinger Bands
- bbw(src, len, mult) ⇒
TS Bollinger Bands Width
- bool(x) ⇒
number Converts the variable to Boolean
- cci(src, len) ⇒
TS Commodity Channel Index
- ceil(x) ⇒
number Shortcut for Math.ceil()
- change(src, [len]) ⇒
TS Change: x[0] - x[len]
- cmo(src, len) ⇒
TS Chande Momentum Oscillator
- cog(src, len) ⇒
TS Center of Gravity
- cos(x) ⇒
number Cosine function
- cross(src1, src2) ⇒
TS When one time-series crosses another
- crossover(src1, src2) ⇒
TS When one time-series goes over another one
- crossunder(src1, src2) ⇒
TS When one time-series goes under another one
- cum(src1) ⇒
TS Sum of all elements of src
- dayofmonth([time]) ⇒
number Day of month, literally
- dayofweek([time]) ⇒
number Day of week, literally
- dev(src, len) ⇒
TS Deviation from SMA
- dmi(len, smooth) ⇒
TS Directional Movement Index ADX, +DI, -DI
- ema(src, len) ⇒
TS Exponential Moving Average with alpha = 2 / (y + 1)
- exp(x) ⇒
number Shortcut for Math.exp()
- falling(src, len) ⇒
TS Test if "src" TS is falling for "len" candles
- fixnan(src) ⇒
TS For a given series replaces NaN values with previous nearest non-NaN value
- floor(x) ⇒
number Shortcut for Math.floor()
- highest(src, len) ⇒
TS Highest value for a given number of candles back
- highestbars(src, len)
Highest value offset for a given number of bars back
- hma(src, len) ⇒
TS Hull Moving Average
- hour([time]) ⇒
number Returns hours of a given timestamp
- iff(cond, x, y) ⇒
* Returns x or y depending on the condition
- kc(src, len, mult, [use_tr]) ⇒
Array.<TS> Keltner Channels
- kcw(src, len, mult, [use_tr]) ⇒
TS Keltner Channels Width
- linreg(src, len, offset) ⇒
TS Linear Regression
- log(x) ⇒
number Shortcut for Math.log()
- log10(x) ⇒
number Shortcut for Math.log10()
- lowest(src, len) ⇒
TS Lowest value for a given number of candles back
- lowestbars(src, len)
Lowest value offset for a given number of bars back
- macd(src, fast, slow, sig) ⇒
Array.<TS> Moving Average Convergence/Divergence
- max(...args) ⇒
number Max of arguments
- modify(id, fields)
Sends update to some overlay / main chart
- buffsize(src, len)
Sets the reverse buffer size for a given time-series (default = 5, grows on demand)
- mfi(src, len) ⇒
TS Money Flow Index
- min(...args) ⇒
number Min of arguments
- minute([time]) ⇒
number Returns minutes of a given timestamp
- mom(src, len) ⇒
TS Momentum
- month([time]) ⇒
number Month
- chart(x, [sett])
Display data point as the main chart
- onclose(tf) ⇒
boolean Returns true when the candle(tf) is being closed (create a new overlay in DataCube)
- settings(upd)
Sends settings update (can be called from init(), update() or post())
- offset(num) ⇒
TS Shifts TS left or right by "num" candles
- now() ⇒
number The current time
- pivothigh(src, left, right) ⇒
TS Returns price of the pivot high point Tip: works best with
offsetfunction- pivotlow(src, left, right) ⇒
TS Returns price of the pivot low point Tip: works best with
offsetfunction- pow(x) ⇒
number Shortcut for Math.pow()
- rising(src, len) ⇒
TS Test if "src" TS is rising for "len" candles
- rma(src, len) ⇒
TS Exponentially MA with alpha = 1 / length Used in RSI
- roc(src, len) ⇒
TS Rate of Change
- round(x) ⇒
number Shortcut for Math.round()
- rsi(x, y) ⇒
TS Relative Strength Index
- sar(start, inc, max) ⇒
TS Parabolic SAR
- second([time]) ⇒
number Returns seconds of a given timestamp
- sign(x) ⇒
number Shortcut for Math.sing()
- sin(x) ⇒
number Sine function
- sma(src, len) ⇒
TS Simple Moving Average
- sqrt(x) ⇒
number Shortcut for Math.sqrt()
- stdev(src, len) ⇒
TS Standard deviation
- stoch(src, high, low, len) ⇒
TS Stochastic
- sum(src, len) ⇒
TS Returns the sliding sum of last "len" values of the source
- supertrend(factor, atrlen) ⇒
Array.<TS> Supertrend Indicator
- swma(src) ⇒
TS Symmetrically Weighted Moving Average
- sym(x, y) ⇒
Sym Creates a new Symbol.
- tan(x) ⇒
number Tangent function
- tr(fixnan) ⇒
TS True Range
- tsi(src, short, long) ⇒
TS True strength index
- view(name, props)
Create a new View
- vwma(src, len) ⇒
TS Volume Weighted Moving Average
- weekofyear([time]) ⇒
number Week of year, literally
- wma(src, len) ⇒
TS Weighted moving average
- wpr(len) ⇒
TS Williams %R
- year([time]) ⇒
number Year
prop
prop(name, descr)
Declare new script property
Kind: global function
| Param | Type | Description |
|---|---|---|
| name | string | Propery name |
| descr | string | Propery descriptor |
autoPrec
autoPrec() ⇒ number
Get precision of ohlc dataset
Kind: global function
Returns: number - - Ohlc preciosion
ts
ts(x) ⇒ TS
Creates a new time-series & records each x. Returns an array. Id is auto-genrated
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | * | A variable to sample from |
tstf
tstf(x, tf) ⇒ TS
Creates a new time-series & records each x. Uses Sampler to aggregate the values Return the an array. Id is auto-genrated
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | * | A variable to sample from |
| tf | number | string | Timeframe in ms or as a string |
sample
sample(x, type, tf) ⇒ TS
Creates a new custom sampler. Return the an array. Id is auto-genrated
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | * | A variable to sample from |
| type | string | Sampler type |
| tf | number | string | Timeframe in ms or as a string |
nz
nz(x, [v]) ⇒ *
Replaces the variable if it's NaN
Kind: global function
Returns: * - - New value
| Param | Type | Description |
|---|---|---|
| x | * | The variable |
| [v] | * | A value to replace with |
na
na(x) ⇒ boolean
Is the variable NaN ?
Kind: global function
Returns: boolean - - New value
| Param | Type | Description |
|---|---|---|
| x | * | The variable |
nf
nf(x, [v]) ⇒ *
Replaces the var with NaN if Infinite
Kind: global function
Returns: * - - New value
| Param | Type | Description |
|---|---|---|
| x | * | The variable |
| [v] | * | A value to replace with |
add
add(x, y) ⇒ TS
Adds values / time-series
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | TS | * | First input |
| y | TS | * | Second input |
sub
sub(x, y) ⇒ TS
Subtracts values / time-series
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | TS | * | First input |
| y | TS | * | Second input |
mult
mult(x, y) ⇒ TS
Multiplies values / time-series
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | TS | * | First input |
| y | TS | * | Second input |
div
div(x, y) ⇒ TS
Divides values / time-series
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | TS | * | First input |
| y | TS | * | Second input |
neg
neg(x) ⇒ TS
Returns a negative value / time-series
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | TS | * | Input |
abs
abs(x) ⇒ number
Absolute value
Kind: global function
Returns: number - - Absolute value
| Param | Type | Description |
|---|---|---|
| x | number | Input |
acos
acos(x) ⇒ number
Arccosine function
Kind: global function
Returns: number - - Arccosine of x
| Param | Type | Description |
|---|---|---|
| x | number | Input |
signal
signal(type, data)
Emits an event to DataCube
Kind: global function
| Param | Type | Description |
|---|---|---|
| type | string | Signal type |
| data | * | Signal data |
signalif
signalif(cond, type, data)
Emits an event if cond === true
Kind: global function
| Param | Type | Description |
|---|---|---|
| cond | boolean | TS | The condition |
| type | string | Signal type |
| data | * | Signal data |
alma
alma(src, len, offset, sigma) ⇒ TS
Arnaud Legoux Moving Average
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
| offset | number | Offset |
| sigma | number | Sigma |
asin
asin(x) ⇒ number
Arcsine function
Kind: global function
Returns: number - - Arcsine of x
| Param | Type | Description |
|---|---|---|
| x | number | Input |
atan
atan(x) ⇒ number
Arctangent function
Kind: global function
Returns: number - - Arctangent of x
| Param | Type | Description |
|---|---|---|
| x | number | Input |
atr
atr(len) ⇒ TS
Average True Range
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| len | number | Length |
avg
avg(...args) ⇒ number
Average of arguments
Kind: global function
| Param | Type | Description |
|---|---|---|
| ...args | number | Numeric values |
since
since(cond)
Candles since the event occured (cond === true)
Kind: global function
| Param | Type | Description |
|---|---|---|
| cond | boolean | TS | the condition |
bb
bb(src, len, mult) ⇒ Array.<TS>
Bollinger Bands
Kind: global function
Returns: Array.<TS> - - Array of new time-series (3 bands)
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
| mult | number | Multiplier |
bbw
bbw(src, len, mult) ⇒ TS
Bollinger Bands Width
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
| mult | number | Multiplier |
bool
bool(x) ⇒ number
Converts the variable to Boolean
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
cci
cci(src, len) ⇒ TS
Commodity Channel Index
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
ceil
ceil(x) ⇒ number
Shortcut for Math.ceil()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
change
change(src, [len]) ⇒ TS
Change: x[0] - x[len]
Kind: global function
Returns: TS - - New time-series
| Param | Type | Default | Description |
|---|---|---|---|
| src | TS | Input | |
| [len] | number | 1 | Length |
cmo
cmo(src, len) ⇒ TS
Chande Momentum Oscillator
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
cog
cog(src, len) ⇒ TS
Center of Gravity
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
cos
cos(x) ⇒ number
Cosine function
Kind: global function
Returns: number - - Cosine of x
| Param | Type | Description |
|---|---|---|
| x | number | Input |
cross
cross(src1, src2) ⇒ TS
When one time-series crosses another
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src1 | TS | TS1 |
| src2 | TS | TS2 |
crossover
crossover(src1, src2) ⇒ TS
When one time-series goes over another one
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src1 | TS | TS1 |
| src2 | TS | TS2 |
crossunder
crossunder(src1, src2) ⇒ TS
When one time-series goes under another one
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src1 | TS | TS1 |
| src2 | TS | TS2 |
cum
cum(src1) ⇒ TS
Sum of all elements of src
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src1 | TS | Input |
dayofmonth
dayofmonth([time]) ⇒ number
Day of month, literally
Kind: global function
Returns: number - - Day
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
dayofweek
dayofweek([time]) ⇒ number
Day of week, literally
Kind: global function
Returns: number - - Day
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
dev
dev(src, len) ⇒ TS
Deviation from SMA
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
dmi
dmi(len, smooth) ⇒ TS
Directional Movement Index ADX, +DI, -DI
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| len | number | Length |
| smooth | number | Smoothness |
ema
ema(src, len) ⇒ TS
Exponential Moving Average with alpha = 2 / (y + 1)
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
exp
exp(x) ⇒ number
Shortcut for Math.exp()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
falling
falling(src, len) ⇒ TS
Test if "src" TS is falling for "len" candles
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
fixnan
fixnan(src) ⇒ TS
For a given series replaces NaN values with previous nearest non-NaN value
Kind: global function
| Param | Type | Description |
|---|---|---|
| src | TS | Input time-series |
floor
floor(x) ⇒ number
Shortcut for Math.floor()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
highest
highest(src, len) ⇒ TS
Highest value for a given number of candles back
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
highestbars
highestbars(src, len)
Highest value offset for a given number of bars back
Kind: global function
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
hma
hma(src, len) ⇒ TS
Hull Moving Average
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
hour
hour([time]) ⇒ number
Returns hours of a given timestamp
Kind: global function
Returns: number - - Hour
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
iff
iff(cond, x, y) ⇒ *
Returns x or y depending on the condition
Kind: global function
| Param | Type | Description |
|---|---|---|
| cond | boolean | TS | Condition |
| x | * | Frist value |
| y | * | Second value |
kc
kc(src, len, mult, [use_tr]) ⇒ Array.<TS>
Keltner Channels
Kind: global function
Returns: Array.<TS> - - Array of new time-series (3 bands)
| Param | Type | Default | Description |
|---|---|---|---|
| src | TS | Input | |
| len | number | Length | |
| mult | number | Multiplier | |
| [use_tr] | boolean | true | Use true range |
kcw
kcw(src, len, mult, [use_tr]) ⇒ TS
Keltner Channels Width
Kind: global function
Returns: TS - - New time-series
| Param | Type | Default | Description |
|---|---|---|---|
| src | TS | Input | |
| len | number | Length | |
| mult | number | Multiplier | |
| [use_tr] | boolean | true | Use true range |
linreg
linreg(src, len, offset) ⇒ TS
Linear Regression
Kind: global function
Returns: TS - - New time-series
| Param | Type | Default | Description |
|---|---|---|---|
| src | TS | Input | |
| len | number | Length | |
| offset | number | 0 | Offset |
log
log(x) ⇒ number
Shortcut for Math.log()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
log10
log10(x) ⇒ number
Shortcut for Math.log10()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
lowest
lowest(src, len) ⇒ TS
Lowest value for a given number of candles back
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
lowestbars
lowestbars(src, len)
Lowest value offset for a given number of bars back
Kind: global function
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
macd
macd(src, fast, slow, sig) ⇒ Array.<TS>
Moving Average Convergence/Divergence
Kind: global function
Returns: Array.<TS> - - [macd, signal, hist]
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| fast | number | Fast EMA |
| slow | number | Slow EMA |
| sig | number | Signal |
max
max(...args) ⇒ number
Max of arguments
Kind: global function
| Param | Type | Description |
|---|---|---|
| ...args | number | Numeric values |
modify
modify(id, fields)
Sends update to some overlay / main chart
Kind: global function
| Param | Type | Description |
|---|---|---|
| id | string | Overlay id |
| fields | Object | Fields to be overwritten |
buffsize
buffsize(src, len)
Sets the reverse buffer size for a given time-series (default = 5, grows on demand)
Kind: global function
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | New length |
mfi
mfi(src, len) ⇒ TS
Money Flow Index
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
min
min(...args) ⇒ number
Min of arguments
Kind: global function
| Param | Type | Description |
|---|---|---|
| ...args | number | Numeric values |
minute
minute([time]) ⇒ number
Returns minutes of a given timestamp
Kind: global function
Returns: number - - Hour
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
mom
mom(src, len) ⇒ TS
Momentum
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
month
month([time]) ⇒ number
Month
Kind: global function
Returns: number - - Day
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
chart
chart(x, [sett])
Display data point as the main chart
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | TS | Array.<TS> | * | Data point / TS / array of TS |
| [sett] | Object | Object with settings & OV type |
onclose
onclose(tf) ⇒ boolean
Returns true when the candle(tf) is being closed (create a new overlay in DataCube)
Kind: global function
| Param | Type | Description |
|---|---|---|
| tf | number | string | Timeframe in ms or as a string |
settings
settings(upd)
Sends settings update (can be called from init(), update() or post())
Kind: global function
| Param | Type | Description |
|---|---|---|
| upd | Object | Settings update (object to merge) |
offset
offset(num) ⇒ TS
Shifts TS left or right by "num" candles
Kind: global function
Returns: TS - - New / existing time-series
| Param | Type | Description |
|---|---|---|
| num | number | Offset measured in candles |
now
now() ⇒ number
The current time
Kind: global function
Returns: number - - timestamp
pivothigh
pivothigh(src, left, right) ⇒ TS
Returns price of the pivot high point Tip: works best with offset function
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| left | number | left threshold, candles |
| right | number | right threshold, candles |
pivotlow
pivotlow(src, left, right) ⇒ TS
Returns price of the pivot low point Tip: works best with offset function
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| left | number | left threshold, candles |
| right | number | right threshold, candles |
pow
pow(x) ⇒ number
Shortcut for Math.pow()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
rising
rising(src, len) ⇒ TS
Test if "src" TS is rising for "len" candles
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
rma
rma(src, len) ⇒ TS
Exponentially MA with alpha = 1 / length Used in RSI
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
roc
roc(src, len) ⇒ TS
Rate of Change
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
round
round(x) ⇒ number
Shortcut for Math.round()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
rsi
rsi(x, y) ⇒ TS
Relative Strength Index
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| x | TS | First Input |
| y | number | TS | Second Input |
sar
sar(start, inc, max) ⇒ TS
Parabolic SAR
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| start | number | Start |
| inc | number | Increment |
| max | number | Maximum |
second
second([time]) ⇒ number
Returns seconds of a given timestamp
Kind: global function
Returns: number - - Hour
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
sign
sign(x) ⇒ number
Shortcut for Math.sing()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
sin
sin(x) ⇒ number
Sine function
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
sma
sma(src, len) ⇒ TS
Simple Moving Average
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
sqrt
sqrt(x) ⇒ number
Shortcut for Math.sqrt()
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
stdev
stdev(src, len) ⇒ TS
Standard deviation
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
stoch
stoch(src, high, low, len) ⇒ TS
Stochastic
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| high | TS | TS of high |
| low | TS | TS of low |
| len | number | Length |
sum
sum(src, len) ⇒ TS
Returns the sliding sum of last "len" values of the source
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | Length |
supertrend
supertrend(factor, atrlen) ⇒ Array.<TS>
Supertrend Indicator
Kind: global function
Returns: Array.<TS> - - Supertrend line and direction of trend
| Param | Type | Description |
|---|---|---|
| factor | number | ATR multiplier |
| atrlen | number | Length of ATR |
swma
swma(src) ⇒ TS
Symmetrically Weighted Moving Average
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
sym
sym(x, y) ⇒ Sym
Creates a new Symbol.
Kind: global function
Returns: Sym - Argument variations: data(Array), [params(Object)] ts(TS), [params(Object)] point(Number), [params(Object)] tf(String) 1m, 5m, 1H, etc. (uses main OHLCV) Params object: { id: String, tf: String|Number, aggtype: String (TODO: Type of aggregation) format: String (Data format, e.g. "time:price:vol") window: String|Number (Aggregation window) main true|false (Use as the main chart) }
| Param | Type | Description |
|---|---|---|
| x | * | Something, depends on arg variation |
| y | * | Something, depends on arg variation |
tan
tan(x) ⇒ number
Tangent function
Kind: global function
| Param | Type | Description |
|---|---|---|
| x | number | The variable |
tr
tr(fixnan) ⇒ TS
True Range
Kind: global function
Returns: TS - - New time-series
| Param | Type | Default | Description |
|---|---|---|---|
| fixnan | TS | false | Fix NaN values |
tsi
tsi(src, short, long) ⇒ TS
True strength index
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| short | number | Short length |
| long | number | Long length |
view
view(name, props)
Create a new View
Kind: global function
| Param | Type | Description |
|---|---|---|
| name | string | View name |
| props | object | View properties |
vwma
vwma(src, len) ⇒ TS
Volume Weighted Moving Average
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | length |
weekofyear
weekofyear([time]) ⇒ number
Week of year, literally
Kind: global function
Returns: number - - Week
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |
wma
wma(src, len) ⇒ TS
Weighted moving average
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| src | TS | Input |
| len | number | length |
wpr
wpr(len) ⇒ TS
Williams %R
Kind: global function
Returns: TS - - New time-series
| Param | Type | Description |
|---|---|---|
| len | number | length |
year
year([time]) ⇒ number
Year
Kind: global function
Returns: number - - Year
| Param | Type | Description |
|---|---|---|
| [time] | number | Time in ms (current t, if not defined) |