timeframe
The chart timeframe.
#Functions
#timeframe.changefunction
true on the first bar of a new period of the timeframe.
timeframe.change(timeframe: simple string): bool| Parameter | Type | Description |
|---|---|---|
timeframe | simple string | A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's. |
Returns bool.
Example
const newDay = timeframe.change("1D")Since ChartScript 1
#timeframe.from_secondsfunction
The timeframe string for a number of seconds.
timeframe.from_seconds(seconds: simple int): string| Parameter | Type | Description |
|---|---|---|
seconds | simple int | A number of seconds. |
Returns string.
Example
const tf = timeframe.from_seconds(3600)Since ChartScript 1
#timeframe.in_secondsfunction
The length of a timeframe in seconds.
timeframe.in_seconds({ timeframe?: string = "" }): int| Parameter | Type | Description |
|---|---|---|
timeframe | stringdefault "" | A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's. |
Returns int.
Example
const s = timeframe.in_seconds("60")Since ChartScript 1
#Variables
#timeframe.isdailyvariable
true for day timeframes.
timeframe.isdaily: boolType simple bool.
Example
const v = timeframe.isdailySince ChartScript 1
#timeframe.isdwmvariable
true for day, week and month timeframes.
timeframe.isdwm: boolType simple bool.
Example
const v = timeframe.isdwmSince ChartScript 1
#timeframe.isintradayvariable
true below one day.
timeframe.isintraday: boolType simple bool.
Example
const v = timeframe.isintradaySince ChartScript 1
#timeframe.isminutesvariable
true for minute timeframes.
timeframe.isminutes: boolType simple bool.
Example
const v = timeframe.isminutesSince ChartScript 1
#timeframe.ismonthlyvariable
true for month timeframes.
timeframe.ismonthly: boolType simple bool.
Example
const v = timeframe.ismonthlySince ChartScript 1
#timeframe.issecondsvariable
true for second timeframes.
timeframe.isseconds: boolType simple bool.
Example
const v = timeframe.issecondsSince ChartScript 1
#timeframe.isticksvariable
true for tick charts (never on ChartDeck).
timeframe.isticks: boolType simple bool.
Example
const v = timeframe.isticksSince ChartScript 1
#timeframe.isweeklyvariable
true for week timeframes.
timeframe.isweekly: boolType simple bool.
Example
const v = timeframe.isweeklySince ChartScript 1
#timeframe.main_periodvariable
The chart timeframe, also inside a request.
timeframe.main_period: stringType simple string.
Example
const v = timeframe.main_periodSince ChartScript 1
#timeframe.multipliervariable
The number in the timeframe (60 for "60", 1 for "1D").
timeframe.multiplier: intType simple int.
Example
const v = timeframe.multiplierSince ChartScript 1
#timeframe.periodvariable
The chart timeframe ("60", "1D" ...).
timeframe.period: stringType simple string.
Example
const v = timeframe.periodSince ChartScript 1