> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traderframe.io/llms.txt
> Use this file to discover all available pages before exploring further.

# NinjaTrader

> Trade futures on a NinjaTrader 8 account, including a prop firm's funded account, through the TraderFrame add-on with your firm's rules checked first.

TraderFrame connects to NinjaTrader 8 through a small **add-on** that runs inside NinjaTrader on your own computer. NinjaTrader takes no API key from us: the add-on holds one TraderFrame token, places the orders your bots decide in your own NinjaTrader, and reports every fill back. Your firm login and your data feed never leave your computer.

This is how a funded futures account at a prop firm is reached. The venue is **stock index futures**: MES, MNQ, ES, NQ, YM and RTY.

## Whose account

When you connect, you say who the account is with:

* **Lucid Trading** or **FundedNext**. These are the two firms offered, because their own rules allow trading bots. An evaluation or funded account is always a **Live** account in TraderFrame.
* **My own account**: your own NinjaTrader account, as **Practice** or **Live**.

> [!WARNING]
>
> Many prop firms forbid bots, and a bot on such an account can end it. Only connect a firm's account if that firm is in the list above, and read your own plan's rules first.

## Before you start

* **NinjaTrader 8** installed on your computer, with the login your firm gave you (or your own account's login).
* NinjaTrader must stay open while your bots run. The add-on lives inside it.

## Connect

1. **Brokers → Connect broker → NinjaTrader**. Choose the firm, or **My own account**. TraderFrame shows your **add-on token** and a **Download add-on (.zip)** button. Treat the token like a password.
2. Open NinjaTrader 8 and sign in. You type your login into NinjaTrader, never into TraderFrame.
3. In NinjaTrader open **Tools ▸ Import ▸ NinjaScript Add-On** and choose the zip you downloaded. NinjaTrader asks whether to authorise an add-on that runs by itself: choose **Yes**. It then asks you to close NinjaTrader and open it again.
4. Open NinjaTrader again and connect. Then open **New ▸ TraderFrame**, paste your add-on token, pick the account this connection trades, and press **Connect**.
5. Leave NinjaTrader open. TraderFrame shows the account as **Connected** within about 20 seconds.

One token trades one NinjaTrader account. The add-on reconnects by itself the next time NinjaTrader opens. **Brokers → ⋯ → View add-on token** shows the token again.

## Updating the add-on

The Brokers page shows a download link on the account's card when a newer add-on is out. Download it and import it the same way as in step 3; NinjaTrader replaces the installed copy and asks for a restart. Your token stays.

## Firm rules

A funded account ends when a rule is crossed, not when a trade loses. On a firm's account the bot editor has one more step in **Risk management**, called **Firm rules**. Until you fill it in, it reads **Not set · enter your plan's limits**.

Open it and copy the numbers from your firm's plan, exactly as its dashboard shows them:

| Field | What it is |
| - | - |
| Plan name and starting balance | The balance your plan started with. |
| Drawdown | The amount, and how the floor moves: **Trailing, intraday** (follows your best equity, all day), **Trailing, end of day** (follows your best day's closing balance) or **Static** (never moves). |
| Daily loss limit | Optional. The most you may lose in a day, with the time and time zone your firm's day resets. |
| Largest order | Optional. The most contracts your plan allows in one order. |
| Flat by | Optional. The time each day by which the account must hold no position. |

TraderFrame has no presets for any firm. If a number is wrong, the bot protects the wrong number.

After you save, the panel shows the room left on each limit, and the account's card on the Brokers page shows the same under **Firm rules · room left**. **Change these numbers** reopens the form.

### What the bot refuses

With firm rules on the account, the bot will not:

* Open a trade whose loss at its stop is more than the room left.
* Send an order larger than your plan's largest order. A Martingale step is checked like any other order.
* Send an order whose risk cannot be measured: one with no stop, or a stop set in ATR.
* Open a new trade from 5 minutes before the flat-by time.

Every refusal is a row on the bot's **Signals** tab, marked **Blocked · firm**, with the number that stopped it.

### At the flat-by time

An entry order that has not filled is cancelled, and an open position is closed at market. The closed trade reads **Firm rule**. The check runs once a minute, so the close can go out up to a minute after the time you entered: set the time a little ahead of your firm's own.

> [!WARNING]
>
> These checks make a breach far less likely, not impossible. A gap through your stop, a rule the firm changes, or a trade placed by hand can still end the account. The firm's decision is final.

### If the account ends

When a rule is crossed the account's card reads **Breached**, with the recorded reason and the day. Its bots are paused and nothing trades on it again. The account keeps its history. **Move its bot** on the card opens the bot's editor on the account picker, so you can give that bot another account.

## The bot

A NinjaTrader bot uses the same editor and panels as an [Interactive Brokers](https://docs.traderframe.io/user-guide/interactive-brokers.md#the-bot) futures bot: a product rather than a symbol, whole contracts, a session, a flatten time and an Exit rule. Two things differ:

* **Stop and target are placed when the entry fills.** The entry goes to NinjaTrader first. The moment it fills, the add-on places the stop and the target as a pair where one cancels the other. Keep NinjaTrader open while a position is open.
* **Distances are measured from the fill.** A 20-point stop from the Exit rule sits 20 points from the price you were filled at, on market and limit entries alike. A stop or target carried in the signal itself is a price and is used as sent.

A **Limit** entry rests in NinjaTrader until the market reaches it. Until then the trade reads as pending and has no stop or target yet. It gets them when it fills.

## Closing by hand

**Close now** on the Trades tab sends a market order the other way through the add-on, for that trade's contracts only. The stop and target stay working until the close has filled, and NinjaTrader cancels them the moment it does.

You can also close in NinjaTrader itself, for example with **Close Position** on the Positions tab. The add-on reports it and the trade reads **Closed by hand**.

## When NinjaTrader is not reachable

* **NinjaTrader not connected**: the add-on is running but NinjaTrader has lost its connection to the account. Connect in NinjaTrader.
* **Add-on offline**: nothing is reporting. Check that NinjaTrader is open, connected to the account, and that the TraderFrame window says it is connected.
* **Token refused**: copy the add-on token again and paste it into the TraderFrame window in NinjaTrader.

While the add-on is not reporting, your bots on that account pause. Stops already in NinjaTrader stay in place.

## Limits

* One token, and one add-on connection, per NinjaTrader account.
* The add-on places orders only for commands TraderFrame queued for this account. It never trades on its own.
* The [Trade Agent](https://docs.traderframe.io/user-guide/trade-agent.md) sends the entry only. Every exit is your bot's own Exit rule, as on every venue.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.