Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS3110

error leaf is not known when the tf bar opens; use leaf[1] or atClose.

#What it means

{ at: request.start } gives values that are fixed when the requested bar opens, so the script never repaints. The expression uses a value (named in the message) that is not known yet at that moment, such as the high of a day that has just begun.

#Typical cause

  • high, low, close, volume or a calculation on them at offset 0, with { at: request.start }.

#How to fix it

Use the previous bar's value (high[1]), or use { at: request.close } (the default). See Repainting.

#Example

ChartScriptError: CS3110
//@chartscript 1
indicator("Daily high", { overlay: true })
plot(request.tf("1D", high, { at: request.start }))

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Daily high", { overlay: true })
plot(request.tf("1D", high[1], { at: request.start }))
  • CS3101 — request.developing needs a timeframe that is a whole multiple of the chart's, on the same market.
  • 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.