Experts: Code Block for "Trailing Stop" based on current market price. (Ask / Bid)

 

Code Block for "Trailing Stop" based on current market price. (Ask / Bid):

This code block loops through all opened position and do trailing based on Ask and Bid prices.

Author: Hapu Arachchilage Tharindu Lakmal

 
Thanks, appears to work on all orders , It may be necessary to add a magic filter ( or not depending on your purpose)
 

Your code doesn't work. It triggers the commencement of a trailing SL, though the SL then moves with the price, and doesn't "stop" anything.

Please don't post code snippets like this unless it actually works. Seriously frustrating when newcomers are looking for code examples and find untested code.