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.readyorh.statuswritten insiderequest.tf(...)orrequest.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
//@chartscript 1
const piv = link.script("@user/Pivot Levels@1")
indicator("Daily trend")
plot(request.tf("1D", piv.trend), "Trend")Fixed
//@chartscript 1
const piv = link.script("@user/Pivot Levels@1")
indicator("Daily trend")
plot(piv.trend, "Trend")