PineJSStd
Integration guide ยท Reference index
Public contract reference. This declaration describes types and callback shapes; availability is constrained by the linked integration guide and the runtime capability. Legacy product-specific fields are not a promise of implementation.
max_series_default_size
max_series_default_size: 10001;Use the type signature above and the integration guide for the owning capability.
eps
eps(): number;Use the type signature above and the integration guide for the owning capability.
high
high(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
low
low(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
open
open(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
close
close(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
ohlc4
ohlc4(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
volume
volume(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time
time(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time (overload 2)
time(context: IContext, period: string, spec: unknown): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
period | string | Yes |
spec | unknown | Yes |
hl2
hl2(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
hlc3
hlc3(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
period
period(context: IContext): string;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
tickerid
tickerid(context: IContext): string;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
year
year(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
month
month(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
weekofyear
weekofyear(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
dayofmonth
dayofmonth(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
dayofweek
dayofweek(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
hour
hour(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
minute
minute(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
second
second(context: IContext, time?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
time | number | No |
greaterOrEqual
greaterOrEqual(n1: number, n2: number, eps?: number): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eps | number | No |
lessOrEqual
lessOrEqual(n1: number, n2: number, eps?: number): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eps | number | No |
equal
equal(n1: number, n2: number, eps?: number): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eps | number | No |
greater
greater(n1: number, n2: number, eps?: number): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eps | number | No |
less
less(n1: number, n2: number, eps?: number): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eps | number | No |
compare
compare(n1: number, n2: number, eps?: number): -1 | 0 | 1;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eps | number | No |
ge
ge(n1: number, n2: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
le
le(n1: number, n2: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
eq
eq(n1: number, n2: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
neq
neq(n1: number, n2: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
gt
gt(n1: number, n2: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
lt
lt(n1: number, n2: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n1 | number | Yes |
n2 | number | Yes |
iff
iff(condition: number, thenValue: number, elseValue: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
condition | number | Yes |
thenValue | number | Yes |
elseValue | number | Yes |
tr
tr(n_handleNaN: number | undefined, ctx: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_handleNaN | number | undefined | Yes |
ctx | IContext | Yes |
atr
atr(length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
length | number | Yes |
context | IContext | Yes |
isdwm
isdwm(context: IContext): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
isintraday
isintraday(context: IContext): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
isdaily
isdaily(context: IContext): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
isweekly
isweekly(context: IContext): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
ismonthly
ismonthly(context: IContext): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
selectSessionBreaks
selectSessionBreaks(context: IContext, times: number[]): number[];Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
times | number[] | Yes |
createNewSessionCheck
createNewSessionCheck(context: IContext): (time: number) => boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
error
error(message: string): never;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
message | string | Yes |
zigzag
zigzag(n_deviation: number, n_depth: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_deviation | number | Yes |
n_depth | number | Yes |
context | IContext | Yes |
zigzagbars
zigzagbars(n_deviation: number, n_depth: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_deviation | number | Yes |
n_depth | number | Yes |
context | IContext | Yes |
updatetime
updatetime(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
ticker
ticker(context: IContext): string;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
percentrank
percentrank(source: IPineSeries, length: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
rising
rising(series: IPineSeries, length: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
series | IPineSeries | Yes |
length | number | Yes |
falling
falling(series: IPineSeries, length: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
series | IPineSeries | Yes |
length | number | Yes |
rsi
rsi(upper: number, lower: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
upper | number | Yes |
lower | number | Yes |
sum
sum(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
sma
sma(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
smma
smma(n_value: number, n_length: number, ctx: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_value | number | Yes |
n_length | number | Yes |
ctx | IContext | Yes |
rma
rma(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
ema
ema(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
wma
wma(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
vwma
vwma(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
swma
swma(source: IPineSeries, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
context | IContext | Yes |
fixnan
fixnan(n_current: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_current | number | Yes |
context | IContext | Yes |
lowestbars
lowestbars(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
lowest
lowest(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
highestbars
highestbars(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
highest
highest(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
cum
cum(n_value: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_value | number | Yes |
context | IContext | Yes |
accdist
accdist(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
correlation
correlation(
sourceA: IPineSeries,
sourceB: IPineSeries,
length: number,
context: IContext,
): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
sourceA | IPineSeries | Yes |
sourceB | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
stoch
stoch(
source: IPineSeries,
high: IPineSeries,
low: IPineSeries,
length: number,
context: IContext,
): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
high | IPineSeries | Yes |
low | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
tsi
tsi(
source: IPineSeries,
shortLength: number,
longLength: number,
context: IContext,
): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
shortLength | number | Yes |
longLength | number | Yes |
context | IContext | Yes |
cross
cross(n_0: number, n_1: number, context: IContext): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_0 | number | Yes |
n_1 | number | Yes |
context | IContext | Yes |
linreg
linreg(source: IPineSeries, length: number, offset: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
offset | number | Yes |
sar
sar(start: number, inc: number, max: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
start | number | Yes |
inc | number | Yes |
max | number | Yes |
context | IContext | Yes |
alma
alma(
series: IPineSeries,
length: number,
offset: number,
sigma: number,
): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
series | IPineSeries | Yes |
length | number | Yes |
offset | number | Yes |
sigma | number | Yes |
change
change(source: IPineSeries): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
roc
roc(source: IPineSeries, length: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
dev
dev(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
stdev
stdev(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
variance
variance(source: IPineSeries, length: number, context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
source | IPineSeries | Yes |
length | number | Yes |
context | IContext | Yes |
add_days_considering_dst
add_days_considering_dst(
timezone: string,
utcTime: Date,
daysCount: number,
): Date;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
timezone | string | Yes |
utcTime | Date | Yes |
daysCount | number | Yes |
add_years_considering_dst
add_years_considering_dst(
timezone: string,
utcTime: Date,
yearsCount: number,
): Date;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
timezone | string | Yes |
utcTime | Date | Yes |
yearsCount | number | Yes |
dmi
dmi(
diLength: number,
adxSmoothingLength: number,
context: IContext,
): [number, number, number, number, number];Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
diLength | number | Yes |
adxSmoothingLength | number | Yes |
context | IContext | Yes |
na
na(n?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n | number | No |
nz
nz(x: number, y?: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
y | number | No |
and
and(n_0: number, n_1: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_0 | number | Yes |
n_1 | number | Yes |
or
or(n_0: number, n_1: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_0 | number | Yes |
n_1 | number | Yes |
not
not(n_0: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
n_0 | number | Yes |
max
max(...values: number[]): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
values | number[] | Yes |
min
min(...values: number[]): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
values | number[] | Yes |
pow
pow(base: number, exponent: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
base | number | Yes |
exponent | number | Yes |
abs
abs(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
log
log(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
log10
log10(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
sqrt
sqrt(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
sign
sign(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
exp
exp(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
sin
sin(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
cos
cos(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
tan
tan(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
asin
asin(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
acos
acos(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
atan
atan(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
floor
floor(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
ceil
ceil(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
round
round(x: number): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
x | number | Yes |
avg
avg(...values: number[]): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
values | number[] | Yes |
n
n(context: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
context | IContext | Yes |
isZero
isZero: (v: number) => number;Use the type signature above and the integration guide for the owning capability.
toBool
toBool(v: number): boolean;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
v | number | Yes |
currencyCode
currencyCode(ctx: IContext): string | null | undefined;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
ctx | IContext | Yes |
unitId
unitId(ctx: IContext): string | null | undefined;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
ctx | IContext | Yes |
interval
interval(ctx: IContext): number;Use the type signature above and the integration guide for the owning capability.
| Parameter | Type | Required |
|---|---|---|
ctx | IContext | Yes |