Docs / Block Reference / Maths Blocks
Maths Blocks
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 triggering 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
_Fix number_ Sets a fixed number which could be compared against.
variable
_Variabe_ Sets a variable number based on the last result seen.
PercentageOf
_A percentage of B (A*100% / B)_ Calculates input A as a percentage of input B.
to_number
_Cast to number_ can convert a number or a character expression representing a number value to a decimal data type.
rand
Random number generates a random number between any two number specified (default is between 0 and 1).
clamp
_Clamp number between min and max_ used to specifying a number between a minimum and maximum value
abs
_Absolute_ 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.
floor
_Floor number to remove fractional part_ always rounds down and returns the largest integer less than or equal to a given number.
scale
_v * factor_ increase or decrease a number by a specified factor
gate
_if v is true, then outputs A, otherwise B_ a conditional rule that can output multiple values based on whether the input is true or not.
operation
_Easy math operators_ for simple calculations. You can use this to add, subtract, multiply, divide, display as a percentage, square root, maximum or minimum.
compare
_Compares between two values_ output based on whether two inputs match or not
condition
_Evaluates condition between A and B_ 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 (&&).
condition3in
_evaluates condition between A, B and C_ as above, with 3 possible inputs
condition4in
_evaluates condition between A, B, C and D_ as above, with 4 possible inputs
condition5in
_evaluates condition between A, B, C, D and E_ as above, with 5 possible inputs
condition6in
_evaluates condition between A, B, C, D, E and F_ as above, with 6 possible inputs
difference
_A's difference from B_ as a percentage