شروع کار
کوچکترین اندیکاتور مفید در ده خط: یک سرآیند، یک ورودی و یک خط رسمشده، یک بار نوشته و آزمودهشده.
اسکریپت یک برنامهٔ کوچک است که برای هر کندل نمودار یک بار اجرا میشود. این یک اندیکاتور کامل است.
میانگین متحرک ساده#
کوچکترین اندیکاتور کامل با یک ورودی: میانگین متحرک سادهٔ قیمت بستهشدن.
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)