CODESCRIPT

Inputs

14 entries. What each one takes, what it returns, and a working example.

input(default, min?, max?, step?, name?, group?, tooltip?, inline?, options?)

An optimizable parameter value.

default
number
Default value.
min
number
Optional. Lower bound for optimization.
max
number
Optional. Upper bound for optimization.
step
number
Optional. Optimization step size.
name
string
Optional. Parameter name (shown in the results table).
NOTE

Optimization sweeps from min to max with step; if min/max are not given, it behaves like a fixed value.

inputBool(varsayılan, başlık?)

The checkbox state (the default if none is chosen).

varsayılan
bool
The default state (true/false).
başlık
string
Optional. The checkbox label.
NOTE

Defines an on/off checkbox; to toggle showing/hiding a feature. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
goster = inputBool(true, "Ortalamayi Goster")
plot(iff(goster, sma(close, 20), na))

Defines a checkbox; when ticked the average is plotted, otherwise it is left empty.

inputColor(varsayılan, başlık?)

The chosen color.

varsayılan
color
The default color (#rrggbb).
başlık
string
Optional. The color-picker label.
NOTE

Defines a color-picker parameter; to leave a line/fill color to the user. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
c = inputColor("#26a69a", "Cizgi Rengi")
plot(close, color=c)

Makes the line color adjustable and plots price in that color.

inputEnum(varsayılan, başlık?)

The chosen option text.

varsayılan
string
The default option.
başlık
string
Optional. The field label.
NOTE

Defines a bounded list parameter; to choose among a few fixed modes. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
m = inputEnum("mean", "Mod")
plot(iff(m == "mean", sma(close, 20), ema(close, 20)))

Branches on a mode-selecting parameter; when it is "mean", the simple average is plotted.

inputFloat(varsayılan, başlık?)

The decimal number chosen by the user.

varsayılan
number
The decimal default value.
başlık
string
Optional. The label shown in the panel.
NOTE

Defines a decimal parameter; for fractional values such as a multiplier or threshold. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
k = inputFloat(2.0, "Carpan")
plot(atr(14) * k)

Defines an adjustable multiplier and plots ATR scaled by it.

inputInt(varsayılan, başlık?)

The integer chosen by the user (the default if none is chosen).

varsayılan
number
The integer default value.
başlık
string
Optional. The label shown in the panel.
NOTE

Defines an integer parameter; for counter values such as a window length. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
len = inputInt(20, "Pencere")
plot(sma(close, len))

Defines an adjustable window length and plots the moving average of that length.

inputPrice(varsayılan, başlık?)

The chosen price level.

varsayılan
number
The default price level.
başlık
string
Optional. The field label.
NOTE

A parameter that selects a price level; to let the user set a target or stop line. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
lvl = inputPrice(100.0, "Seviye")
plot(iff(close > lvl, close, na))

Defines an adjustable price level and plots while price is above it.

inputSession(varsayılan, başlık?)

The chosen session text.

varsayılan
string
The default session range ("0930-1600").
başlık
string
Optional. The field label.
NOTE

A parameter that selects a trading-session range; to let the user set intraday filters. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
sess = inputSession("0930-1600", "Seans")
plot(iff(strLength(sess) > 0, close, na))

Defines an adjustable session range and plots price while it is non-empty.

inputSource(kaynak, başlık?)

The chosen price series (the default if none is chosen).

kaynak
series
The default price series (close, hl2, etc.).
başlık
string
Optional. The field label.
NOTE

A parameter that selects which price series to use; so an indicator can run on high/hl2 instead of close. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
src = inputSource(close, "Kaynak")
plot(sma(src, 20))

Lets the user choose which price series the average is taken over.

inputString(varsayılan, başlık?)

The text entered by the user.

varsayılan
string
The default text.
başlık
string
Optional. The field label.
NOTE

Defines a free-text parameter; such as a mode name or a label. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
mod = inputString("trend", "Mod")
plot(iff(mod == "trend", close, open))

Branches on a text parameter; when it is "trend", close is plotted.

inputSymbol(varsayılan, başlık?)

The chosen symbol text.

varsayılan
string
The default symbol.
başlık
string
Optional. The field label.
NOTE

A parameter that selects a symbol; for taking a symbol name for a comparison or multi-symbol read. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
s = inputSymbol("BTCUSDT", "Sembol")
plot(iff(strLength(s) > 0, close, na))

Defines an adjustable symbol name and plots price while it is non-empty.

inputTextArea(varsayılan, başlık?)

The (possibly multi-line) text entered by the user.

varsayılan
string
The default multi-line text.
başlık
string
Optional. The field label.
NOTE

Defines a multi-line free-text parameter; for longer inputs such as a note or a list. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
note = inputTextArea("aciklama metni", "Not")
plot(iff(strLength(note) > 0, close, na))

Defines a multi-line note field and plots price while it is non-empty.

inputTime(varsayılan, başlık?)

The chosen timestamp.

varsayılan
number
The default timestamp.
başlık
string
Optional. The field label.
NOTE

A parameter that selects a date/time; to let the user set time bounds such as a start date. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
t = inputTime(1700000000, "Baslangic")
plot(iff(t > 0, close, na))

Defines an adjustable start time and plots price while it is positive.

inputTimeframe(varsayılan, başlık?)

The chosen timeframe text.

varsayılan
string
The default timeframe ("1D", "4h").
başlık
string
Optional. The field label.
NOTE

A parameter that selects a timeframe; to let the user set higher-timeframe reads. Opens a control in the editor's settings panel; during computation it returns the selected value (the default).

CODESCRIPT
tf = inputTimeframe("1D", "Zaman Dilimi")
plot(timeframeInSeconds(tf))

Defines an adjustable timeframe and plots its length in seconds.