### How to write formulas?

You've probably noticed that you can use formulas to specify search conditions in SharkyScanner. With formulas, it's possible to describe almost any conditions of suitable game search, as well as conditions for weak and strong players.

#### Interface and syntax

When writing formulas, you can use only variables and functions in the drop-down list below the formula input field. In order to get a description of a variable/function, select it in the list and click . To quickly paste a variable/function into formula, use J button. If input field is too small for your formula, you can click K and continue editing in a resizable window. To quit this editor, press **Esc** or click L.

It's allowed to use the following operators in any formula:

Operator | Priority | Description | Example |
---|---|---|---|

?: | 0 | conditional operator | at least 1 enrolled player for tournaments with buy-in 10 or less; at least 2 enrolled players for tournaments with buy-in higher than 10 |

ENROLLED>=(BIV<=10? 1:2) | |||

and (or &&) | 1 | logical “AND” | buy-in is $25 and more than 3 players registered |

BIUSD==25 and ENROLLED>3 | |||

or (or ||) | 2 | logical “OR” | regular or turbo speed tournament |

SPEED==REGULAR or SPEED==TURBO | |||

== | 3 | equal | tournament buy-in is 10 |

BIV==10 | |||

!= | 3 | not equal | tournament buy-in is not in the US dollars |

BIC!=USD | |||

< | 3 | less than | ITM is less than 50% |

ITM<50 | |||

<= | 3 | less than or equal | the number of played tables is not more than 5 |

TABLES<=5 | |||

> | 3 | greater than | ROI is greater than 10% |

ROI>10 | |||

>= | 3 | greater than or equal | at least 1 enrolled player |

ENROLLED>=1 | |||

+ | 4 | addition | player finishes in early and early/middle stages of a tournament in at least 35% of games |

FINEARLY+FINEARLYMID>=35 | |||

- | 4 | subtraction | at least 2 free seats in a tournament |

ENTRANTS-ENROLLED>=2 | |||

* | 5 | multiplication | played at least half of games in a session |

SGAMES*2>=SGAMELIMIT | |||

/ | 5 | division | tournament is at least half-full |

ENROLLED>=ENTRANTS/2 | |||

not (or !) | 5 | inversion | player's nickname is not ChuckNorrisQ |

not nickname("ChuckNorrisQ") | |||

^ | 6 | exponentiation | we have no idea how it can be used |

Formula is evaluated according to operators' priority (operations with higher priority are performed first). In case of equal operator priorities evaluation is performed in order from left to right. If you're not sure about the order of evaluation, use parentheses “(” and “)”. The use of parentheses is especially important in conditions that contain combinations of operators “and”/“or”: in order to avoid mistakes, never make records like “A and B or C” in which operator(s) “and” as well as operator(s) “or” are on the same level without being separated by parentheses. Be sure to parenthesize the condition that must be checked first: “(A and B) or C” or “A and (B or C)”.

Below are examples of formulas that will help you understand how to make them correctly.

#### Tournament search

At this page you specify conditions for suitable tournaments. If the result of formula evaluation is nonzero, then the tournament is considered suitable. If auto-registration is turned on, you'll be registered in a suitable tournament. If auto-unregistration is turned on as well, you'll be automatically unregistered from a tournament if the result of formula evaluation is zero.

Example 1

Look for the most filled tournaments for 16, 36 and 64 players at least half full.

(ENTRANTS==16 or ENTRANTS==36 or ENTRANTS==64) and ENROLLED>=ENTRANTS/2 and mostenrolled(AVAILABLE,ANY,ANY,ENTRANTS,ANY)

Example 2

Look for single table 9-max and 10-max SNG tournaments at $3.5, $7 and $15 limits having at least 4 enrolled players with the following conditions:

- look for $3.5 tournaments only if currently playing less then 20 tables;
- stop looking for regular 9-max after 150 minutes of session;
- stop looking for 9-max turbo and regular 10-max after 165 minutes of session;
- stop looking for 10-max turbo after 180 minutes of session.

