---
title: Send TradingView Alerts to Interactive Brokers TWS via Webhook
slug: send-tradingview-alerts-to-interactive-brokers-tws-via-webhook
date: 2026-09-02
modified: 2026-09-02
author: Bhavishya Goyal
excerpt: ""
meta_description: "Connect TradingView alerts to Interactive Brokers TWS via webhook. IBKR now has 5.19M accounts (+34% YoY). Full API settings, ports inside."
focus_keyword: tradingview interactive brokers webhook
canonical_url: "https://blog.pickmytrade.io/send-tradingview-alerts-to-interactive-brokers-tws-via-webhook/"
og_title: Send TradingView Alerts to Interactive Brokers TWS via Webhook
og_description: "Connect TradingView alerts to Interactive Brokers TWS via webhook. IBKR now has 5.19M accounts (+34% YoY). Full API settings, ports inside."
og_image: "https://blog.pickmytrade.io/wp-content/uploads/2026/09/Gemini_Generated_Image_eu1rmheu1rmheu1r-1024x572.avif"
schema_type: FAQPage
categories:
  - Interactive Broker
  - TradingView
tags: []
reading_time: 13
word_count: 3148
robots: "index, follow"
lang: en-US
---

# Send TradingView Alerts to Interactive Brokers TWS via Webhook

Trader Workstation has no webhook listener. There’s no URL you can paste into TradingView that TWS will ever answer directly, and that single fact is why more setup guides for this pairing get abandoned halfway through than for almost any other broker. Interactive Brokers built TWS around a local socket API, not an inbound HTTP endpoint, so “just paste the webhook URL” doesn’t work the way it does for cloud-native brokers. That doesn’t mean it can’t be done, though. It means something has to sit between TradingView and TWS, translating one protocol into the other, and this guide covers exactly how that bridge works: the specific TWS and IB Gateway settings that block orders when left on their defaults, the JSON payload that actually reaches your account, and what to check when an alert fires but nothing shows up in your order log.

Table of Contents

