IContext
Interface
PineJS execution context.
Properties
symbol
Symbol Instrument
Type
Methods
is_main_symbol
Checks if symbol is the main symbol
Signature
is_main_symbol(symbol: ISymbolInstrument) => boolean
Parameters
| Name | Type | Description | 
|---|---|---|
| symbol | ISymbolInstrument | symbol to check | 
Returns
true  if symbol is the main symbol
boolean
new_ctx
Creates a new context
Signature
new_ctx() => IContext
Returns
new_sym
Load a new symbol for the custom indicator
Signature
new_sym(tickerid: string, period: string, currencyCode?: string, unitId?: string) => ISymbolInstrument
Parameters
| Name | Type | Description | 
|---|---|---|
| tickerid | string | Symbol identifier | 
| period | string | period for the new symbol | 
| currencyCode? | string | - | 
| unitId? | string | - | 
Returns
new_unlimited_var
Creates an in-memory temporary storage with unlimited depth.
Signature
new_unlimited_var(value?: number) => IPineSeries
Parameters
| Name | Type | 
|---|---|
| value? | number | 
Returns
new_var
Creates an in-memory temporary storage with depth defined by the first call new_var(value).get(n)
Signature
new_var(value?: number) => IPineSeries
Parameters
| Name | Type | 
|---|---|
| value? | number | 
Returns
select_sym
Switch context to the other symbol received through IContext.new_sym
Signature
select_sym(i: number) => void
Parameters
| Name | Type | Description | 
|---|---|---|
| i | number | the index of the symbol (0 for the main series) | 
Returns
void