I have to say this once again. If anyone suspects a bug, please, make a simple project with the minimum blocks required (should be no more than 4-5 blocks) to demonstrates the bug + short explanation of what is expected to happen.
Sorry, but I don't have this will to dissect projects with 100s of blocks, and even worse - containing many input properties, which will probably be way different on my end.
I ran your project in my tester for a period of 1 year and guess what - I got only 2 positions for the whole time. I don't know why, but I don't want to know why. I just want a simple example, that when I run it, it will fail.
Don't forget that if you (I mean everyone) understand your project, this doesn't mean that I understand it.
When there is a bug, I really want to fix it, but I don't want to explore anyone's projects, strategies and ideas, while searching for a bug that may not even appear on my side at all.
How to make such example?
- Download the project as .mq5 file, then import it back. A new project will be created. Maybe rename the new one. Still ensure that the original project is still there.
- Start deleting blocks. First delete those blocks who surely have nothing to do with the problem. At this point maybe half of the blocks should be gone.
- Continue deleting other blocks. While deleting blocks, test to see that the problem still remains. If the problem goes away, return one or more steps back (un-delete blocks).
- Repeat this until very few blocks remain, and the problem still remains. Leave only the Buy or the Sell side.
- If indicators are not necessary, delete them.
- Remove all input parameters (Constants), because they often lead to unnecessary confusions.
- Remove the Variables as well, unless they are needed for the problem to appear.
- The final example should look nothing like the original project. It should contain less than 10 blocks for sure.