Here: https://fxdreema.com/shared/jXni7Yt3b
You put a few blocks for counting the position in On Trade only (elsewhere it will be inefficient) and store the open trades count in a variable. Then you can check this variable against your limit.
Thank you very much!! At the end since I couldn't figure it out, I loaded the old basic projects with two trades, added again the flag and....magically worked!!