slider (int number, int pos, int min, int max, string name, string tooltip) : var

Returns the current position of one of the four sliders; optionally also gives the slider an initial position, range, name, and tooltip. Depending on the selected asset or other conditions, different slider positions can be preset at the beginning.

Parameters:

number The number of the slider: 0 for the Period slider, 1..3 for the 3 user-specific sliders.
pos Optional initial position of the slider (default = 0). The position is set when the script is run the first time.
min, max Optional minimum and maximum positions of the slider, left and right.
name Optional name for the slider that is displayed in the main panel (f.i. "Panic"), or 0 for not changing the name.
tooltip Optional tool tip text to describe the slider function, or 0 for not changing the tool tip.

Returns

Current value of the slider.
 

Slider1 .. Slider3

Variable containing the current value of the 3 user-specific sliders. The slider can be moved at runtime by setting those variables to a different value.

Type:

var

Remarks:

Example:

Lots = slider(1,2,1,10,"Lots","Lots per Trade");
Stop = PIP*slider(2,15,0,30,"Stop","Stop Loss in PIPs");

See also:

optimize, panel

► latest version online