Hi,
I’m setting up an automated strategy using TradingView alerts with a webhook to Fyers.
I want to use the {{strategy.position_size}} variable in my alert message to determine the direction:
-
Positive → Long (Buy)
-
Negative → Short (Sell)
However, the Fyers webhook integration doesn’t natively support this variable. I need a solution that:
-
Interprets the
position_sizevalue from the TradingView alert. -
Executes the corresponding Buy/Sell order on Fyers.
-
Includes a safety check to ensure a Sell is only placed if a Buy was previously executed (and vice versa).
Could you please guide me on how to implement this?
Thank you.