Hi
If you want to limit the number of open (you did not say matched or unmatched) bets in a market:
markets number of unmatched back bets is equal or less than 5
markets number of matched back bets is equal or less than 5
same for lay etc...
or all bets in the program, please read in the help file in the general variables section about allbets_
example: selections trigger expression allbets_num is equal or less than 5
or, as in your trigger, you can update a counter:
in the betting trigger add a second action:
set user variable, name bc, value bc+1
condition in the betting trigger:
and selections trigger expression bc is equal or less than 5