Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS3123

warning name belongs to the code around this request; the request expression runs on other bars and reads it as na. Pass a market / timeframe instead, or compute the value inside the request.

#What it means

This is a warning. A request expression runs on other bars than the code around it. A parameter or a local variable of the surrounding function or block does not exist there, so the request reads it as na.

#Typical cause

  • A function parameter (or a variable declared in the same if block or function) used inside a request expression.

#How to fix it

Compute the value inside the request, or pass the request a market or timeframe instead of a value. Constants and inputs are fine.

#Example

ChartScriptWarning: CS3123
//@chartscript 1
indicator("Scaled daily close")
const dailyScaled = (k: float) => request.tf("1D", close * k)
plot(dailyScaled(2.0))

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Scaled daily close")
const dailyScaled = (k: float) => request.tf("1D", close) * k
plot(dailyScaled(2.0))
  • CS3122 — name changes on the chart bars (how), so a request cannot recompute it on the requested bars: there it is na (kw) or the chart’s current value. Compute it in a function called inside the request.

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