Reverse Trade upon Stop Loss Hit

Hello, I couldn’t execute reverse trade upon stop loss. I have provided the below 2 commands in the Tradingview alert message. But immediately it executes both Buy order and sell stop order and it exits the Buy order immediately then Sell stop was active.

1 BTCUSDm q=0.01 sl=0.4% td=1% ts=0.5%
-1 BTCUSDm q=0.01 p= -0.4% sl=0.3% td=0.5% ts=0.3%

How can I achieve this feature? Any help would be highly appreciated.

Thanks.

Hello @pravatkc

There are two mistakes in your commands;

  • Mistake 1: Extra space in the parameter: p= -0.4%:x: Incorrect
  • Mistake 2: Using a Sell Stop instead of a Sell Limit to catch a reversal after the SL is hit.

Correct Command Example

If you’re setting up a Sell Limit as a backup in case your long SL hits:

-1 BTCUSDm q=0.01 p=0.4% sl=0.3% td=0.5% ts=0.3%

:white_check_mark: p=0.4% – No space between the parameter and the value.
:white_check_mark: Using a Sell Limit, which is appropriate for entering a short when the price moves up to a certain level after hitting SL.


:bulb: Pro Tip

Always double-check your parameter formatting in the Automation Guide available under your Webhook Details section:

  • No spaces between param=value
  • Choose the correct order type (limit vs stop) based on your strategy logic.

Let me know if you’d like more help.

Tash!