Documentation / Constants

Closing price constant of the current bar or of the Nth last bar.

Syntax:

Close[N]

 

Example:

//Close of the current bar
Close[0] or Close

//Close of the 20th previous bar from current close
Close[20]

Constant which is customizable in the settings window of the chart (default: close).

Syntax:

CustomClose[N]

 

Return the close value of the Daily timeframe of the N bar before the current one.

Syntax:

DClose(N)

 

Example:

//Giving the weekly close on each Friday bar
if(DayOfWeek[0] = 5) THEN 
    LastWeekClose = DClose(5)
ENDIF

RETURN LastWeekClose

Constant variable that give the daily High of the N selected bar from the current one.

Syntax:

DHigh(N)

 

Example:

//Looking the highest high of the last 10 bars
Newhighest=0
FOR a = 0 TO 10 DO
       IF DHigh(a)>Newhighest THEN 
            Newhighest = DHigh(a)   
       ENDIF
NEXT

RETURN Newhighest

 

Constant variable that give the daily Low of the N selected bar from the current one.

Syntax:

Example:

Return the open value of the Daily timeframe of the N bar before the current one.

Syntax:

DOpen(N)

 

High of the current bar or of the last N one.

Syntax:

High[N]

 

Low of the current bar or of the last N one.

Syntax:

Low[N]

 

The MedianPrice constants give the value of the last average of the high and the low.

Syntax:

MedianPrice

 

Example:

Smoothing the price information with less noises with the MedianPrice value :

i1 = MedianPrice
i2 = MedianPrice[1]

if(i1>i2) THEN
   result = i1
ENDIF

RETURN result

 

Opening price constant of the current bar or of the Nth last bar.

Syntax:

Open[N]

 

Example:

//Open of the current bar
Open[0] or Close

//Open of the 20th previous bar from current close
Open[20]

 


Top