crossover(a: Array<number>, b: Array<number>) -> Array<bool>
true
in places where a
crosses over b
. "Crossover" means: a[n] > b[n] && a[n-1] < b[n-1]
.a
and b
must be of the same length.crossunder(a: Array<number>, b: Array<number>) -> Array<bool>
true
in places where a
crosses under b
. "Crossunder" means: a[n] < b[n] && a[n-1] > b[n-1]
.a
and b
must be of the same length.pad(a: Array<number>, n: number, [b]: Array<number>) -> Array<number>
a
, by shifting them n
places to the right. Optionally takes in a parameter b
that will be used to fill in the blank elements at the start of the array (will be filled in with zeroes otherwise).b
is set, it must contain at least n
elements.n
is negative, elements will be shifted to the left instead.local a = {1, 2, 3, 4, 5, 6};
local padded = pad(a, 2);
-- contents of "padded": {0, 0, 1, 2, 3, 4}
local custom_padded = pad(a, 2, {8, 9});
-- contents of "custom_padded": {8, 9, 1, 2, 3, 4}
local leftpadded = pad(a, -2);
-- contents of "leftpadded": {3, 4, 5, 6, 0, 0}
local custom_leftpadded = pad(a, -2, {8, 9})
-- contents of "custom_leftpadded": {3, 4, 5, 6, 8, 9}
ema(a: Array<number>, n: number) -> Array<number>
a
over length n
wma(a: Array<number>, n: number) -> Array<number>
a
over length n
sma(a: Array<number>, n: number) -> Array<number>
a
over length n
rma(a: Array<number>, n: number) -> Array<number>
a
over length n
hullma(a: Array<number>, n: number) -> Array<number>
a
over length n
bb_upper(a: Array<number>, n: number, m: number) -> Array<number>
a
over length n
with multiplier m
bb_lower(a: Array<number>, n: number, m: number) -> Array<number>
a
over length n
with multiplier m
lowest(a: Array<number>, n: number) -> Array<number>
a
over length n
highest(a: Array<number>, n: number) -> Array<number>
a
over length n
stdev(a: Array<number>, n: number) -> Array<number>
a
over length n
ehlers_super_smoother(a: Array<number>, n: number) -> Array<number>
a
over length n
rsi(a: Array<number>, n: number) -> Array<number>
a
over length n
ln(a: Array<number>) -> Array<number>
a
nz(a: Array<number>) -> Array<number>
NaN
values in a
with the number 0
avg(a: Array<Array<number>>) -> Array<number>
local average = avg({a, b, c});
stoch(a: Array<number>, high: Array<number>, low: Array<number>, n: Array<number>) -> Array<number>
100 * (a - lowest(low, n)) / (highest(high, n) - lowest(low, n))