### Maths blocks #

Maths Blocks offer a set of mathematical operations to compare and create conditions based on the output from Data Watchers and Indicator Blocks. These blocks enable users to define precise conditions for executing trades, such as setting thresholds for buying or selling.

To create a new maths block, double click in the blueprint screen, or click the `+`

button in the menu. In the search bar, type: “math/” followed by the abbreviations below, or simply type the abbreviation:

##### fix_numer #

Sets a fixed number which could be compared against.*Fix number*

##### variable #

Sets a variable number based on the last result seen.*Variabe*

##### PercentageOf #

Calculates input A as a percentage of input B.*A percentage of B (A*100% / B)*

##### to_number #

can convert a number or a character expression representing a number value to a decimal data type.*Cast to number*

##### rand #

* Random number *generates a random number between any two number specified (default is between 0 and 1).

##### clamp #

used to specifying a number between a minimum and maximum value*Clamp number between min and max*

##### abs #

the absolute value or modulus of a real number, denoted, is the non-negative value of without regard to its sign. Namely, if is a positive number, and if is negative, and. For example, the absolute value of 3 is 3, and the absolute value of −3 is also 3.*Absolute*

##### floor #

always rounds down and returns the largest integer less than or equal to a given number.*Floor number to remove fractional part*

##### scale #

increase or decrease a number by a specified factor*v * factor*

##### gate #

a conditional rule that can output multiple values based on whether the input is true or not.*if v is true, then outputs A, otherwise B*

##### operation #

for simple calculations. You can use this to add, subtract, multiply, divide, display as a percentage, square root, maximum or minimum.*Easy math operators*

##### compare #

output based on whether two inputs match or not*Compares between two values*

##### condition #

allows us to determine whether A is greater than (>), less than (<), equal to (==), not equal to (!=), greater than or equal to (>=), less than or equal to (<=), if either of two conditions is true (||), or if both conditions are true (&&).*Evaluates condition between A and B*

##### condition3in #

as above, with 3 possible inputs*evaluates condition between A, B and C*

##### condition4in #

as above, with 4 possible inputs*evaluates condition between A, B, C and D*

##### condition5in #

as above, with 5 possible inputs*evaluates condition between A, B, C, D and E*

##### condition6in #

as above, with 6 possible inputs*evaluates condition between A, B, C, D, E and F*

##### difference #

as a percentage*A's difference from B*