使用指南

Operators and Expressions
NetTradeX PC
NetTradeX Android
NetTradeX iOS
NetTradeX Mobile
NetTradeX Advisors
Operators and Expressions

Arithmetic operators

Addition of values:a=b+c;
Subtraction of values:a=b-c;
Multiplication of values:a=b*c;
Division of values:a=b/c;
Remainder of a division:a=b%c;
Sign change:a=-a;
Increment:a++
Decrement:a--

String operators

String concatenationa=b+c;

Assignment operators

Assigning the A value to the variable BB = A;
The sum of A and B is assigned to the variable АA += B;
The difference between the values A and B is assigned to the variable АA -= B;
The product of the values A and B is assigned to the variable AA *= B;
Quotient from the division of A into B is assigned to the variable AA /= B;
The bitwise operation of A AND B with the result assignment to AA &= B;
The bitwise operation A OR B with the result assignment to AA |= B;
The bitwise operation exclusive OR between A and B, with the result assignment to A A ^= B;

Logical and relational operators

TRUE if B equals to AB == A;
TRUE if B does not equal to АB != A;
TRUE if B is less than AB < A;
TRUE if B is less that or equal to AB <= A;
TRUE if B is greater than AB > A;
TRUE if B is greater than or equal to AB >= A;
TRUE if A or B is equal to TRUEA || B;
TRUE if both A and B are equal to TRUEA && B;

Bitwise operators

Bitwise NOT~A;
Shifting the binary representation of B to A bits to the rightB >> A;
Shifting the binary representation of B to A bits to the right (the bit sign does not change)B >>> A;
Shifting the binary representation of B to A bits to the leftB << A;
Bitwise OR for the A and B numbers A|B;
Bitwise AND for the A and B numbers A&B;
Exclusive OR for the A and B numbers A^B;

Operators precedence

The following table shows the precedence of NetTradeX language operators. Operators with the highest precedence appear at the top of the table.

* / %Multiplication, division, and modulus
+ -Addition and subtraction
<< >>Bit-shift
&Bitwise AND
^Bitwise exclusive OR
|Bitwise OR
<= < >= >Comparison operations
== !=Equality/inequality operations
&&Logical AND
||Logical OR
?:Ternary operation
= += -= *= /= %=
&= |= ^= <<= >>=
Assignment