What is a TradingView Alert Condition?
A TradingView Alert Condition allows traders to automate actions within a strategy based on signals generated by TradingView alerts. These alerts can be based on price, indicators, or custom scripts, and when triggered, they can communicate with your strategy through webhooks.
Why Make a TradingView Condition Dynamic?
In strategies where multiple conditions must be true at the same time, webhook alerts can create a challenge. When a webhook alert is sent, the condition it represents is marked as true, even if the underlying scenario is no longer valid.
This is where dynamic behavior becomes crucial. By adding an "untriggering" message to the webhook condition, you can ensure that the condition doesn't remain true forever. This is especially helpful when:
The alert condition is time-sensitive and shouldn't remain active beyond a specific moment.
The market moves in an unfavorable direction, and you want to cancel the trigger.
You need more control and accuracy in aligning TradingView alerts with your strategy’s logic.
This “untriggering” message allows the condition to return to false when appropriate, making your strategy more responsive to real-time changes.
How to Untrigger a TradingView Alert Condition
Create a new strategy or edit an existing one that includes a webhook message triggered by a TradingView alert.
Create the untrigger message.
This message acts as a second webhook that contains the original alertId +"untrigger":true.
An example might look like this:
{"alertId": "0b47a939-fad1-4e1c-b9d4-768ac082e123", "untrigger":true}
How Capitalise.ai processes the untrigger message:
When Capitalise.ai receives this message with "untrigger":true, it will change the status of the original webhook condition from on to off — effectively untriggering it.
Example:
If the following message is received:
{"alertId": "0b47a939-fad1-4e1c-b9d4-768ac082e123", "untrigger":true}
It will untrigger any active webhook condition with the alert ID 0b47a939-fad1-4e1c-b9d4-768ac082e123, turning off the trigger for that condition.
Example Scenario for Using Untrigger
Let’s see how this works with a practical example:
Imagine you have a strategy that uses two conditions to trigger a buy order for BTC/USDT:
Condition 1: The RSI of BTC/USDT is below 30.
Condition 2: The price of BTC/USDT is above the lower band of the VWAP.
The idea is to trigger a buy order for $1,000 worth of BTC/USDT when both of these conditions are met. Once the TradingView webhook triggers, you proceed with the buy.
But what happens if the price moves against the conditions? For example, if the price no longer holds above the lower VWAP band, you don't want to continue executing the strategy.
In this case, you would use the untrigger message. If the price moves unfavorably, the untrigger message will be sent to stop the strategy from executing further based on the outdated condition.
Copy the Webhook URL
Once you've set up the strategy with the webhook condition, copy the Webhook URL provided by Capitalise.ai. You'll need this URL to connect with TradingView and send the webhook alerts.
Set Up the TradingView Alert
Go back to TradingView and create a new alert.
Set the condition for when BTC/USDT is less than the Lower Band of the Volume Weighted Average Price (VWAP). This condition will trigger the webhook for your strategy.
In the Alert Settings, locate the Webhook URL field and paste the Webhook URL you copied from Capitalise.ai.
Name the message as "On" to indicate the alert is being triggered.
In the Message box, insert the message you received from the Capitalise.ai Wizard. The message should be structured to contain the relevant data required to trigger the strategy. The webhook message might look something like this:
In the example below, an ‘untrigger’ message is created with the condition that BTC/USDT becomes greater than the VWAP Lower Band. This contrasts with the original ‘trigger’ message, where the condition was BTC/USDT being less than the VWAP Lower Band.
Note: All screenshots and examples are for technical demonstration purposes only. They should not be considered as recommendations for any specific trading strategy, nor do they constitute any form of advice. Please click here for further explanation