Skip to content
ChartDeck ChartScript docs Account Open the terminal

request

Other timeframes and markets.

#Functions

#request.livefunction

Whether that context updates live: false when the plan's live-market limit refused its live channel (it then updates when its bar closes). Empty market / timeframe = the chart's.

request.live({ market?: string = "", timeframe?: string = "" }): bool
ParameterTypeDescription
marketstringdefault ""The market (VENUE:SYMBOL); empty = the chart's.
timeframestringdefault ""The timeframe; empty = the chart's.

Returns bool.

Example

ChartScriptFragmentOpen in editor
const live = request.live("BINANCE:ETHUSDT", "60")

Since ChartScript 1

#request.lower_tffunction

The expression on each lower-timeframe bar inside the chart bar (an array, oldest first).

request.lower_tf(timeframe: string, expression: T, { calc_bars_count?: const int = na }): array<T>
ParameterTypeDescription
timeframestringA timeframe such as "60", "240", "1D" or "1W"; "" is the chart's.
expressionTThe expression evaluated in the requested context.
calc_bars_countconst intdefault naAt least this many bars of the requested timeframe (a constant number, up to 20,000), so a path-dependent expression (zones, pivots, counters) gets the same history whatever the chart shows. On the chart's own market and timeframe, more bars than the script runs on give the request its own deeper history. Requests of one market and timeframe share a context and its largest depth. On request.lower_tf and request.market_lower_tf it is how far back the lower-timeframe bars reach.

Returns array<T>.

Example

ChartScriptFragmentOpen in editor
const inner = request.lower_tf("1", close)

Since ChartScript 1

#request.marketfunction

The expression evaluated on another market (VENUE:SYMBOL); an unknown market gives na.

request.market(market: string, timeframe: string, expression: T, { at?: simple string = request.close, gaps?: simple bool = false, calc_bars_count?: const int = na }): T
ParameterTypeDescription
marketstringA market as VENUE:SYMBOL.
timeframestringA timeframe such as "60", "240", "1D" or "1W"; "" is the chart's.
expressionTThe expression evaluated in the requested context.
atsimple stringdefault request.closeWhen a value is taken: request.close (default, never repaints), request.start, request.developing or request.bar_close (the original platform's lookahead off).
gapssimple booldefault falsetrue: the value only on the bar where it changes; false: carried forward.
calc_bars_countconst intdefault naAt least this many bars of the requested timeframe (a constant number, up to 20,000), so a path-dependent expression (zones, pivots, counters) gets the same history whatever the chart shows. On the chart's own market and timeframe, more bars than the script runs on give the request its own deeper history. Requests of one market and timeframe share a context and its largest depth. On request.lower_tf and request.market_lower_tf it is how far back the lower-timeframe bars reach.

Returns T.

Example

ChartScriptFragmentOpen in editor
const eth = request.market("BINANCE:ETHUSDT", "", close)

Since ChartScript 1

#request.market_lower_tffunction

The expression on each bar of another market (VENUE:SYMBOL) at a lower timeframe inside the chart bar (an array, oldest first): Binance 1-minute candles on a MEXC chart. Empty market = the chart's.

request.market_lower_tf(market: string, timeframe: string, expression: T, { calc_bars_count?: const int = na }): array<T>
ParameterTypeDescription
marketstringA market as VENUE:SYMBOL.
timeframestringA timeframe such as "60", "240", "1D" or "1W"; "" is the chart's.
expressionTThe expression evaluated in the requested context.
calc_bars_countconst intdefault naAt least this many bars of the requested timeframe (a constant number, up to 20,000), so a path-dependent expression (zones, pivots, counters) gets the same history whatever the chart shows. On the chart's own market and timeframe, more bars than the script runs on give the request its own deeper history. Requests of one market and timeframe share a context and its largest depth. On request.lower_tf and request.market_lower_tf it is how far back the lower-timeframe bars reach.

Returns array<T>.

Example

ChartScriptFragmentOpen in editor
const binanceMinutes = request.market_lower_tf("BINANCE:BTCUSDT", "1", close)

Since ChartScript 1

#request.tffunction

The expression evaluated on another timeframe of this market. { at: request.close } (default) never repaints.

request.tf(timeframe: string, expression: T, { at?: simple string = request.close, gaps?: simple bool = false, calc_bars_count?: const int = na }): T
ParameterTypeDescription
timeframestringA timeframe such as "60", "240", "1D" or "1W"; "" is the chart's.
expressionTThe expression evaluated in the requested context.
atsimple stringdefault request.closeWhen a value is taken: request.close (default, never repaints), request.start, request.developing or request.bar_close (the original platform's lookahead off).
gapssimple booldefault falsetrue: the value only on the bar where it changes; false: carried forward.
calc_bars_countconst intdefault naAt least this many bars of the requested timeframe (a constant number, up to 20,000), so a path-dependent expression (zones, pivots, counters) gets the same history whatever the chart shows. On the chart's own market and timeframe, more bars than the script runs on give the request its own deeper history. Requests of one market and timeframe share a context and its largest depth. On request.lower_tf and request.market_lower_tf it is how far back the lower-timeframe bars reach.

Returns T.

Example

ChartScriptFragmentOpen in editor
const dailyClose = request.tf("1D", close)

Since ChartScript 1

#Constants

NameTypeDescription
request.bar_closestringOn closed chart bars: the last higher bar closed by the chart bar's close (never repaints once that bar has closed); on the live chart bar: the higher bar so far. The same as the original platform's default (lookahead off).
request.closestringTake the value of the last closed higher bar (default; never repaints).
request.developingstringTake the higher bar so far (moves until it closes).
request.startstringTake the value at the start of the higher bar (only for expressions known when it opens).

#Not supported

#request.currency_ratefunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.dividendsfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.earningsfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.economicfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.financialfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.quandlfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.securityfunction

Not supported in ChartScript.

Use request.tf (same market) or request.market (another market); { at: request.close } is the no-repaint default.

Since ChartScript 1

#request.security_lower_tffunction

Not supported in ChartScript.

Use request.lower_tf.

Since ChartScript 1

#request.seedfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

#request.splitsfunction

Not supported in ChartScript.

Not supported in ChartScript.

Since ChartScript 1

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