Skip to main content

Set up NinjaTrader 8 with Gunbot

Run Gunbot automated trading strategies inside NinjaTrader 8 and follow their activity from Gunbot. NinjaTrader executes the strategies and broker operations; the bridge publishes their account, order and chart information to Gunbot.

The integration is included in Gunbot Unlimited and the current Gunbot download. Start with Sim101 to check the account, instrument, strategy and controls.

Gunbot connects to NinjaTrader, where strategy instances run and broker operations execute. Conceptual connection diagram. NinjaTrader runs the strategy; its data provider may be separate from the broker.

Before you start​

You need NinjaTrader Desktop on Windows, Gunbot running, a configured account and a data connection for the instruments you want to use. Broker/platform/data access is separate from Gunbot. The hosted Gunbot website alone does not provide the local bridge gateway.

Choose where Gunbot runs:

NinjaTrader Desktop still runs on Windows in either arrangement. A Windows VM and its Mac host are separate computers for connection purposes.

Start on the same Windows computer​

  1. Start NinjaTrader and connect your account/data source.
  2. Start Gunbot on the same Windows setup.
  3. Open NinjaTrader in Gunbot and check the connection and account selector. The current Windows setup handles the local connection automatically.
  4. Select the actual simulation account, normally Sim101, and compare it with NinjaTrader's Accounts tab.

Checkpoint: Gunbot reports a connected bridge and the intended account. Starting the applications does not by itself create a trading account, choose a market-data provider or add a strategy to a chart.

If this is not connected, open Connection options, check NinjaTrader runs on this Windows account and use Set up NinjaTrader or Save connection. Automatic local configuration applies to the Windows user running the terminal. For an existing/manual installation, follow the recovery bridge instructions below.

Use Gunbot on another host​

If Gunbot runs on Linux, macOS, another Windows computer or under a different Windows user, download its connector for the computer running NinjaTrader:

  1. In Gunbot, open NinjaTrader → Connection options.
  2. Set Gunbot connection address to a reachable HTTPS address ending in /api/ninjatrader/bridge, such as https://gunbot.example.com/api/ninjatrader/bridge.
  3. Set NinjaTrader accounts to the exact names available in the terminal, such as Sim101. Separate multiple names with commas.
  4. Clear NinjaTrader runs on this Windows account if the terminal is elsewhere, then save.
  5. Click Download Windows connector and open Connect-Gunbot-NinjaTrader.cmd in the Windows account that runs NinjaTrader. It saves the bridge connection settings.
  6. Keep the NinjaTrader bridge running and return to Gunbot to verify the account.

The connector contains a private credential. Keep it private, and download/run a fresh connector when changing the host, address or account configuration. In a VM, localhost means the VM, not its Mac/Linux host. Remote connections use HTTPS with a trusted certificate; same-machine loopback can use local HTTP and the actual Gunbot port.

Manual bridge install or recovery​

Use this path when a bridge is not installed, when updating an older installation or when the automatic setup needs recovery:

  1. In Gunbot, click Download NinjaTrader bridge.
  2. Leave the ZIP intact. In NinjaTrader Control Center, open Tools → Import → NinjaScript Add-On and select the download.
  3. Finish the import and restart NinjaTrader.
  4. If using a source import, compile in New → NinjaScript Editor and read any actual compiler errors. Do not install both source classes and a compiled DLL containing the same classes.

The download provides a compiled package when available and a source import package otherwise. Use the import package, not a developer -source.zip as though it were an Add-On archive. Keep the bridge and strategies from the same package when updating.

Verify accounts and data​

In NinjaTrader, check Control Center → Accounts for the intended account and Connections for the data source. Sim101 is an account, not a data feed. Typing its name in Gunbot does not create it.

If available, Simulated Data Feed supplies generated test prices for checking the setup; those prices do not represent the real market. A configured broker/data-provider connection supplies the data access for your instruments. An end-of-day feed is not streaming intraday data.

In Gunbot, select the account and compare cash/equity, positions and orders. A connected bridge with no accounts usually needs an exact account-name/allowlist check. A disconnected bridge needs a connection check first.

