Operators and Functions Supported

Top  Previous  Next

X-Feeder supports all arithmetic operators and several functions for calculations inside triggers.

 

The places where you may insert formulas with trigger variables, operators and functions are:

 

"Price", "Amount" and "Percentage" trigger fields

"Trigger Expression" field in trigger conditions.

Expression value fields in trigger conditions (the ones that come after the conditions words such as "is equal to", "is less than" etc.).

 

Operators

 

Here is the full list of signs you can use inside your trigger expressions:

+ addition

- subtraction

* multiplication

^ raising to power

/ division

% modulus or remainder. For example, 5 % 4 = 1, 36 % 6=0, 23 % 7 = 2

= equal to

<> not equal to

> greater than

>= equal or greater than

< less than

<= equal or less than

( ) brackets

 

You can combine these operators with numbers and trigger variables. For example:

 

(100/r_1_back_price + 100/r_2_back_price + 100/r_3_back_price)

 

Functions

 

r_ticks(original_price, ticks). Returns a price that is ticks higher or lower than original_price. If ticks is positive the returned price will be higher, and if it is negative the price will be lower. For example: r_ticks(6, 4) will return 6.8, and r_ticks(4.1, -5) will return 3.8.
fibonacci(step, increment, start). Returns a number in a Fibonacci sequence, where step is the first value in the sequence, increment is the number of iterations (either positive or negative) and start is the number that the iterations are started from. For example, if step is 3.0, then the sequence will look like:
0, 3, 3, 6, 9, 15, 24, 39, 63, 102, 165, 267 and so on.
Suppose increment is 4, and start is 24. Then fibonacci(3, 4, 24) = 165 (4 steps forward from 24).
If increment is -3 and start is 102, then fibonacci(3, -3, 102) = 24.
Another examples:
fibonacci(2, 5, 0) = 10
fibonacci(4, -2, 20) = 8

 

X-Feeder utilizes several simple Excel functions. They are listed below:

 

IF(expression, value_if_true, value_if_false). Returns value_if_true if the condition in the expression is met (is true), and value_if_false otherwise. Example: IF(5>6, 30, 0) returns 0, because 5 is not less than 6.
AND(expression1, expression2, ...). Returns true if all the expressions inside the brackets are true, and false otherwise.
OR(expression1, expression2, ...). Returns true if at least one expression inside the brackets is true, and false otherwise.
FIND(pattern, string). Returns the the position of the first occurrence of pattern in string. If pattern is not found it returns 0. If string starts with pattern, then the function will return 1 and so on. Example: FIND("Horse", "Horse Racing - Todays Card") will return 1, because the pattern "Horse" stands in the beginning of the string. The pattern "orse" will be found on the second place and so on.
ABS(expression). Returns the absolute value of a number, that is the number without its sign.

 

These functions have the same syntax as in Excel. However there are several restrictions that you must know about:

 

all functions must be entered in English. No other languages are supported
all numbers must have dot as a decimal separator. For example, numbers like 5,2 must be entered as 5.2. If the expression that contains these numbers will be later output to an Excel spreadsheet, it will be automatically formatted according to your system's decimal separator.

 

You can combine different functions in one expression. Here are a couple examples:

 

IF(AND(last_won>=0, total_won>0), 4.0, IF(last_won<0, 4-last_won))
IF(OR(lay_matched>0, lay_unmatched>0), lay_matched+lay_unmatched, lay_amount)