TradingView offers a powerful alerting system that allows us to receive notifications when various market conditions meet our specific criteria. With Webhooks, we can trigger bot automations based on specific trading signals. This connection allows bots to receive external signals from charts, indicators, custom strategy scripts, price movements, and custom drawings. The combination of TradingViews charts with Option Alpha’s automation capabilities introduces a whole new world of possibilities.
How to set up TradingView Alerts
TradingView allows traders to create custom alert triggers that extend far beyond simple price notifications. TradingView alerts are immediate notifications when the market meets your custom criteria. Those notifications can then be linked to your Option Alpha account via webhooks.
If you don’t have a TradingView account, create one here.
You can receive alerts based on various conditions, including:
TradingView Alert Conditions
- Price Alerts: Get notified when a price crosses a specific level, goes above/below a certain value, or breaks through resistance/support levels.
- Indicator Alerts: Set alerts based on any TradingView indicator, including community-created ones. You can use predefined conditions or create custom triggers.
- Strategy Alerts: Receive alerts whenever a strategy executes an order.
- Custom Drawing Alerts: Create trend lines, channels, and other drawings on your charts and get alerts based on price interaction with those drawings.
TradingView Alert Types
Various alert types provide additional flexibility when determining exactly what type of alert you want to trigger.
- Crossing: Receive alerts when the price crosses a specific level. This is the most common alert, essentially signaling "inform me when the price reaches X," which activates when the current price intersects the preset value at the time of alert creation.
- Crossing Down / Crossing Up: This is a refined variation of the Crossing alert where you can determine if the price crosses during an upward or downward trend. The Crossing Down alert activates when the current price moves down past the set value in the alert. Conversely, the Crossing Up alert notifies you when the price surpasses the set value in an upward direction.
- Greater Than/Less Than: Be alerted when the price breaks above or below a certain level. This alert is useful when you need to be informed not just when the price reaches a specific level, but actually surpasses it. The Greater Than alert is activated when the price series attains a value exceeding the one specified in the alert. On the other hand, the Less Than alert goes off when the series drops to a value below the predetermined level in the alert.
- Entering/Exiting & Inside/Outside Channel Alerts: Get notified when the price enters, exits, stays inside, or moves outside a defined price channel. Channels represent specified limits above and below a certain price, typically outlining the normal random fluctuations in a stock's price. A movement across these channel boundaries is often considered significant or unusual. When the price series enters a predefined channel, an Entering Channel alert is activated. Conversely, an Exiting Channel alert occurs when the price series leaves the channel. You can set the boundaries of these channels based on series or specific levels, or a mix of both. These boundaries help in monitoring the position of the last bar in relation to the channel.
- Moving Up/Down: Get notified when the price enters, exits, stays inside, or moves outside a defined price channel. This alert is a variation of the Crossing Up / Crossing Down alert, with an added element of time. It notifies you if the stock price increases or decreases by $X within a specified time frame (measured in bars). The Moving Up alert activates if the price ascends by a value you determine in the alert, all within a predefined number of bars. Similarly, the Moving Down alert functions in the same way but for when the price declines.
- Moving Up%/Down%: Get notified when the price enters, exits, stays inside, or moves outside a defined price channel. The Moving Up % alert operates similarly to the one mentioned previously, but it deals with percentage changes instead of fixed dollar amounts. This alert is activated when the price increases by a specific percentage that you set. Likewise, the Moving Down % alert is triggered when the price decreases by the predetermined percentage.
- Drawing Alerts: You can also set alerts based on some technical drawings you create on the chart. These alerts are dynamic and adjust automatically if you modify the drawings. Drawing alerts depends on the chart resolution you're using.
Connect your Option Alpha automations to TradingView
Link TradingView alerts to your Option Alpha bots in a few simple steps to unlck increased trading flexibility:
Create Your Webhook
You can create a new webhook URL inside your Option Alpha Settings:
Or when creating a New Automation in a bot's Settings tab (you can also use an existing webhook; webhooks can be used in multiple bots):
Click the copy icon to save the URL to your clipboard.
Schedule your automation trigger
In your bot’s Settings, add the automation you want to run when the webhook is called, and select ‘Webhook’ from the available triggers. When your Webhook is called, the automation will run instantly.
For example, if a TradingView moving average crossover signal triggers, the webhook is called, telling the High IV Rank Bot to run the 5-Minute Indicator Buy Signal automation.
Assign webhook URL to TradingView alert
Inside TradingView, click the Alert Button, and in the Notifications tab paste the unique Option Alpha webhook URL:
Define your settings
In the alert’s Settings, specify the conditions under which the Webhook should trigger an automation. You can use a technical indicator, chart pattern, price action, and much more. TradingView allows you to create your own alerts or use shared scripts.
For example, this webhook would be called if SPY's 9-day SMA crossed the 21-day SMA, and trigger an automation of your choice in Option Alpha:
Your Option Alpha Webhook is now set up in your TradingView account and will be called if your criteria are met.
Your automation can evaluate additional market criteria, position filters, opportunity checks, and more. Or, it can simply open a position. It can even run alongside other automations. You have full control to customize your Webhooks and automations to accomplish your strategy goals.
Option Alpha & TradingView examples
Below are two use cases to demonstrate how we can use webhooks and TradingView alerts to place trades based on specific technical indicator signals. We'll look at a simple SMA crossover that can be used on any timeframe and supported ticker. Next, we'll share a custom indicator that evaluates the opening range each trading day.
Disclaimer: These indicators are free tools provided as examples of how to use webhooks in the Option Alpha platform. Option Alpha does not recommend, suggest, or advise any particular trading strategy or indicator. Past performance is never indicative of future results.
Trigger an automation based on an intraday SMA crossover
This step-by-step guide will help you follow along with this example:
Moving average crossovers are one of the most common types of signals traders look for to gauge market changes. As an example of how to harness webhooks we wrote a simple moving average crossover indicator for TradingView that offers Buy and Sell signals when the Fast period moving average crosses over or under the Slow period.
This custom indicator allows users to select from multiple types of moving averages (Simple Moving Average - SMA, Exponential Moving Average - EMA, Weighted Moving Average - WMA, and Volume Weighted Moving Average - VWMA) for any timeframe, providing flexibility to match various trading strategies.
To capture these signals, establish automations that have unique webhook triggered automations for the Cross Up (buy) or Cross Down (down) conditions. This will ensure that each webhook triggers the correct automation.
For example, we created an 'MA Cross Up' webhook and set it to trigger the 'Cross Up' automation to place a trade in the bot if the TradingView alert triggers.
Inside of TradingView you’ll want to establish two alerts in the 'Settings' tab (one for each signal type) and then paste your unique webhook into each alert type. Be sure to define the alert name to help keep things organized on TradingView.
This is how the 'Crossing Up' alert is displayed in TradingView. The alert uses a one-minute timeframe checking the 5 and 10 period SMAs.
Paste the webhook URL into the alert's notifications and you're ready. Once the Option Alpha webhook is pasted into the notifications tab, the webhook will be called when the 5 SMA crosses above the 10 SMA, triggering the automation.
We can see on the chart that the 'Crossing Up' alert triggered a buy signal at 13:29 and the 'Cross Up' automation ran immediately, opening a bullish position in the 'MA crossovers' bot.
Trigger an automation based on a break of the Opening Range
Another highly requested strategy is trading the OR or Opening Range. The opening range is typically the first 15 or 30 minutes of the morning session and can provide key insight into how the day's price action may unfold. Traders use the Opening Range high and low prices as key levels to establish breakout signals.
As an example of how to harness webhooks, we wrote a simple Opening Range indicator for TradingView that offers Buy and Sell signals when the price crosses and closes above or below these breakout levels.
This Opening Range indicator is designed to help traders identify and visualize the opening range of the trading session. This indicator highlights the high and low prices within a specified time period at the start of the trading day, known as the opening range. It also provides critical insights into potential breakout points and trading signals based on this range.
To capture these signals, establish automations that have unique webhook triggered automations for the Break Up (buy) or Break Down (sell) conditions. This will ensure that each webhook triggers the correct automation.
Again, inside of TradingView you’ll want to establish two alerts, one for each signal type. Be sure to define the alert name to help keep things organized on TradingView.
Paste the webhook URL into the alert's notifications and you're ready. The alert can trigger an automation if SPY's price breaks above the 30-minute opening range after 10:00am EST.
In this example, the Break Up signal was generated when the price closed above the high level of the Opening Range and triggered the alert which then passed the information through the webhook to the Opening Range bot which ran the linked automation and opened a long position in response.
*Option Alpha is not affiliated with TradingView and does not endorse any specific strategy, indicator, or alert. Additional fees may be required to use TradingView. Option Alpha is not responsible for any data latency issues inside TradingView.