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, subsessionId?: string) => ISymbolInstrument
Parameters
Name | Type | Description |
---|---|---|
tickerid | string | Symbol identifier |
period | string | period for the new symbol |
currencyCode? | string | Currency code |
unitId? | string | Unit ID |
subsessionId? | string | Subsession ID |
Returns
new_unlimited_var
Creates an in-memory temporary storage with unlimited depth.
Signature
new_unlimited_var(value?: number) => IPineSeries
Parameters
Name | Type | Description |
---|---|---|
value? | number | variable's value |
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 | Description |
---|---|---|
value? | number | variable's value |
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
setMinimumAdditionalDepth
Allows the minimum depth to be forced.
Signature
setMinimumAdditionalDepth(value: number) => void
Parameters
Name | Type | Description |
---|---|---|
value | number | minimum depth to set |
Returns
void