I feel there is too little information to respond properly
Can you provide more details or clarify your request:
For example, do you really mean want to limit the number of simultaneous positions (e.g. stocks) to 20?
Maybe you could provide a descriptive example of what you want to accomplish.
Also, please be careful about opening new topics that may actually be a continuation of another. This request seems to be continuing the discussion from Limit number of new positions for a single day: