Trailing Stop build visually

I just wonder how can I build a trailing stop visually.  Any suggestion is appreciated.

For exact implementation of trailing stoploss, we need to be able to fetch order details by asset and positions details by asset. In visual builder, these tools are not added yet. We have a long-planned upgrade of the visual interface to include all blocks to cover the complete Blueshift Python API. But this workstream is a bit delayed at our end as we are working on a few other high-priority ones. So till these changes are introduced, the exact implementation is NOT possible in the visual interface.



However, assuming you are trading relative smaller volumes with market orders, we can go for an approximation as shown in the image. Here we approximate the entry price as the current price and 1) check if the SL is breached to exit or 2) update the entry price. Compare the base (without the trailing stop) strategy  - the NSE buy and hold template - with this trailing sl behaviour added.



Thank you Quantra Team