Hello Amine, and thanks for the quick response.
On your suggestion I changed blocks to the stop loss except that I have to enter a negative value if I want to move the stop loss to a profit (for example, to move 25 pips in profit must enter -25).
Furthermore, though I have found a mistake in the previous version of the strategy. In its speed I have chosen the wrong variable in the assign block (see picture).
Computers do not make mistakes - people make mistakes!
Now both versions work the way I imagined.
Thanks again for the help!
regards