Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS3121

error A request cannot sit inside another request’s expression.

#What it means

A request expression cannot contain another request. In this version, a request runs one level deep.

#Typical cause

  • request.tf(..., request.tf(...)), or a function with a request called inside another request.

#How to fix it

Make each request separately at the top level and combine the results there.

#Example

ChartScriptError: CS3121
//@chartscript 1
indicator("Weekly close", { overlay: true })
plot(request.tf("1D", request.tf("1W", close)))

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Weekly close", { overlay: true })
plot(request.tf("1W", close))
  • CS3120 — Plots, inputs, drawings and alerts cannot be used inside a request expression.
  • CS3004 — This script uses n other timeframes or markets; your plan allows max.

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