> For the complete documentation index, see [llms.txt](https://docs.optionomega.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.optionomega.com/automation/webhooks.md).

# Webhooks

## Overview

Webhooks allow a third-party signal service, such as [TradingView](https://www.tradingview.com/), to trigger trade entries and exits in Option Omega (OO). Webhooks are configured at the ***strategy*** level. The strategy setup remains as specified in OO, but the Entry webhook ***replaces*** any existing entry criteria OO, becoming the sole signal for initiating that trade, while the Exit webhook ***supplements*** any existing exit criteria, serving as an additional signal to exit a trade. Multiple entries of a single strategy can be initiated from the entry webhook, while the exit webhook will initiate closing of ALL open positions of that strategy.&#x20;

{% hint style="danger" %}
Webhooks depend on third-party services, network connectivity, and other systems outside of Option Omega's control. Please make sure your webhook setup is properly configured, tested, and monitored, and always maintain appropriate risk controls. Option Omega cannot guarantee webhook delivery or execution and is not responsible for losses caused by delayed, failed, duplicated, or misconfigured webhook signals.
{% endhint %}

## Requirements

To use webhooks, you must have:

* An active subscription of Option Omega's [Premium Tier](/support/subscription-tiers.md).
* An authorized and connected brokerage account where the strategy will be traded.
* A saved [automation strategy](/automation/strategy-setup.md) in OO from which you want to manage via webhook.
* A signal service or platform that can send a custom JSON Payload via HTTP POST request to OO's webhook URL.

## Configuring Webhooks

To configure webhooks, start from your saved automation strategy. Click on the chain link icon on the top right, next to the clock (view activity log) icon to open the Webhooks slider.

<figure><img src="/files/D6qYADO1rV6apFi2C0yd" alt="" width="375"><figcaption></figcaption></figure>

### Enabling Webhooks

Click Enable Entry Webhook to activate webhooks for this strategy.

<figure><img src="/files/d4gFM99JOBAtw6QieSHU" alt="" width="375"><figcaption></figcaption></figure>

This will activate the Webhook URL and the Entry Webhook message.&#x20;

<figure><img src="/files/QSVVhhv4rxjBtQ52a9WS" alt="" width="375"><figcaption></figcaption></figure>

The signal service must send a JSON payload via an HTTP POST request to the **OO Webhook URL**. Click the **Copy** icon next to the URL to copy it and paste it into your third-party tool.

The **Entry Webhook** is enabled by default. OO generates a unique Entry message containing a token. Copy this message and configure your signal service to send it to the OO Webhook URL whenever your entry conditions are met.

You can optionally enable an **Exit Webhook** by clicking **Enable Exit Webhook**.

<figure><img src="/files/QutxLCnA0bXcke2DQMNk" alt="" width="375"><figcaption></figcaption></figure>

Once enabled, an Exit message will appear below the Entry Webhook. Copy this message and configure your signal service to send it whenever your exit conditions are met.

### Webhook Entries

The Entry Webhook **replaces any existing Entry Criteria configured on the strategy**.

OO generates a unique Entry token that must be sent by the third-party signal service. You can copy and paste the generated Entry message directly into your signal configuration.

When OO receives a valid Entry message at the Webhook URL, it treats the request as an entry signal and attempts to open a new entry or position of the strategy, following the pre-defined entry execution settings. Entry is attempted for one minute, with no retry to Entry Window, to prevent entering trades on a stale signals. Webhook entries may occur anytime between **9:32 AM and 3:59 PM**, overriding any entry times or floating entry window.&#x20;

The strategy's trade construction and sizing settings are still applied as defined in the strategy, including:

* Put and call legs
* Leg quantities
* Strike selection
* DTE selection
* Position sizing and capital allocation
* Max Open Positions

However, **all other Entry Criteria (including entry times, floating entry windows, VIX, technicals, and trade re-entry)  are ignored while the Entry Webhook is active**. The webhook becomes the sole signal that determines when a trade entry is made for that strategy.

{% hint style="warning" %}
Each valid Entry Webhook signal will initiate a new entry of the strategy until the (optional) daily execution limit is reached, max open positions is reached, the daily 100 trade limit is reached, or buying power / margin is exhausted. Please monitor and manage your capital allocation, trade sizing, and other limits accordingly.&#x20;
{% endhint %}

#### Daily Execution Limit

You can configure **Maximum Daily Executions** to limit the number of webhook-initiated entry attempts for the strategy each trading day.

Each successful entry is sized according to the strategy's configured position sizing or capital allocation settings. Once the Maximum Daily Executions limit is reached, OO will ignore additional Entry Webhook signals for the remainder of the trading day.

Other strategy or account constraints may prevent an entry before the daily execution limit is reached, including **Max Open Positions**, daily total trade limit, or insufficient buying power.

#### Managing the Entry Webhook

You can:

* Temporarily disable entries using the **Is Paused** toggle.
* Generate a new Entry token using the **Refresh** icon.
* Remove the webhook using the **Trash** icon.

Generating a new token invalidates the previous token, so your third-party signal configuration will need to be updated with the newly generated Entry message.

### Webhook Exits

The Exit Webhook is optional and **supplements the strategy's existing Exit Criteria** rather than replacing them.

OO will continue to monitor each open position using any Exit Criteria configured on the strategy, including:

* Profit targets
* Stop losses
* Early exit rules
* Profit actions
* Time actions
* Delta-based exits
* Short/long ratio exits
* Technical indicator exits

If OO receives the Exit Webhook message, it will attempt to exit **all open positions or trades of that strategy,** following the pre-defined exit executions settings of the strategy.&#x20;

{% hint style="warning" %}
Exit Webhooks apply at the **strategy level**, not to an individual trade or position. When triggered, the Exit Webhook will attempt to close any open positions of that strategy, so it is best suited for broad risk-management or contingency signals. In most cases, OO- or broker-managed profit targets, stop losses, or early exits should continue to be used for managing individual positions.
{% endhint %}

#### Managing the Exit Webhook

You can:

* Temporarily disable webhook exits using the Exit Webhook's **Is Paused** toggle.
* Generate a new Exit token using the **Refresh** icon.
* Remove the Exit Webhook using the **Trash** icon.

Pausing or removing the Exit Webhook does not affect the Entry Webhook.

## Example Configuration

This example will walk through configuring a webhook with TradingView. It is intended only to demonstrate the webhook configuration process and not intended to be an actual strategy or trade idea. We are setting up a basic mean reversion play to enter a long call on SPX when price crosses above the lower Bollinger Band.&#x20;

We start by opening an SPX chart in TradingView and adding an indicator via the Indicators button on the top menu. You can choose from existing technical indicators, custom indicators (created via TradingView's Pinescript), or indicators from the TradingView Community.&#x20;

For this example, we'll search for Bollinger Bands and add them:&#x20;

<figure><img src="/files/601FziQhMdLMm68AtFfN" alt=""><figcaption></figcaption></figure>

With the indicator added to the chart, we now click on Alert to create a custom alert using the Bollinger Band indicator. Set the Condition to `Price`, the action to `Crossing Up`, the reference value to `BB (20, SMA, close, 2)` (the Bollinger Bands with default parameters), and select `Lower`. This tells TradingView to trigger an alert when the Price crosses up above the lower band. Set the Trigger to once per minute, and choose the desired expiration.

<figure><img src="/files/MX6migmY42tO4T4EDVOd" alt=""><figcaption></figcaption></figure>

At this point, you should have a functioning alert. We recommend testing this alert using real-time market data to ensure it is functioning correctly before enabling the webhook.

When you're happy with the alert, enable the web hook by going to the Notifications area.&#x20;

Here you can choose from various options such as in-app, toast message, email, webhook, or audio options. For the purpose of triggering trades in OO, ensure Webhook URL is checked and the webhook URL (as shown above in [Enabling Webhooks](#enabling-webhooks)) is copied and pasted in exactly as shown in the OO app. You can enable other notification types if you wish. Click Apply to save changes.

<figure><img src="/files/cd82X9X7qIqWvkULgrrX" alt="" width="375"><figcaption></figcaption></figure>

Back on the Create Alert modal, click on the Message field. You can now give the alert a name and add the token associated with the strategy you wish to trade using this web hook. This is shown in [#enabling-webhooks](#enabling-webhooks "mention") above. The token needs to be copied and pasted exactly as presented in OO.

<figure><img src="/files/fcxj7ypXtp0gyvPpNIca" alt=""><figcaption></figcaption></figure>

Click Apply to save the message and Create to save the alert. To see your alerts (and webhooks) for a particular chart, click the Alerts icon (alarm clock) on the right menu. You'll see all active alerts with the ability to Pause, Edit, or Remove.&#x20;

<figure><img src="/files/mSkKKqii6k2osaPOCn1R" alt=""><figcaption></figcaption></figure>

You can also switch from the Alerts list to the Log, which will show all alerts that have been triggered including webhook deliver and the deliver status:

<figure><img src="/files/CaeXGr1tsuD4KALpw2lf" alt=""><figcaption></figcaption></figure>

For Exit Webhooks, you can use Trading View alerts but the message would be updated with the appropriate token for the Exit Webhook of the strategy you wish to close.

## Activity Log

The Activity Log and Trade Log Close Reason will indicate entries and exits initiated by webhooks.&#x20;

* An entry is logged when an entry webhook is received, initiating a trade opening.
* When trades are closed via webhook, the condition "Webhook Exit" will be shown.
* If an exit webhook is received but there are no open positions to close a log entry will be shown, "Skipping webhook close: no open positions"
* "Webhook Exit" will be shown as the close reason for any trades closed via webhook.&#x20;

## Disabling or Removing Webhooks

* Entry and Exit Webhooks can be temporarily disabled using their respective **Is Paused** toggles.
* You can also generate a new Entry or Exit token using the **Refresh** icon.&#x20;
  * This is useful if a token has been compromised or is associated with a signal configuration that can no longer be disabled or updated.
  * After generating a new token, copy the updated Entry or Exit message into your third-party signal configuration. The previous token will no longer be valid.
* You can permanently remove a webhook using the **Trash** icon.
  * Removing the **Exit Webhook** leaves the **Entry Webhook** active.
  * Removing the **Entry Webhook** removes both the **Entry** and **Exit Webhooks**.
