Skip to main content
All CollectionsFeaturesNew Features
How to Create a Dynamic TradingView Alert Condition?
How to Create a Dynamic TradingView Alert Condition?

Un-trigger a Trading-View webhook condition to avoid strategy triggers when your TradingView condition is no longer met.

Josh avatar
Written by Josh
Updated over a week ago

What is a TradingView Alert Condition?

TradingView Alert Conditions allow a trader to create automated trading strategies triggered by one or more of the wide array of TradingView Alerts.

Why Would a Trader Want a TradingView Condition to be more Dynamic?

Whenever an automated strategy contains multiple conditions that are expected to be met simultaneously to trigger, having a webhook condition creates a problem.

Since the webhook message triggers the webhook condition, the condition is considered triggered even if the relevant scenario is not valid anymore. Adding an 'untriggering' message to a webhook condition allows you to make sure the webhook condition doesn't stay triggered when it is no longer valid. This is especially useful when one of the webhook conditions is time-sensitive since a time-triggered condition once triggered could never untrigger on its own. Additionally, an 'untriggering' message also allows you to turn the trigger off if the asset moves in an unfavorable direction.

How to Untrigger a TradingView Alert Condition

  1. Create a new strategy or amend an existing strategy that includes a webhook message that triggers by a TradingView alert.

  2. Create the untrigger message which acts as another webhook message and contains the the original alertId +"untrigger":true.
    An example might look like this:
    {"alertId": "0b47a939-fad1-4e1c-b9d4-768ac082e123", "untrigger":true}

  3. If or when receives a webhook msg that contains: "untrigger":true
    Then the original webhook message will untrigger, changing the status from on to off.

    1. For example:
      The following message
      {"alertId": "0b47a939-fad1-4e1c-b9d4-768ac082e123", "untrigger":true}
      Will untrigger any webhook condition that has the alertid 0b47a939-fad1-4e1c-b9d4-768ac082e123

Let's demonstrate with an example trading strategy:
This Entry Condition links the Relative Strength Index with the Volume Weighted Average Price (VWAP) which activates by including a Trading View Webhook Alert.
We are looking to trigger the webhook condition when BTC/USDT is greater than the Lower Band of the Volume Weighted Average Price (VWAP).
If the BTC/USDT RSI is below 30 and Webhook triggers buy 1,000 USD worth of BTC/USDT

Copy the Webhook URL so you can later use it as demonstrated below.

Go back to Trading View and set an alert that will trigger when BTC/USDT is greater than the Lower Band of the Volume Weighted Average Price (VWAP). This will trigger the webhook condition of this strategy.

Insert the URL code in the space Webhook URL. Name the message "On" and insert the message from the Wizard in the message box as shown below.

btc webhook message image 1

In the example below, an ‘untrigger’ message was created with a condition of the BTCUSDT becoming Greater than the VWAP Lower Band. This is in contrast to the above original ‘trigger’ message of the BTCUSDT being Less than the Lower band of the VWAP.

Stay tuned for more examples of how to use TradingView Webhook messages (the trigger and untrigger messages) to further finetune your automated trading strategies.

Did this answer your question?