Your first script
Three lines that draw an average, and how FlowScript runs them.
FlowScript runs your script once for every bar on the chart, oldest first. On each run, close is that bar’s close, high its high, and so on. Whatever you plot on each run becomes a line across the chart.
indicator("My first average", overlay = true)
average = sma(close, 20)
plot(average, "SMA 20", color = sky)indicator(…)names the script and chooses where it draws.average = …stores a value for this bar in a name you choose.plot(…)draws it. Settings likecolorare named, so the order doesn’t matter.
Open Flow Studio and start from the “Hello, FlowScript” template. Open Flow Studio
Key takeaways
- A script runs once per bar, oldest first.
- Assign values to names, then plot them.
- indicator() decides overlay vs own pane.