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

Sets up an initial position, range, name, and tooltip for one of the three customizable sliders. Returns the current position of the slider. Depending on the selected asset or other conditions, different slider positions can be preset at the beginning.

slider(int number): var

Returns the position of the slider with the given number.

slider(int number, int pos)

Sets the slider with the given number to a new position. This way the script can display numerical values to the user while running.

Parameters:

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

Returns

Current value of the slider.
 

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