Help on Trailing stop block appreciated (SOLVED)
-
If those SL are wrong then MS Excel is wrong because I got them there.
Can you please tell me which one is the wrong one?Yes, they are static from there on, but if I have three open traedes at the same time, there will be three different open prices to be considered on the same tick. This means that those numbers (0.04493 and 0.01123) are to be changed three times on the same tick. So I need three different static values. That is the problem.

-
@l-andorrà You can calculate them in the loop. Shouldn't bei so hard for the CPU as it's all in memory.
-
It's not a question of CPU capacity, but of how to create the loop. I tried that on my shared project, but to no avail so far. Should the loop be positioned under the 'For each trade' block or above? I guess it should be below, so that open proces should be scanned case by case. However, mi initial configuration doesn't do that and I don't know why.

-
@l-andorrà Well, I did something similar just with ATR instead of % of open price. But maybe you can see what I do there.

Of course I have to get to know the bar the trade was opened (custom MQL block), that you don't need as you can get the open price just by the curent order in the loop.
Then you do your variables calculations for trailing stop, step and start. I use Pips since I had issues with price fractions.
Finally you place the variables in the according fields in the Trailig Stop block.
I think your approach should work the same way. Since my ATR value of 1 bar before order was opened is a static value for that trade, your percent from open price is also static.
-
Thank you very much for your help. I need to study it and will be back with my results.
-
@trader-philipps Retook this project after a break and I can confirm it doesn't work due to the pips offset part. The stop begins to move AFTER the first trigger proce has been hit and it does to the open price level, not to the correct price one, sadly. This is why I followed the recommendation of josecortesllobat and created the following structure:
https://fxdreema.com/shared/joKtM0eBb
It works fine except for block 16, the one calculating the multiplier loop. If the block is turned off and the multiplier if static, it works fine. However, when I activate the loop it doesn't work.
Any help will be much appreciated.
-
I reply to myself. I found the problem. The variable called 'multiplier' doesn't work. No matter what initial value I initialize it with. The EA transforms it into value 1 no matter what. I tested values 10 and 100, but to no avail. For a reason I don't understand its value is moved to 1 every single time.
This is the first time this happens to me. Is it a weird bug?
-
Finally I got it. It was not a bug. I simply didn't break the correct loop. After some more search on the forum I found the solution. This is the final result:
https://fxdreema.com/shared/ajzZ8XE8b
Hope it helps to others.
