The parts
Top level only
These may not appear inside a function,if, loop or switch:
indicator,strategy;func,def,typeandenumdeclarations (a syntax error elsewhere);- the calls that put output on the chart:
plot,plotshape,plotchar,plotarrow,plotbar,plotcandle,hline,fill,bgcolor,barcolor,alertcondition. Inside a block they fail with`plot()` must be called in the global scope.(the name of the call you wrote). To draw only on some bars, put the condition in an argument instead (see Branching).
input.*, talib calls, drawings, alert and strategy.* orders may be used anywhere.
What a script cannot contain
import,export,methodandlibrary(): there are no libraries or modules.request.*: a script reads only the symbol and interval of its chart.- Block comments: only
//to the end of the line. varandvarip: usestatic(see Values that persist across bars).