CS1058
error An options object { … } can only be the last argument of a call.
#What it means
Arguments given by name go in an options object { name: value, … }, and that object must be the last argument of the call. Here more arguments follow it.
#Typical cause
- A positional argument after the options object, as in
plot(close, { color: color.orange }, "Close"). - Two options objects in one call.
#How to fix it
Put the positional arguments first and every named one in a single options object at the end: plot(close, "Close", { color: color.orange }). See Functions.
#Example
//@chartscript 1
indicator("Close", { overlay: true })
plot(close, { color: color.orange }, "Close")Fixed
//@chartscript 1
indicator("Close", { overlay: true })
plot(close, "Close", { color: color.orange })