Skip to main content

Interface: IContext

Charting Library.IContext

PineJS execution context.

Properties

symbol

symbol: ISymbolInstrument

Symbol Instrument

Methods

is_main_symbol

is_main_symbol(symbol): boolean

Checks if symbol is the main symbol

Parameters

NameTypeDescription
symbolISymbolInstrumentsymbol to check

Returns

boolean

true if symbol is the main symbol


new_ctx

new_ctx(): IContext

Creates a new context

Returns

IContext


new_sym

new_sym(tickerid, period, currencyCode?, unitId?, subsessionId?): ISymbolInstrument

Load a new symbol for the custom indicator

Parameters

NameTypeDescription
tickeridstringSymbol identifier
periodstringperiod for the new symbol
currencyCode?string-
unitId?string-
subsessionId?string-

Returns

ISymbolInstrument


new_unlimited_var

new_unlimited_var(value?): IPineSeries

Creates an in-memory temporary storage with unlimited depth.

Parameters

NameType
value?number

Returns

IPineSeries


new_var

new_var(value?): IPineSeries

Creates an in-memory temporary storage with depth defined by the first call new_var(value).get(n)

Parameters

NameType
value?number

Returns

IPineSeries


select_sym

select_sym(i): void

Switch context to the other symbol received through IContext.new_sym

Parameters

NameTypeDescription
inumberthe index of the symbol (0 for the main series)

Returns

void