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| Parameter | Type | Description |
|---|---|---|
market | stringdefault "" | The market (VENUE:SYMBOL); empty = the chart's. |
timeframe | stringdefault "" | The timeframe; empty = the chart's. |
Returns bool.
Example
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>| Parameter | Type | Description |
|---|---|---|
timeframe | string | A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's. |
expression | T | The expression evaluated in the requested context. |
calc_bars_count | const intdefault na | At 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
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| Parameter | Type | Description |
|---|---|---|
market | string | A market as VENUE:SYMBOL. |
timeframe | string | A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's. |
expression | T | The expression evaluated in the requested context. |
at | simple stringdefault request.close | When a value is taken: request.close (default, never repaints), request.start, request.developing or request.bar_close (the original platform's lookahead off). |
gaps | simple booldefault false | true: the value only on the bar where it changes; false: carried forward. |
calc_bars_count | const intdefault na | At 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
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>| Parameter | Type | Description |
|---|---|---|
market | string | A market as VENUE:SYMBOL. |
timeframe | string | A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's. |
expression | T | The expression evaluated in the requested context. |
calc_bars_count | const intdefault na | At 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
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| Parameter | Type | Description |
|---|---|---|
timeframe | string | A timeframe such as "60", "240", "1D" or "1W"; "" is the chart's. |
expression | T | The expression evaluated in the requested context. |
at | simple stringdefault request.close | When a value is taken: request.close (default, never repaints), request.start, request.developing or request.bar_close (the original platform's lookahead off). |
gaps | simple booldefault false | true: the value only on the bar where it changes; false: carried forward. |
calc_bars_count | const intdefault na | At 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
const dailyClose = request.tf("1D", close)Since ChartScript 1
#Constants
| Name | Type | Description |
|---|---|---|
request.bar_close | string | On 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.close | string | Take the value of the last closed higher bar (default; never repaints). |
request.developing | string | Take the higher bar so far (moves until it closes). |
request.start | string | Take 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