Hi @johntyr! I have looked at your code and from my experience I see that you close with the closing block and option BUY or SELL, if in addition to this you differentiate the groups, you may function since the orders will be exclusive, since you do not have your indicator I have not been able to do tests but In the main blocks (57.58.59.60) in the group filter you give it a number identifying them that will also serve as a recurring filter. I hope I have helped you something. 
Ah! Important point, although fxDreema has the option of crossing lines from top to bottom and quite the opposite, it is very important to know that since it is based on MQL4 / 5 in MQL4 / 5 there are no crosses, to make or identify a cross what is done is:
- Identify a line and ask if it is greater or less than the other line (refers to price).
- idem to the above.
With this, MQL knows that one line or curve is above the other, now you have to do the same but asking if the upper line or curve is now lower and the opposite with the other. This is what in MQL identifies a cross, as you can see it is a bit chaotic and the problem is when both are in a vertical point, Mql does not recognize them and it is when it gives you a false Yes or No, this must be taken into account. since for your case you should also give width to the crossing area indicating how many candles there must be in one crossing or another.