Guide · automation

NinjaTrader vs TradingView: where does your bot really trade automatically?

TradingView is strong for charts and strategy tests, NinjaTrader for execution. If you want to trade automatically, know the difference before you order code.

In short

  • TradingView does not execute Pine strategies on your brokerage account itself. Strategies are there for testing. Automation only comes through an alert with a webhook to a service that turns it into orders.
  • NinjaTrader 8 executes strategies directly. Orders, stop and target run inside the platform, written in C#. NinjaTrader has to be running during trading hours.
  • Rule of thumb: signals and charts in TradingView are a good start. If you want orders, stops and partial targets automated reliably, you usually end up on NinjaTrader or ATAS.

How TradingView becomes automated

  1. A Pine strategy or indicator fires an alert.
  2. The alert sends a message by webhook to an address on the internet.
  3. A service, for example a bot platform or your own server, receives it.
  4. The service places the order with the broker or exchange.

According to TradingView’s help centre, webhooks only work with two-factor authentication enabled, and they are not part of the free plan. On top of that there is almost always a second subscription for the service that executes the orders. If the service is down or the alert does not arrive, there is no order.

From one of my projects: an existing Pine strategy for Bitcoin futures had to send its signals by webhook to a bot platform. The work was not in the strategy but in the format of the alert message. The platform expects an exact JSON, and it has to be right for every order. After delivery the client set up a new bot. The script stayed the same; only the message in the alert had to be replaced.

How NinjaTrader becomes automated

A NinjaTrader strategy is a C# class in NinjaScript. It calculates on every bar close or every tick and places orders, stops and targets directly. Break-even, partial targets or a daily limit live in the same code. Testing happens in the Strategy Analyzer and in Market Replay.

The downside: NinjaTrader runs on Windows only and has to be open during trading hours, on your machine or on a rented server. You also need a connection to a data feed and broker.

The comparison

QuestionTradingViewNinjaTrader 8
LanguagePine ScriptC# (NinjaScript)
Automated ordersonly via webhook and a service in betweendirectly in the platform
What has to run?nothing on your machine, alerts run at TradingViewNinjaTrader on your machine or a server
Running costspaid TradingView plan plus a servicedepends on licence and broker
Stops and partial targetsdepend on the servicein your own code
BacktestingStrategy TesterStrategy Analyzer with optimisation

Prop firms have a say

With prop accounts the firm comes first. Apex prohibits automation, new Topstep accounts run only on TopstepX, Lucid allows bots with conditions. Details in the guide prop firms and trading bots.

When moving from Pine pays off

  • The strategy works in TradingView, but orders should run without a webhook chain.
  • Stops, partial targets and break-even should follow your rules exactly, not whatever a service offers.
  • You want one subscription less and control on your own machine.

Then the Pine logic is rewritten in C# and compared candle by candle with the original. More on the Pine Script conversion page.

Notice: I write software to your specification. This is not investment advice and not a signal service. You alone decide on strategy, sizing and risk. Trading futures, CFDs, forex and crypto is risky and can lead to the loss of your entire capital. Backtests and past results say nothing about future results.

FAQ

Frequently asked questions

Can TradingView execute orders automatically?

Not directly. Pine strategies are for testing. Automation works through alerts with a webhook to a service that places the orders with the broker.

What do I need for TradingView webhooks?

A paid TradingView plan and two-factor authentication enabled. Plus a service or server that receives the message and turns it into orders.

Does NinjaTrader have to run all the time?

Yes, during trading hours. Either on your Windows machine or on a rented server.

Can a Pine strategy be moved to NinjaTrader?

Yes. The logic is rewritten in C# and then compared candle by candle with the original.