TradeZoro
Notifications

Mentis course

Lesson 1. Meet Zscript

25 min, foundation level

Zscript is the small language you use to build your own chart indicators on TradeZoro. You write a few lines, add them to the chart, and your idea is drawn on the candles. It is free for every member.

In this lesson you add your first script and learn what its four parts do.

//@zscript 1
indicator("My first line", overlay=true)
average = ta.sma(close, 20)
plot(average, title="20-bar average")

The four parts

  • Header: //@zscript 1 says this is Zscript, version 1.
  • Declaration: indicator(...) names the script. overlay=true puts it on the price chart.
  • Logic: average = ta.sma(close, 20) makes a value from the closing prices.
  • Drawing: plot(...) shows it.

Press Add to chart and a line follows price. Change 20 to 50 and add it again: the line gets smoother. Changing a number and looking is how you learn.

Education only. Not financial advice. A line on a chart describes the past; it does not promise anything.

Exercises

  1. Add your first script. Paste the script above into the editor and add it to a chart. Then change 20 to 5 and to 100. Write one sentence about how the line changes.
  2. Rename and recolor. Change the title to your own name and add color=color.orange to the plot call. Add it again.

Quick quiz

What does overlay=true do?

overlay=true draws on the price chart. Without it the script gets its own pane below.

What must be the first line of every Zscript file?

The header line tells the editor which language and version this is.

Next lesson

Education only. Not financial advice. Examples are teaching samples, not trading results.

Zscript is coming soon

The manual opens when Zscript launches.

Back to home