Skip to content
ChartDeck ChartScript docs Account Open the terminal

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
ParameterTypeDescription
timeframesimple stringA timeframe such as "60", "240", "1D" or "1W"; "" is the chart's.

Returns bool.

Example

ChartScriptFragmentOpen in editor
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
ParameterTypeDescription
secondssimple intA number of seconds.

Returns string.

Example

ChartScriptFragmentOpen in editor
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
ParameterTypeDescription
timeframestringdefault ""A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's.

Returns int.

Example

ChartScriptFragmentOpen in editor
const s = timeframe.in_seconds("60")

Since ChartScript 1

#Variables

#timeframe.isdailyvariable

true for day timeframes.

timeframe.isdaily: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isdaily

Since ChartScript 1

#timeframe.isdwmvariable

true for day, week and month timeframes.

timeframe.isdwm: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isdwm

Since ChartScript 1

#timeframe.isintradayvariable

true below one day.

timeframe.isintraday: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isintraday

Since ChartScript 1

#timeframe.isminutesvariable

true for minute timeframes.

timeframe.isminutes: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isminutes

Since ChartScript 1

#timeframe.ismonthlyvariable

true for month timeframes.

timeframe.ismonthly: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.ismonthly

Since ChartScript 1

#timeframe.issecondsvariable

true for second timeframes.

timeframe.isseconds: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isseconds

Since ChartScript 1

#timeframe.isticksvariable

true for tick charts (never on ChartDeck).

timeframe.isticks: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isticks

Since ChartScript 1

#timeframe.isweeklyvariable

true for week timeframes.

timeframe.isweekly: bool

Type simple bool.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.isweekly

Since ChartScript 1

#timeframe.main_periodvariable

The chart timeframe, also inside a request.

timeframe.main_period: string

Type simple string.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.main_period

Since ChartScript 1

#timeframe.multipliervariable

The number in the timeframe (60 for "60", 1 for "1D").

timeframe.multiplier: int

Type simple int.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.multiplier

Since ChartScript 1

#timeframe.periodvariable

The chart timeframe ("60", "1D" ...).

timeframe.period: string

Type simple string.

Example

ChartScriptFragmentOpen in editor
const v = timeframe.period

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.