((BIUSD==3.5 and TABLES<20) or BIUSD==7 or BIUSD==15) and ((ENTRANTS==9 and SPEED==REGULAR and STIME<150) or (ENTRANTS==9 and SPEED==TURBO and STIME<165) or (ENTRANTS==10 and SPEED==REGULAR and STIME<165) or (ENTRANTS==10 and SPEED==TURBO and STIME<180)) and ENROLLED>=4

#### Easy opponents / Tough opponents

At these pages you can specify conditions which must be met by a player to treat them easy/tough. If the result of evaluation of the formula at the **Easy opponents** page is nonzero, then the player is considered easy. Likewise, if the result of evaluation of the formula at the **Tough opponents** page is nonzero, then the player is considered tough.

Example 1

Consider a player weak, if they played less than 100 games or have ITM less than 46% in hyper-turbo tournament or less than 48 in other tournaments.

GAMES<100 or (SPEED==HYPER and ITM<46) or (SPEED!=HYPER and ITM<48) or

Example 2

Consider a player weak in single table 9-max and 6-max tournaments if they have negative profit in these kinds of games (formula uses names of SharkScope filters that must be created for corresponding kinds of games).

(ENTRANTS==9 and PROFIT("9-max")<0) or (ENTRANTS==6 and PROFIT("6-max")<0)

Example 3

Consider a player strong if their ITM is greater than the specified threshold depending on the poker client:

- 54% and more for PokerStars;
- 56% and more for PokerStars.ES.

(network("PokerStars") and ITM>=54) or (network("PokerStars(FR-ES-PT)") and ITM>=56)

Example 4

Consider a player weak with the following conditions:

- their ITM is less than 33%;
- if unable to find a suitable tournament for a long time, soften search conditions by increasing ITM threshold by 1% every 5 minutes, but not more than up to 36%.

ITM<33+((SCANTIME=>180)? 3:SCANTIME/60)

Example 5

Consider a player weak by their ITM changing the threshold depending on the time and the day of week:

- less than 50% in the morning;
- less than 48% in the afternoon and at night;
- less than 46% in the evening and on the weekends.

(time(ANY,05,00,12,00) and ITM<50) or ((time(ANY,12,00,17,00) or time(ANY,21,00,05,00)) and ITM<48) or ((time(ANY,17,00,21,00) or time(SAT+SUN,00,00,23,59)) and ITM<46)

#### Custom stats

At this page you can create new (F button) as well as modify (G button) and delete (I button) existing custom SharkScope stat parameters. Any custom parameter is evaluated by a formula of the basic SharkScope parameters.

Example 1

$/hour parameter (it is implied that SharkScope stats are requested in the US dollars).

Stat name: **$/hr**

Variable: **HRPROFIT**

PROFIT/(GAMES*AVGAMEDUR/3600)

Example 2

Set ITM threshold 48% for weak players: it's useful when you specify it in multiple places in the formula at the **Easy opponents** page. You can create a custom stat (in fact, a constant), paste it into the formula of weak players instead of numerical value and when you need to change the threshold, it would be enough to modify it only once in the formula of the custom stat).

Stat name: **Weak ITM**

Variable: **WEAKITM**

`48`

Example 3

Total percentage of player's finishes before the middle stage of a tournament.

Stat name: **Finishes before mid**

Variable: **NOMID**

FINEARLY+FINEARLYMID

#### Tools — Group players

At this page you can get a list of players from the local database that meet the specified conditions. If result of formula evaluation is nonzero, then player's nickname is listed.

Example 1

Pick PokerStars players from the database who play at the minimum of $30 average buy-in and have higher than 55% ITM.

network("PokerStars") and AVSTAKE>=30 and ITM>55

Example 2

Pick winning Mexican players from the database.

country("Mexico") and PROFIT>0

Example 3

Pick players with known average ROI parameter from the database.

AVROI==AVROI

If you're still not sure how to make a formula, contact us and describe as detailed as possible how you'd like it to work, and we'll gladly make the formula for you.