Hi paulw
I shall try to answer your queries first, and then we can look at your trigger requirement and try and help you with it.
QUERIES
Any user variable that is going to be used in an expression or formula should be initialised (declared) beforehand, or the formula will not work. If the variables are going to be updated periodically, as in the example you refer to above, the first trigger is a reset mechanism to start the variables with a value of zero. You can initialise a variable either by using a constant, or by using the set user variable trigger action, depending on the requirement.
The entire trigger file is read top down and processed on each refresh of the market.
If you have a trigger that is executed once per market:
The trigger file will be processed
If the conditions are all met, the trigger will fire
On the next refresh:
The trigger file will be processed
If the conditions are all met, the program detects the trigger has already been executed once in this market, the trigger will not fire again in that market.
If you have a trigger that is executed no more often than x:
The trigger file will be processed
If the conditions are all met, the trigger will fire
On the next refresh:
The trigger file will be processed
If the conditions are all met, the trigger will fire again
etc.
TRIGGER REQUIREMENT
Please can you confirm in English exactly what you are wanting to do, and then I can help you to make a trigger for it. From your post, it is a little unclear, but reading your post this is what I understand:
You have already fired into the market a Dutch Back to your own book % (I think it is a Dutch Back because you talk about counting matched back bets)
At a specific time (please clarify the time you want to do this)
Count the number of unmatched back bets
If the number of unmatched back bets is less than 2
Cancel the unmatched back bets, and
Resubmit these as lay bets at the SP price after the off
Now, from a trading perspective, the above set of instructions does not make sense. If you could please just list in English, similar to what I have done, exactly what you want to do, I’m sure we can sort something.