Connecting TradingView to Interactive Brokers on NinjaTrader 8

Lean how to connect TradingView to your Interactive Brokers account on NinjaTrader 8 using the CrossTrade Add-on.

Connecting TradingView to Interactive Brokers on NinjaTrader 8
Connect IBKR


Connecting TradingView's powerful charting and alert system to your Interactive Brokers account through NinjaTrader 8 opens up a world of automated trading possibilities. This integration allows you to execute trades based on TradingView's indicators or strategies into your IBKR brokerage account.

The setup involves three main components working together: Interactive Brokers provides the brokerage and market access, NinjaTrader 8 serves as the trading platform and order management system, and CrossTrade acts as the bridge that receives TradingView webhook alerts and translates them into executable orders.

While this might seem complex initially, the automation benefits are significant. You can open up the doors to an endless amount of TradingView tools that can be automated through CrossTrade. To take things a step further, you can leverage CrossTrade's NT Account Manager to provide risk management oversight and control your day trading.


Part 1: Interactive Brokers Setup

Install IB Gateway

  1. Download IB Gateway from Interactive Brokers website
  2. Recommendation: Use IB Gateway instead of TWS - it's lighter and more stable for third-party connections
IBKR IB gateway download screen
Download IB Gateway

Configure IB Gateway Settings

  1. Launch IB Gateway and log in
  2. Go to Configure → Settings → API
  3. Enable these critical settings:
    • Uncheck Read-Only API
    • Change Socket port to 7497 (live) or 7496 (paper trading)
    • Master API client ID (set to 0)
IB Gateway API settings for ninjatrader connection
API Settings

Paper Trading vs Live

  • Paper Trading Port: 7496
  • Live Trading Port: 7497
  • Start with paper trading to test the connection

You will need a data subscription from IBKR. The US Securities Snapshot and Futures Value Bundle will provide Level 1 data. You can additionally purchase the Value Bundle PLUS if you would like Level 2 data.

select a data plan on IBKR to power the ninjatrader data connection
Select IBKR data plan

Part 2: NinjaTrader 8 Configuration

Add Interactive Brokers Connection

  1. Open NinjaTrader 8
  2. Go to Tools → Options → Connections
  3. Click Add and select Interactive Brokers

Connection Settings

Configure these exact parameters:

Basic Settings:

  • Connection Name: IB Live (or IB Paper)
  • Host: 127.0.0.1 (localhost)
  • Port: 7497 (live) or 7496 (paper)
  • Client ID: 0 (must be unique if running multiple connections)
the interactive brokers data connection configuration on ninjatrader desktop
Interactive Brokers Connection

Part 3: Connection Process

Startup Sequence

  1. Start IB Gateway first - wait for full login
IB Gateway Sign In
  1. Verify API settings are enabled
IBKR PRO gateway showing proper connection
Connected IBGateway
  1. Start NinjaTrader and connect to the IBKR data connection. The status bar at the bottom will display a green dot "🟢" indicating a active connection. It's important to start IB Gateway before NinjaTrader to ensure that the connection port is ready.

When connecting to IBKR Paper, your account name will start with DUNXXXXX. When connecting to IBKR Live, your account name will start with UXXXXXX. You can see the full account name on NinjaTrader 8 by clicking on the Accounts tab.

For optimal performance, we recommend using a VPS to ensure NinjaTrader 8 and IB Gateway have a stable and fast connection.

Learn more

Part 4: TradingView Setup

  1. Create your TradingView account
  2. Subscribe to the Essentials plan or higher to enable webhooks
  3. Subscribe to TradingView data (In addition to IBKR data on NT8)
TradingView

Part 5: Connect TV to NT8 with CrossTrade

Now for the fun part... you can send webhook orders from TradingView directly into the IBKR account you have on NinjaTrader 8 using CrossTrade.

Our Help Docs provide a complete Set Up Guide with instructions on how to use TradingView alerts and additional details on all our NT8 tools.

Learn more
  1. Go to CrossTrade and sign up for an account. The Standard plan enables sending unlimited webhooks from TradingView to NT8.
  2. Follow the Set-Up guide to install the CrossTrade Add-On into NT8.
  3. Copy and paste your Webhook URL into the Notifications tab of a TradingView alert. Your webhook is permanent and will be saved for all alerts you create.
tradingview webhook field on notifications tab
Add you CrossTrade webhook URL
💡
2FA is required to enable TradingView webhooks
  1. Send alert message payload you want to execute on NinjaTrader 8. Here is an example of a basic buy market order for ES and a payload with dynamic variables for automating TradingView Strategies.
indicator vs strategy command types
Example Commands

By learning the different command types within the NinjaTrader 8 framework and the CrossTrade specific enhancements that allow greater alert customization. Its now possible to fully automate almost any TradingView strategy or indicator to your Interactive Brokers account on NinjaTrader 8.

You now have a complete automated trading pipeline from TradingView analysis to IBKR execution. This setup eliminates manual order entry while maintaining full control over your trading strategy and risk management.

Remember to thoroughly test your setup in paper trading before going live. Start with small position sizes and simple strategies to verify everything works as expected. The webhook connection is persistent, so once configured, your alerts will continue executing automatically.

The combination of TradingView's analysis tools, NinjaTrader's order management, and Interactive Brokers' execution creates a professional-grade automated trading environment. With proper risk management and strategy testing, this system can significantly improve your trading consistency and remove emotional decision-making from the equation.


Start your free trial

Try CrossTrade for 7 days.

Sign Up