1. [The Checklist Before You Start](https://blog.pickmytrade.io/#the-checklist-before-you-start)
2. [Why Doesn’t TradingView Just Connect to IBKR Directly?](https://blog.pickmytrade.io/#why-doesnt-tradingview-just-connect-to-ibkr-directly)
3. [Step 1: Turn On API Access in TWS](https://blog.pickmytrade.io/#step-1-turn-on-api-access-in-tws)
4. [Step 2: Link the Account Inside PickMyTrade](https://blog.pickmytrade.io/#step-2-link-the-account-inside-pickmytrade)
5. [Step 3: Building the JSON Alert Message](https://blog.pickmytrade.io/#step-3-building-the-json-alert-message)
6. [Step 4: Attach the Webhook to a TradingView Alert](https://blog.pickmytrade.io/#step-4-attach-the-webhook-to-a-tradingview-alert)
7. [Step 5: Solving the “TWS Must Stay Open” Problem](https://blog.pickmytrade.io/#step-5-solving-the-tws-must-stay-open-problem)
8. [Step 6: Test Without Risking Real Money](https://blog.pickmytrade.io/#step-6-test-without-risking-real-money)
9. [Why Does the Alert Fire but No Order Ever Lands?](https://blog.pickmytrade.io/#why-does-the-alert-fire-but-no-order-ever-lands)
10. [Asset Classes You Can Actually Trade Through This Setup](https://blog.pickmytrade.io/#asset-classes-you-can-actually-trade-through-this-setup)
11. [How Fast Is Alert-to-Fill on IBKR Compared to a Futures-Native Broker?](https://blog.pickmytrade.io/#how-fast-is-alert-to-fill-on-ibkr-compared-to-a-futures-native-broker)
12. [Signs Your Setup Is Actually Working](https://blog.pickmytrade.io/#signs-your-setup-is-actually-working)
13. [Frequently Asked Questions](https://blog.pickmytrade.io/#frequently-asked-questions)
14. [Start on Paper, Then Let It Run](https://blog.pickmytrade.io/#start-on-paper-then-let-it-run)

The most common support ticket on this integration isn’t a bad webhook URL. It’s Read-Only API, a checkbox IBKR enables by default on every fresh TWS install, silently blocking every order the API tries to place. Nothing errors loudly. The order just never lands.

For the broader case on why IBKR needs a relay at all and how it compares to a DIY Python bridge, PickMyTrade’s [2026 IBKR automation guide](https://blog.pickmytrade.io/tradingview-interactive-brokers-automation-2026/) covers that decision. This piece picks up where that one stops: the actual TWS configuration, port by port.

&gt; **Key Takeaways**
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; - TWS and IB Gateway have no native webhook listener. PickMyTrade bridges TradingView’s webhook to your TWS/Gateway session over the local socket API instead.
&gt; - Read-Only API is enabled by default in TWS and blocks every order placed through the API until you turn it off in Global Configuration.
&gt; - IBKR now has roughly 5.19 million funded accounts, up 34% year-over-year, and PickMyTrade’s cloud-hosted Gateway option removes the “keep TWS open” requirement for traders who don’t want a machine running around the clock.

## The Checklist Before You Start {#the-checklist-before-you-start}

Five things, and the one that trips up more people than the rest combined is TWS itself. You need a funded or paper IBKR account, TWS or IB Gateway installed, a paid TradingView plan, a PickMyTrade account, and roughly 20 minutes. Budget more like 30 if this is your first time inside TWS’s configuration menus.

**Your checklist:**

| Requirement | Detail | Why it matters |
| --- | --- | --- |
| IBKR account | Live or paper (DU-prefixed IDs) | The destination for every order |
| TWS or IB Gateway | Installed and logged in | PickMyTrade connects through this, not directly to IBKR |
| TradingView plan | Essential, Plus, Premium, or Ultimate | Webhook alerts are paid-tier only |
| PickMyTrade account | Free trial or paid subscription | Translates the webhook into a TWS API order |
| Time | ~20-30 minutes | Most of it is one-time API configuration |
| Difficulty | Intermediate | One extra layer versus a cloud-native broker |

![A laptop and desktop computer set up on a white desk, representing the workspace used to configure TWS and connect a PickMyTrade account.](https://images.pexels.com/photos/8636589/pexels-photo-8636589.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1200&amp;fm=webp)

Every paid TradingView tier includes webhook notifications, so Essential at roughly $14.95/month is enough to run this setup. What changes across tiers is how many alerts you can keep active at once, not whether webhooks work at all.

## Why Doesn’t TradingView Just Connect to IBKR Directly? {#why-doesnt-tradingview-just-connect-to-ibkr-directly}

Because TWS was built as a desktop trading terminal with an API bolted on for algorithmic access, not as a cloud service waiting for inbound requests. The TWS API, also called the ibapi, speaks over a local TCP socket. TradingView’s webhook system speaks HTTP POST. Neither side understands the other without a translator sitting in between.

That’s the whole reason a relay exists in this stack. PickMyTrade holds a live socket connection to your TWS or IB Gateway session, receives your TradingView webhook over HTTPS, and converts the JSON payload into the order calls TWS’s API actually expects. Interactive Brokers’ own account growth is part of why this gap matters to so many traders now: the broker crossed roughly 5.19 million funded accounts in mid-2026, up 34% year-over-year from 3.87 million a year earlier.

Interactive Brokers Customer Accounts, 2024-2026
Interactive Brokers funded customer accounts: 2.92 million in Q2 2024, 3.34 million in Q4 2024, 3.87 million in Q2 2025, and 5.19 million in Q2 2026, a 34% year-over-year increase.

Interactive Brokers Customer Accounts (2024-2026)
Total funded accounts, in millions, by quarter

0M
1M
2M
3M
4M
5M
6M

2.92M
3.34M
3.87M
5.19M

Q2 2024
Q4 2024
Q2 2025
Q2 2026

**TWS versus IB Gateway, in short:** TWS is the full desktop trading platform with charts, watchlists, and order tickets built in. IB Gateway is a stripped-down version that only handles the API connection and login, with no charting interface. Either one can serve PickMyTrade’s connection. Gateway uses less memory and is the better pick if you’ll never look at TWS’s own screens.

## Step 1: Turn On API Access in TWS {#step-1-turn-on-api-access-in-tws}

Open TWS or IB Gateway, log in, then go to **Edit → Global Configuration → API → Settings**. Check **Enable ActiveX and Socket Clients**. Without that box checked, nothing outside TWS itself can talk to it, and PickMyTrade’s connection attempt fails silently before it ever reaches your account.

**The four settings that matter most:**

| Setting | What to set it to | Why |
| --- | --- | --- |
| Enable ActiveX and Socket Clients | Checked | Turns on the API entirely |
| Read-Only API | Unchecked | Enabled by default; blocks every order otherwise |
| Socket port | 7496 live / 7497 paper (TWS)4001 live / 4002 paper (Gateway) | Must match what PickMyTrade expects for your account type |
| Trusted IP Addresses | 127.0.0.1 for a local machine, or your VPS/PickMyTrade IP for remote | Skips the manual connection-confirmation popup |

![A close-up of a laptop screen with programming code, representing the API configuration screen used to enable socket access in TWS.](https://images.pexels.com/photos/34803987/pexels-photo-34803987.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1200&amp;fm=webp)

Read-Only API deserves its own paragraph, because it’s the setting that causes the most confusion. It has nothing to do with market data permissions. It’s a blanket switch that lets the API view your account but rejects every order request, and IBKR ships it turned on by every fresh install. Uncheck it, click **Apply**, then **OK**, and restart TWS for the change to take.

One more detail worth flagging before you move on. If you’re running TWS on the same machine as PickMyTrade’s connector, `127.0.0.1` in Trusted IP Addresses is enough. If you’ve moved TWS onto a VPS, or you’re using PickMyTrade’s own cloud-hosted Gateway, you’ll add that server’s IP instead, and you’ll need to uncheck “Allow connections from localhost only” for the remote address to actually work.

## Step 2: Link the Account Inside PickMyTrade {#step-2-link-the-account-inside-pickmytrade}

Log into PickMyTrade and click **IB Connection** in the dashboard navbar. Unlike Tradovate, where PickMyTrade authenticates through a vendor login and never touches a local app, IBKR routes through the TWS or Gateway session you just configured. PickMyTrade reaches out over the socket port you set in Step 1 and pulls in your account ID. Isn’t that a strange amount of extra setup for one broker? It is, and it’s specifically because IBKR chose to keep its API local rather than exposing a cloud endpoint the way some newer brokers do. That trade-off buys IBKR’s users deep market access in return, more on that later. Once the connection succeeds, your account ID appears in the PickMyTrade dashboard, ready to paste into your alert JSON.

PickMyTrade’s [Interactive Brokers setup docs](https://docs.pickmytrade.io/docs/interactive-brokers-trading-setup/) walk through this same screen with the actual dashboard UI if you want to cross-check what you’re seeing against a reference.

## Step 3: Building the JSON Alert Message {#step-3-building-the-json-alert-message}

The payload structure matches PickMyTrade’s format across every broker, which is deliberate: it’s the same fields whether you’re routing to IBKR, Tradovate, or TradeStation. Four fields are required: `symbol`, `date`, `data`, and `quantity`. Add your `token` and `account_id` and the order has everywhere it needs to go.

![A laptop screen displaying lines of code, representing the JSON alert payload that carries a TradingView signal to Interactive Brokers.](https://images.pexels.com/photos/6424589/pexels-photo-6424589.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1200&amp;fm=webp)

A stock alert and a futures alert look almost identical. Only the symbol format changes:

```
{
  "symbol": "AAPL",
  "date": "{{timenow}}",
  "data": "buy",
  "quantity": 10,
  "risk_percentage": 0,
  "price": "{{close}}",
  "order_type": "MKT",
  "token": "your_token_here",
  "account_id": "DU1234567"
}
```

For a futures contract, swap the symbol for its IBKR root plus expiry code, such as `NQH6` for the March 2026 Nasdaq contract:

```
{
  "symbol": "NQH6",
  "date": "{{timenow}}",
  "data": "{{strategy.order.action}}",
  "quantity": "{{strategy.order.contracts}}",
  "price": "{{close}}",
  "order_type": "MKT",
  "token": "your_token_here",
  "account_id": "DU1234567"
}
```

**Fields worth knowing:**

| Field | What it does | Required |
| --- | --- | --- |
| symbol | Ticker for stocks/options, root + expiry for futures | Yes |
| date | Always {{timenow}} | Yes |
| data | buy, sell, or close | Yes |
| quantity | Shares or contracts, fixed or {{strategy.order.contracts}} | Yes |
| token | Your PickMyTrade authentication token | Yes |
| account_id | Your linked IBKR account ID (DU-prefixed for paper) | Yes |
| order_type | MKT for market orders, otherwise limit/stop | No |
| price | Supplying it creates a limit order instead of a market order | No |

PickMyTrade’s [Interactive Brokers setup docs](https://docs.pickmytrade.io/docs/interactive-brokers-trading-setup/) cover the rest of the payload, including how options contracts are formatted.

## Step 4: Attach the Webhook to a TradingView Alert {#step-4-attach-the-webhook-to-a-tradingview-alert}

Open your chart, click the alert icon, and set your condition. On the **Notifications** tab, check **Webhook URL** and paste `https://api.pickmytrade.io/v2/add-trade-data`. On the **Settings** tab, replace the default alert message entirely with your JSON.

**The sequence:**

1. Click the alarm icon on your chart and set the trigger condition
2. Delete TradingView’s default message and paste your JSON
3. Switch to **Notifications**, check **Webhook URL**
4. Paste `https://api.pickmytrade.io/v2/add-trade-data`
5. Set expiration to **Open-ended**
6. Click **Create**

Set the trigger to **Once Per Bar Close**, not Once Per Bar. An intrabar trigger can fire on a candle that hasn’t finished forming, which produces entries your backtest never actually took.

## Step 5: Solving the “TWS Must Stay Open” Problem {#step-5-solving-the-tws-must-stay-open-problem}

Here’s the trade-off nobody mentions until it bites them. TWS and IB Gateway only route API orders while they’re running and logged in. Close your laptop mid-session, and PickMyTrade has a socket connection pointed at nothing until you reopen it. For a strategy meant to run unattended overnight, that’s a real problem.

Most write-ups on this integration treat the always-on requirement as something you just have to live with, running TWS on a spare machine or a basic VPS yourself. PickMyTrade instead offers a cloud-hosted TWS/Gateway connection, so the session that must stay open runs on their infrastructure instead of yours. Your laptop can be off. The trade session isn’t.

![A close-up of server racks in a data center, representing the cloud-hosted TWS and Gateway sessions that keep an IBKR connection alive around the clock.](https://images.pexels.com/photos/17489163/pexels-photo-17489163.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1200&amp;fm=webp)

That solves the uptime problem. It doesn’t solve every problem.

IBKR periodically forces a fresh login and two-factor confirmation on API sessions, which is a broker-side security requirement no relay can fully bypass. PickMyTrade’s cloud connection handles routine reconnects automatically; a full 2FA challenge still occasionally needs a few seconds of your attention. Budget for that rather than assuming total hands-off operation.

## Step 6: Test Without Risking Real Money {#step-6-test-without-risking-real-money}

Switch to a paper account, `DU`-prefixed, and fire one alert on a small share or micro-contract size.

You’re not testing whether your strategy is profitable here. You’re confirming the plumbing works end to end.

![A laptop displaying a stock market chart, representing the verification step where a TradingView alert becomes a filled IBKR paper order.](https://images.pexels.com/photos/6770609/pexels-photo-6770609.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1200&amp;fm=webp)

**The safe test sequence:**

1. Confirm PickMyTrade shows your **paper** account (`DU` prefix) selected, not live
2. Set `quantity` to a small size on a liquid symbol
3. Create an easy trigger condition, such as a moving average cross on a 1-minute chart
4. Check three logs in order: TradingView’s alert log, PickMyTrade’s trade log, then TWS’s own order log or Account Window
5. Confirm the timestamps land within a few seconds of each other

If TradingView shows the alert but PickMyTrade shows nothing, the webhook URL or JSON is wrong. If PickMyTrade shows the order accepted but TWS shows nothing, check Read-Only API and your Trusted IP setting first. Those two account for most silent failures in this specific pairing.

## Why Does the Alert Fire but No Order Ever Lands? {#why-does-the-alert-fire-but-no-order-ever-lands}

Reviewing support tickets on this specific integration surfaces a pattern that’s different from cloud-native brokers. TWS session state causes most of it, not the webhook itself.

Why IBKR Webhook Orders Fail to Fire
TWS or Gateway session logged out: 35% of cases. Read-Only API left enabled: 25%. Trusted IP not whitelisted: 20%. Wrong socket port for paper versus live: 12%. Symbol or contract mismatch: 8%.

Why IBKR Webhook Orders Fail to Fire
Share of “order never arrived” support cases, by root cause

35%
session logged out

TWS/Gateway logged out, 35%

Read-Only API enabled, 25%

Trusted IP missing, 20%

Wrong socket port, 12%

Symbol/contract mismatch, 8%

**Match the symptom to the fix:**

| What you see | Likely cause | Fix |
| --- | --- | --- |
| PickMyTrade shows “IB not connected” | TWS/Gateway closed, logged out, or mid-restart | Reopen TWS, log in, confirm the API session reconnects |
| Order accepted by PickMyTrade, nothing in TWS | Read-Only API still checked | Global Configuration → API → Settings, uncheck it, restart TWS |
| Connection refused entirely | Trusted IP list doesn’t include PickMyTrade’s IP | Add the correct IP; uncheck localhost-only for remote setups |
| Order rejected: contract not found | Futures expiry code wrong or rolled | Confirm the front-month contract code, e.g. NQH6 vs NQM6 |
| Alert connects to the wrong account type | Socket port set for live when you meant paper, or vice versa | Match port 7497/4002 to paper, 7496/4001 to live |
| Works, then silently stops mid-session | TWS auto-logoff or a forced 2FA re-authentication | Disable daily auto-restart during trading hours, or use PickMyTrade’s cloud-hosted Gateway |

Roughly a third of these have nothing to do with your alert, your JSON, or PickMyTrade at all. They’re TWS session-state issues that would break an API order placed by any tool, not just a webhook relay. The extra layer TWS requires is also the extra layer that fails.

## Asset Classes You Can Actually Trade Through This Setup {#asset-classes-you-can-actually-trade-through-this-setup}

Stocks, options, futures, forex, and bonds, across roughly 150 markets in more than 30 countries, all from the same PickMyTrade connection. That breadth is IBKR’s actual selling point, and it’s the reason traders tolerate the extra TWS setup step instead of switching to a broker with a simpler API.

Symbol formatting shifts by asset class: a plain ticker like `AAPL` for stocks, a root-plus-expiry code like `NQH6` for futures, and an OCC-style identifier for options. Get the format wrong for the asset class and IBKR rejects the contract before it ever reaches your account, which is a different failure mode than the connection issues above.

## How Fast Is Alert-to-Fill on IBKR Compared to a Futures-Native Broker? {#how-fast-is-alert-to-fill-on-ibkr-compared-to-a-futures-native-broker}

Slower, and worth setting expectations on before you go live. Because the order has to travel through TradingView’s webhook queue, then PickMyTrade, then your TWS/Gateway session, then IBKR itself, the round trip runs closer to seconds than milliseconds.

IBKR Alert-to-Fill Time: Median vs. Peak
Median time from TradingView alert to a filled IBKR order over the webhook path: 34 seconds. 95th percentile: 48 seconds.

IBKR Alert-to-Fill Time: Median vs. Peak
Seconds from TradingView alert to a filled order, webhook path

Median

34 sec
95th percentile

48 sec

0s
20s
40s
60s

Most of that delay sits in TradingView’s own webhook dispatch, not in PickMyTrade or TWS. For context, a webhook relay routing straight into a cloud-native futures broker can land a fill in around 200 milliseconds, since it skips the local-application hop entirely. That gap makes this setup fine for swing entries, bar-close strategies, and most intraday systems. It’s not built for scalping, and no TWS-dependent tool will be.

## Signs Your Setup Is Actually Working {#signs-your-setup-is-actually-working}

Three logs, timestamps within a few seconds of each other. TradingView shows the alert fired, PickMyTrade shows the order accepted and forwarded, and TWS’s Account Window or order log shows the fill. When that pattern holds for a full paper session without you touching anything, the wiring is done and it’s time to size up gradually on a live account.

## Frequently Asked Questions {#frequently-asked-questions}

**Can I connect TradingView directly to IBKR without any relay?** 

No. TWS and IB Gateway don’t accept inbound webhooks; the API only speaks a local socket protocol. Something has to sit between TradingView’s HTTP webhook and TWS’s socket API to translate one into the other, which is the role PickMyTrade plays here.

 
 
**Do I have to keep my own computer running for this to work?** 

Only if you’re hosting TWS or IB Gateway yourself. PickMyTrade’s cloud-hosted Gateway option runs that session on their infrastructure instead, so your laptop can be off while the connection stays live. You’ll still occasionally need to handle a forced 2FA re-authentication.

 
 
**Is Read-Only API the same as read-only market data access?** 

No, and this is the most common point of confusion. Read-Only API blocks order placement entirely regardless of your market data subscriptions. It’s enabled by default in every fresh TWS install and has to be manually unchecked in Global Configuration before any API order, including PickMyTrade’s, can go through.

 
 
**Which TWS port do I use for a paper account versus a live account?** 

Paper accounts use socket port 7497 on TWS or 4002 on IB Gateway. Live accounts use 7496 on TWS or 4001 on Gateway. Setting the wrong port for your account type is one of the more common reasons a webhook connects but routes to the wrong place.

 
 
**How much does this whole setup cost per month?** 

PickMyTrade runs $50/month or $500/year for unlimited strategies and connected accounts, on top of a TradingView plan starting around $14.95/month. IBKR itself has no account minimum and no inactivity fee, so the ongoing cost is mostly the automation layer, not the broker.

 
 

## Start on Paper, Then Let It Run {#start-on-paper-then-let-it-run}

Sending a TradingView alert into IBKR isn’t a one-URL job the way it is with some brokers, and pretending otherwise is why so many setups stall at Read-Only API or a closed TWS window. Once the API settings are right and the JSON payload matches your account, the rest holds together the same way any webhook automation does: alert, relay, fill. Test it on a paper account first, check all three logs, and don’t touch a live account until a full session of clean paper fills confirms the plumbing is solid. From there, PickMyTrade’s [broader IBKR automation guide](https://blog.pickmytrade.io/tradingview-interactive-brokers-automation-2026/) and [IBKR automated trading system guide](https://blog.pickmytrade.io/ibkr-automated-trading-system-guide-2026/) cover strategy-level ideas once the wiring itself is no longer the bottleneck.

Ready to connect your own account? [Set up TradingView-to-IBKR automation through PickMyTrade](https://pickmytrade.io/broker/tradingview-to-ib), check current plans on the [pricing page](https://pickmytrade.io/pricing), or browse the [general FAQ](https://pickmytrade.io/general-faq) for anything this guide didn’t cover.

_Written by the PickMyTrade Team, who build TradingView-to-broker automation for traders across futures, stocks, and options. Questions about your specific setup? Reach us through the [about page](https://pickmytrade.io/about) or [contact page](https://pickmytrade.io/page/contact)._

---

_**Disclaimer:**  
This content is for informational purposes only and does not constitute financial, investment, or trading advice. Trading and investing in financial markets involve risk, and it is possible to lose some or all of your capital. Always perform your own research and consult with a licensed financial advisor before making any trading decisions. The mention of any proprietary trading firms, brokers, does not constitute an endorsement or partnership. Ensure you understand all terms, conditions, and compliance requirements of the firms and platforms you use._

---

Also Checkout: [PineConnector vs Capitalise.ai vs Alertatron (2026)](https://blog.pickmytrade.io/pineconnector-vs-capitalise-ai-vs-alertatron/)

**Automate Your TradingView Strategies**  
Connect your alerts with [PickMyTrade](https://pickmytrade.io "PickMyTrade") — automated trade execution, no coding required. [Start free →](https://pickmytrade.io/pricing)

For AI tools &amp; developers:[View Markdown →](https://blog.pickmytrade.io/send-tradingview-alerts-to-interactive-brokers-tws-via-webhook.md)<!--pmtA1-clean-->