Thanks majinrex, I tell you:
https://fxdreema.com/shared/ObgZFYHce
1.- Okay.
2.- I manually open the positions to test this losing strategy, so you don't need anything in "on Tick".
3.- and 4.- In the "on Init" tab, block 13 "> losser" is a button called >losser, when pressing it on the chart it executes in "on Chart" the block "Mouse clicked on object" that It refers to the button called "> losser" and so later the entire sequence of blocks attached to this block is executed.
5.- Blocks 6, 7 and 8 work well, what they do is that once the position with the greatest loss is defined, its volume is obtained and multiplied by a constant to increase its volume, and another position is opened with this higher volume but against, and it was buy, sell opens and if it was sell, buy opens.
6.- The problem is that blocks 3, 4 and 5, which are to define the position of greatest loss, do not work, this is the part that I need help with.
How to get the highest losing position ?