Skip to main content

Triggering Strategies with TradingView Alerts

Connect any technical indicator on TradingView to automate your trading strategies on Capitalise.ai - no code required.

Josh avatar
Written by Josh
Updated this week

We're excited to introduce a powerful new feature: TradingView Alerts Based on Conditions.

You can now trigger your Capitalise.ai strategies directly from TradingView alerts—unlocking a whole new world of possibilities. This means any condition available on TradingView can now be used to automate your trades, all without writing a single line of code.

What is a TradingView Alert?

TradingView alerts can be created based on any visual element on a chart - such as lines, prices, or indicators - and can also be triggered using custom Pine Script logic. When an alert is triggered, TradingView can send a message to a third party using what's called a webhook.

How does a webhook alert work?

When setting up any TradingView alert, you’ll have the option to select ‘Webhook URL’ under the ‘Alert Actions’ section. This allows the alert to automatically send data to Capitalise.ai to trigger your strategy.

A webhook is a method of sending a message to a specific URL when an alert is triggered.

Each webhook includes two key components:

  • URL – The web address that will receive the webhook message.

  • Message – A JSON-formatted payload that contains the webhook ID.

Since the message is structured as a list, you can include multiple IDs to trigger several webhooks at once.

When you create a Capitalise.ai strategy with a webhook condition, the strategy will automatically trigger as soon as your TradingView alert is activated.


How do you add a TradingView alert to your trading strategy?

In the Capitalise.ai wizard, simply add the condition ‘Webhook’ to your strategy setup:

Adding a tradingview alert webhook to capitalise.ai strategy

Once you type ‘Webhook’ in the Capitalise.ai strategy wizard, you’ll be provided with a unique URL and message specific to that webhook condition. Simply copy and paste these into the appropriate fields in the TradingView alert setup. When your TradingView alert is triggered, it will activate the corresponding condition in your Capitalise.ai strategy.


Example: VWAP-Based Trading Strategy

VWAP (Volume-Weighted Average Price) is a popular technical indicator used to identify whether an asset is trading above or below its average price throughout the day. Traders often aim to buy below the VWAP and sell above it.

Using this logic, here’s how a trading strategy might be defined:


Entry Conditions:

  • Go long (buy) when the price crosses below the lower VWAP band.

  • Enter the trade only after the first hour of the trading session, once prices stabilize.

  • Entry window remains open until 15:00 US Eastern Time.


Exit Conditions:

  • Close the trade when the price crosses above the upper VWAP band,

  • Or apply a stop-loss of 5%, whichever comes first.

  • All trades must be closed before the market’s official close.


Here’s how this setup would appear on a TradingView chart:

Setting a tradingview alert for a VWAP chart

To automate this trading strategy, follow these steps:

  1. Set the entry strategy in the Capitalise.ai wizard:
    “If a Webhook is triggered between 10:30 AM and 3:00 PM US Eastern Time, buy 30 MRNA shares.”

  2. Click on the Webhook condition, then copy the URL and Message (MSG1).

    Creating an automated trading strategy using a tradingview alert webhook


  3. Open TradingView and add the VWAP indicator to your chart.

    • Go to the Alert menu and set up the TradingView alert with the following parameters:

      • Asset: MRNA

      • Condition: Crossing Down

      • Value: VWAP, Lower Band

      TradingView alert on MRNA


    • Under “Options”, select “Once per bar”. This setting ensures that the alert triggers multiple times (including in future bars), allowing for multiple trades over time. However, it also prevents more than one alert from being sent per bar.

      For optimal results, it's recommended to choose a chart time frame smaller than 1 hour.


    • Under Alert Actions, choose “Webhook URL” and paste the URL you copied in step 3.

      Adding a webhook action to a tradingview alert

    • On the message section, paste MSG1 that you copied in step 3.

      Adding a message to a tradingview alert webhook

    • Click “Create.”

  4. Set the exit strategy in the Capitalise.ai wizard: “Close position if Webhook triggers, at a loss of 5%, or at 15:59 US Eastern time.”

  5. Copy the URL and message (MSG2).

  6. Next, open TradingView and set up the exit Webhook trigger. Follow the same process as before, but now configure it for when the price crosses above the upper VWAP

  7. Finally, paste the URL and MSG2 into the Webhook URL section.

    Create a tradingview alert on MRNA


  8. Return to Capitalise.ai and set your strategy to loop mode to enable continuous automatic entries and exits.

  9. Click Next and review your strategy on the confirmation page.

  10. Test your strategy risk-free using Simulation mode, or run it live and let Capitalise.ai execute trades directly through your trading account.

Notes:

  • While a strategy is in the entry phase, any webhook message related to the exit phase will be ignored. Similarly, during the exit phase, webhook messages related to the entry phase will be disregarded.

  • When a webhook message is received, the corresponding condition will remain triggered until the strategy progresses to the next phase (from entry to exit or vice versa).

Controlling multiple strategies from one alert

The Webhook feature is a powerful tool that unlocks numerous possibilities, one of which is the ability to trigger multiple automated strategies from a single alert. This functionality can be used in several ways:

  1. Triggering Multiple Conditions Across Strategies: For example, I can manage two identical strategies, with one connected to my Binance account and the other to my Interactive Brokers account. With a single alert, I can create a scenario that buys 0.5 BTC/USDT in my Binance account while simultaneously purchasing 5,000 USD worth of GBTC in my Interactive Brokers account.

  2. Risk Management: You can close all positions across your accounts with a single trigger, streamlining your risk management process.

  3. Managing Trades for Others: If you are a licensed money manager, you can manage multiple clients’ strategies. The client provides you with their Capitalise.ai webhook ID, and you can manage their trades by sending a TradingView alert to that webhook. This can be done for multiple clients at once. Importantly, your clients maintain full control over trade size, the ability to switch between simulated and live trading, and whether to continue or stop the automated strategy.

How does it work?

The message we send is in JSON format, containing a list of IDs. This list typically includes a single ID, though it can also contain multiple IDs.

  • A message containing 1 ID:
    {“alertId”: “3a89741a-2cea-49c9-a4ce-aef2840738c5”}

  • A message containing multiple IDs:
    {“alertIds”: [“38bb324b-4c2c-4582-b4be-bfecf534eda8”,“d2425ea0-e1b8-4554-a8e0-f2c658899283″,”3a89741a-2cea-49c9-a4ce-aef2840738c5”]}

By sending multiple Webhook IDs, we can trigger several conditions simultaneously.

Additional resources


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

Did this answer your question?