Documentation / Instructions

Return the number of bars since the beginning of data loaded (in a chart in the case of a ProBuilder indicator of for a trading system in the case of ProBacktest or ProOrder)

Syntax:

BarIndex

 

Instruction forcing the exit of “FOR” loop or “WHILE” loop.

Syntax:

BREAK

 

Example:

Value = 0
FOR i = 1 TO 20 DO
           IF (Close[i] < Open[i]) THEN
                 Value = Value + 1
           ELSE
                 BREAK //we are exiting the 'FOR NEXT' loop here
           ENDIF
NEXT

RETURN Value

 

CalculateOnLastBars

ProRealTime v10.3

Purpose of this instruction is to avoid computer memory consumption by limiting the bars quantity use in indicator calculation.
This parameter increases the speed at which an indicator will be calculated by defining the number of bars that will present the result.
Syntax :

DEFPARAM CalculateOnLastBars = 200

“CALL” is an instruction made for calling value of user indicator. Add under brackets as many parameters the personal indicator have.

Syntax:

myValue = CALL "myIndicator"[parameter1,parameter2]

If the personal indicator returns more than one value from its RETURN instruction, the CALL function should be coded like this:

(case of an indicator that return 3 values)

myValue1, myValue2, myValue3 = CALL "myIndicator"[parameter1,parameter2]

3 variables are set from the the 3 returns variables of the custom indicator “myIndicator”.

Continue reading “CALL” »

Colors a curve with the color you defined using the RGB convention.

Syntax:

COLOURED(R,G,B)

The expression COLOURED must be place just after the value name :

RETURN myValue COLOURED(50,50,75)

Since the prorealtime version 10.3, it is also now possible to add “alpha” value for transparency purpose:

Syntax (v10.3) :

COLOURED(R,G,B,alpha)

Alpha value varies from 0 to 255.

 

RGB color samples :

ProRealTime colors

 

 

 

 

 

 

Continue reading “COLOURED” »

Boolean Operator checking whether a curve has crossed over another one.

Syntax:

a CROSSES OVER b

 

Example:

a = ExponentialAverage[20](close)
b = ExponentialAverage[50](close)

signal = 0

if(a[1] CROSSES OVER b[1]) THEN
            signal = 1
     ELSE
            signal = 0
ENDIF

RETURN signal AS "Bullish Signal"

Boolean Operator checking whether a curve has crossed under another one.

Syntax:

a CROSSES UNDER b

Example:

a = ExponentialAverage[20](close)
b = ExponentialAverage[50](close)

signal = 0

if(a[1] CROSSES UNDER b[1]) THEN
            signal = -1
     ELSE
            signal = 0
ENDIF

RETURN signal AS "Bearish Signal"

Sums a certain price on the whole data loaded.

Syntax:

cumsum(price)

 

Optional instruction in a FOR / NEXT loop and WHILE loop to define the actions to occur in the loop.

Syntax:

DO

Example:

Value = 0
FOR i = 1 TO 20 DO //Do the actions below
           IF (Close[i] < Open[i]) THEN
                 Value = Value + 1
           ELSE
                 BREAK
           ENDIF
NEXT

RETURN Value

 

Instruction use in a FOR / NEXT loop to process the loop with a descending order

Syntax:

DOWNTO

 

Example:

Value = 0
FOR i = 20 DOWNTO 0 DO //We are looping from 20 to 0 
           IF (Close[i] < Open[i]) THEN
                 Value = Value + 1
           ELSE
                 BREAK 
           ENDIF
NEXT

RETURN Value

Top