Run a Gunbot strategy in Sim101​

  1. In NinjaTrader, open the instrument's chart with the bars and trading-hours template required by the strategy.
  2. Right-click the chart, open Strategies and choose the relevant GB... strategy.
  3. Select Sim101. Review quantity, protection and strategy settings before allowing orders.
  4. Enable the NinjaTrader strategy instance so it runs and publishes telemetry. The instance's Enabled checkbox is different from its Enable orders setting; you can publish data while keeping order entry off.
  5. In Gunbot, verify the same account, instrument and strategy instance.
  6. Use Open … in Chart to inspect its published candles. In Chart, use Source to select the exact account/instance if more than one reports the instrument.
  7. Once the monitoring check is complete, enable strategy entries through the appropriate strategy setting/control and observe the Sim101 orders and exits.

Create/remove instances and choose chart data series inside NinjaTrader. The Gunbot page controls existing published instances; it does not create a chart strategy for you.

Strategy and chart compatibility​

Family/profilePrimary chart / context
GBMeeks5 Minute
GBEmaVwap2 Minute
GBConfluenceEdge610 Tick; 5 Minute secondary context
GBRunnerGuardMinute bars; 60 Minute secondary context
Classic Gunbot strategiesMinute bars; inspect the selected profile's settings

Classic Gunbot strategies include GBGridBot, GBGridBotAdvanced, GBStepGrid, GBSpotGrid, GBSpotGridAdvanced, GBStepGridHybrid, GBStepGridScalp, GBFuturesGrid, GBStepGridHedge, GBBuilder, GBTenkan, GBBuilderFutures, GBMarketMaker, GBMarketMakerFutures and GBSgsFutures.

These are NinjaTrader implementations of Gunbot strategy profiles. They do not embed arbitrary Gunbot JavaScript or exactly reproduce crypto-specific DCA inventories, simultaneous market-maker ladders or hedge accounting. Similar names across platforms do not guarantee identical signals or trades. Review the native instrument's tick size, point value, contracts and session; do not reuse MetaTrader lot-unit assumptions.

Enable simulation controls​

In Gunbot Connection options, select Allow simulation controls and save. On another computer/user, update the connector if the settings changed. This switch does not enable live-account permissions or override the strategy's own account guards.

ActionWhat it does
Pause new entriesStops new strategy entries; existing orders and positions remain active
Enable new entriesAllows entries for that instance, subject to its native guards
Cancel orderRequests cancellation of the selected order
Close position / flattenCloses the selected account/instrument position and cancels its orders; can affect manual or other-strategy activity
Apply parameterChanges an offered numeric/boolean parameter on the current instance

Pause new entries and make the strategy flat before applying parameter changes. Save permanent templates/defaults inside NinjaTrader. Confirm each action with the requested account name and check the resulting account state. Accepted means submitted to NinjaTrader, not a confirmed fill or closure.

Flatten does not disable strategies: a running strategy can enter again afterward. Pause relevant entries before flattening when that is your intention.

Disconnect and recover​

Keep Gunbot, NinjaTrader and the bridge running. Disconnect view stops browser polling; it is not proof that the terminal bridge stopped. On stale data the controls are unavailable.

If a command times out or a bridge session changes, unresolved operations can become unknown. They are not automatically sent again. Compare the terminal's actual positions, orders and history before retrying or enabling more entries. Strategy/session behavior remains under NinjaTrader's control.

Troubleshooting​

SymptomCheckNext action
No connection on WindowsSame user, Gunbot address, bridge installationSave the local connection or use the manual bridge recovery path
Bridge connects but account list is emptyExact account names in NinjaTrader versus allowlistUpdate the account list and remote connector if needed
Account appears but no candlesRunning GB instance, correct account, chart dataEnable the instance for telemetry; inspect NinjaTrader's Log and data connection
Wrong chart/sourceInstrument plus account/instanceSelect its exact Chart source; accounts' candles are not merged
Import/class conflictDuplicate source and compiled DLL classesUse one current package; inspect the compiler's named error
Controls disabledAccount connected, simulation switch, native guardsCorrect the relevant permission; simulation does not grant live access
VM/remote host cannot connectAddress reachable from Windows, trusted HTTPSReplace a host-local address with the actual reachable Gunbot address

See the NinjaTrader integration overview and Gunbot Unlimited. For help selecting a profile, read choosing a Gunbot strategy for NinjaTrader 8.