millionchart
فارسی

Getting started

The smallest useful indicator in ten lines: a header, an input and a plot, written once and tested.

A script is a small program that runs once for every bar of the chart. This is a complete indicator.

Simple moving average#

The smallest complete indicator with an input: a simple moving average of the close.

Cuprel
// A simple moving average: the mean of the last `length` closes.
// This is a complete indicator; the header says what kind of script it is.
indicator "Simple moving average"
    edition = 1
    display = price

input length: int = 20, name = "Length", min = 1
let average = tech.sma(close, length)
plot(average, name = "SMA", color = color.orange, width = 2)