Documentation / Operators

“AND” is the logical operator used to add different functions in the same expression.

 

Example:

myRSIvalue = RSI[14](Close)
myValueCondition = 50 

if(myRSIvalue > myValueCondition AND myRSIvalue[1] < myValueCondition) THEN
     SIGNAL = 1
ELSE 
     SIGNAL = 0
ENDIF

RETURN SIGNAL 

 

Instruction used to name a line or indicator displayed on chart. Used with “RETURN”.

Example:

RETURN indicatorValue AS "Name of my Indicator"

 

Logicial operator NOT.

Syntax:

NOT

 

Example:

result = 0

FOR i=0 TO 20 DO
  a = Close[i+10]
  b = Close[i]
     if not (a > b) THEN
        result = 1 
     ENDIF
NEXT

RETURN result

 

Logical operator “OR”. Used for testing different conditions on the same statement.

Syntax:

OR

 

Example:

i1 = lowest[10](close)

IF (close[1]<i1 OR low[1]<i1) THEN
    result = 1
ELSE
    result = 0
ENDIF

RETURN result  

 

Logical operator eXclusive OR.

Syntax:

XOR

 

Example :

a = 5
b = 7
c = 6

if(c>a XOR c>b) THEN
   result = 1
ENDIF

RETURN result

 


Top