Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS4106

error A linked script cannot be read inside a request expression.

#What it means

The expression of a request runs on the requested bars, not on the chart's. A linked script runs on the chart's own market and timeframe, so its values cannot be read inside a request.

#Typical cause

  • h.<id>, h.levels.<id>, h.events.<id>, h.ready or h.status written inside request.tf(...) or request.market(...), or inside a function called from one.

#How to fix it

Read the linked value outside the request. A link cannot ask for another timeframe or market yet: see Not in this release.

#Example

ChartScriptError: CS4106
//@chartscript 1
const piv = link.script("@user/Pivot Levels@1")
indicator("Daily trend")
plot(request.tf("1D", piv.trend), "Trend")

Fixed

ChartScriptOpen in editor
//@chartscript 1
const piv = link.script("@user/Pivot Levels@1")
indicator("Daily trend")
plot(piv.trend, "Trend")
  • CS4113 — Values cannot be shared inside a request expression.
  • CS3120 — Plots, inputs, drawings and alerts cannot be used inside a request expression.
  • CS4110 — Cannot link path: reason.

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