User Constants

Top  Previous  Next

User Constants are pairs of name & value which act exactly as normal user variables, only their values can be assigned to them directly, not only by a trigger.


They can be used when you want to quickly key in several user variables with fixed values, for example, the initial and maximum bet sizes, the profit percentage, the price limit of the hand you're betting on etc. That is, you know what these values are at the beginning of your trading session, and don't want to spend time on adding a separate trigger for each of them and specifying the conditions.


When you open the "Triggers" window, you can see a panel titled "Add/Delete Constants" below the main control buttons.



It is used for storing and displaying the constants. Here you can quickly add constants using the "Add" button.


Enter the name of the constant, its value (should be numeric, i.e. a number, unless it is a string constant) and an optional description that may help you to recognise this variable later. To delete a constant just press the button outlined on the picture:



Once you have added these constants, you then can utilise them in exactly the same way as user variables: you can insert them in trigger expressions, change their values by a "set user variable" trigger, check them with the "View Variables" window and use them in trigger conditions. Their only difference is that once you have loaded a trigger file or edited the triggers and pressed the "Save Triggers" button, their values are defined, unlike the values of user variables which must be defined by a "set user variable" trigger.


Here is an example:



You can see that there is a constant named "c1" and a variable named "v1". If I save the triggers now and open the "View Variables" window to check their values, the value of "c1" will be "5", whereas the value of "v1" will be empty, as the trigger that has to set its value has not been executed yet.


Constants should be used exactly in the same way as user variables. For example, you can define a constant and then change its value using a trigger:



Initially the value of v1 will be 0, then it will be incremented in the beginning of each game.