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 #
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