Skip to content
Black Friday: sale starts November 15th.

BlackBird: Introduction & Setup

BlackBird is a NinjaTrader strategy that goes far beyond NinjaTrader’s Chart Trader and ATM. It is for discretionary traders and automated traders alike.

Discretionary traders decide when to enter, and BlackBird places and manages the orders by their plan: entry, profit targets and stop-losses, each with its own rules for moving as the trade develops. Risk and money management rules help keep to daily limits. Orders can still be moved by hand at any time.

Automated traders let BlackBird enter trades from signals: BloodHound, or another indicator with machine-readable signal outputs. BlackBird then manages the trade in the same way, for a fully automated system. BloodHound signals can also move profit targets and stop-losses.

Where it runs: like any strategy, BlackBird can run on a chart (as in our videos) or from the Strategies tab of the NinjaTrader Control Center; see NinjaTrader’s guide. Setup is the same either way; this page uses a chart. Also worth reading: Strategy Position vs. Account Position.

Adding BlackBird to a chart

  1. Open a chart in NinjaTrader. Don’t use a chart with tabs: BlackBird doesn’t support them yet.
  2. Right-click the chart and choose Strategies…, then open the SharkIndicators folder and select BlackBird. Its properties appear on the right. If Strategies… is grayed out, see NinjaTrader’s guide to enable it.
  3. Adjust the properties as needed, check Enabled, and click OK.
  4. Click the Order Settings button (bottom right of the chart) to open the BlackBird Settings window.

Define an order set first

BlackBird can’t do anything, and the trade buttons stay grayed out, until at least one order set is defined.

Using BloodHound signals

You don’t need BloodHound on the chart as well: BlackBird adds the BloodHound running inside it to the chart by default. Running only one BloodHound per chart saves CPU.

Starting and stopping BlackBird

Several NinjaTrader settings decide what happens to orders when a strategy is enabled or disabled, by any means. They are in Control Center » Tools » Options » Strategies (the NinjaScript and On connection loss sections) and in the Strategies window’s Properties. Make sure you fully understand them.

Immediate orders on enable

With Strategies window » Properties » Setup » Start behavior set to Immediately submit and BlackBird’s Backtest Mode on, NinjaTrader immediately submits an order in the direction of BlackBird’s last historical trade when BlackBird is enabled. Turning Backtest Mode off prevents this.

What a strategy actually does

What a strategy is responsible for, and what NinjaTrader, your broker and the exchange are responsible for:

Learning resources

BlackBird Settings window

Where orders, trade signals, and risk and money management rules are set up. See BlackBird Settings Window.

Chart panels

BlackBird’s controls and information on the chart, in panels you can dock anywhere. See Chart Panels:

Strategy properties

The settings on the right of NinjaTrader’s Strategies window. The first sections are BlackBird’s; the rest are added by NinjaTrader.

BlackBird properties

Strategy Template

Strategy Template properties
SettingWhat it does
Choose Settings FileA BlackBird settings file to load when BlackBird starts. Click the field to choose the file.

Options

Options properties
SettingWhat it does
Backtest ModeWhether BlackBird processes trade signals and orders on historical bars, so NinjaTrader can calculate backtest results. Off by default. See below.
Start Auto Trading OnWhether the Chart Trader Auto Trading button starts On or Off. Off by default. See below.
Show Chart TraderShows BlackBird’s chart panels (the default). See below before turning it off.
Message Log FilterHow much BlackBird writes to the NinjaTrader Log and the NinjaScript Output window, from All (the most) down to Popup Alert (the least); None turns it off. Information by default.
Backtest Mode in detail

BlackBird doesn’t calculate backtest results; NinjaTrader does (see Calculating backtest results). This setting decides whether NinjaTrader has any historical trades to calculate them from.

Off (the default): BlackBird ignores trade signals and orders on historical bars, so there are no backtest results. BlackBird loads faster and NinjaTrader uses fewer resources.

On: BlackBird processes trade signals and orders on historical bars, so NinjaTrader can produce Strategy Performance reports. This needs Trade Signals set up: only a fully automated strategy has backtest results.

Historical trades can become live

A historical signal can leave an entry order or a trade open when the historical bars run out. If it wasn’t filled or canceled by then, it becomes a real-time order or trade.

Playback Connection: NinjaTrader treats its Playback Connection as live data, so with Backtest Mode off you still get results, listed under Strategy Performance » Real-Time.

Start Auto Trading On in detail

Anything that reloads the chart (F5, or adding or changing an indicator) resets BlackBird, and the Auto Trading button returns to this setting. It only matters when Trade Signals are set up, and has no effect on historical bars.

Off (the default): a safety feature, so BlackBird never starts auto trading by itself. Click the Auto Trading button when you want it to start.

On: BlackBird starts auto trading on real-time data straight away. Convenient if you often change indicators on the chart and don’t want to turn Auto Trading back on each time.

Tip: when backtesting with the Playback Connection, turn this on, or click the Auto Trading button On, before pressing play.

Show Chart Trader in detail

Off removes every chart panel for a clean chart, so none of their controls are available. It also forces Start Auto Trading On (hidden while this is off): BlackBird starts auto trading immediately and there is no Auto Trading button to turn it off.

To hide only some panels, use the Layout button at the top of the chart instead.

Message Log Filter: All

All writes very detailed debug information to the NinjaTrader Log, which can slow down BlackBird and NinjaTrader. It is only needed when SharkIndicators support asks for it.

Chart UI Options

Chart UI Options properties
SettingWhat it does
Chart Flag Order LengthThe length of BlackBird’s order flag lines, as a fraction of the chart width (0.2 is 20%). The text extends to the left. NinjaTrader’s own order flags aren’t affected.
Chart Flag Position LengthThe length of BlackBird’s position (P&L and size) flag, as a fraction of the chart width. It is drawn a little shorter than the order flags when both are set the same. NinjaTrader’s position flag isn’t affected.

NinjaTrader properties

The remaining sections are added by NinjaTrader to every strategy. SharkIndicators doesn’t lock or hard-code any of them, so set them to suit your trading. Some can also be set in Control Center » Tools » Options.

Known issue: multi-instrument BloodHound systems

BlackBird can’t run a BloodHound system that uses another instrument when Calculate is On price change or On each tick: the instrument BlackBird runs on locks up (found in version 8.2.2.55). On bar close works, and so do multi-timeframe systems with no instrument chosen in their Charts. A fix will be noted in the changelog.

The Setup section
SectionWith BlackBird
SetupSee Understanding strategy properties. Notes for BlackBird below.
Historical Fill ProcessingAdded by NinjaTrader to every strategy. See Understanding strategy properties in NinjaTrader’s Help Guide.
Order HandlingAdded by NinjaTrader to every strategy. See Understanding strategy properties in NinjaTrader’s Help Guide.
Order PropertiesAdded by NinjaTrader to every strategy. Some instruments can’t be traded with a Time in force of GTC and need DAY; ask your broker. See Understanding strategy properties.
Setup notes for BlackBird

Maximum bars look back: Infinite by default, so a BloodHound system loaded in BlackBird can be edited (see BloodHound’s properties). For backtesting or live trading you can set it to 256 to save memory, as long as you don’t edit the BloodHound system in BlackBird. Set it to 256 in the Strategy Analyzer.

Start behavior: if you aren’t sure what the options do, choose Wait until flat.

Enabled is grayed out? You must be connected to a data feed, and have an account selected. After switching to the Playback Connection, select the Playback101 account.

NinjaTrader tip: Calculate property inheritance

NinjaTrader applies the hosting script’s Calculate setting to every indicator it hosts. BlackBird is the host, and the indicators inside it (including a BloodHound system and the indicators BloodHound uses) are its guests. So if a guest needs “On each tick” to work, such as a volume profile or order-flow indicator, BlackBird must be set to “On each tick” too; NinjaTrader doesn’t allow mixing.

Control Center options

In Control Center » Tools » Options » Strategies. See Understanding NinjaScript properties in NinjaTrader’s Help Guide.

If you aren’t sure

In the NinjaScript section, we suggest checking Cancel entry orders when a strategy is disabled and unchecking Cancel exit orders when a strategy is disabled.

Two NinjaScript properties can only be set in a strategy’s code. BlackBird leaves both at NinjaTrader’s defaults: IncludeTradeHistoryInBacktest and IsAdoptAccountPositionAware (BlackBird doesn’t support adopting the account position yet).

Discretionary trade management

You have full control over the profit target and stop-loss orders on the chart.

What to do
1. Move an orderClick the order line, or the right part of its label. A ghost line shows how many ticks it is from the market (positive above the ask, negative below the bid, or @Ask / @Bid). Click again at the price you want. Click, then click again; don’t drag.
2. Cancel an orderClick the red X.

Strategy Analyzer

The Strategy Analyzer backtests BlackBird on historical data for a whole basket of instruments. Two tips:

  1. Set Setup » Maximum bars look back to 256.
  2. Download the historical data you need beforehand, in the Historical Data window (Control Center » Tools » Historical Data).

Backtesting tips

Simulated orders

Often the last historical trade of a backtest is still open when the chart reaches real-time data. NinjaTrader turns it into a simulated real-time trade to finish the backtest, but the only sign on the chart is the last execution marker. Our strategies draw Simulated order flags for those orders, so you can see what NinjaTrader is doing.

Calculating backtest results

Our strategies don’t calculate backtest results; NinjaTrader’s backtesting framework does, on a chart or in the Strategy Analyzer. The strategy only tells NinjaTrader when and where to place each order, and when to move one (for example, a trailing stop-loss). How realistic the results are depends on NinjaTrader’s fill settings and data, and they don’t include slippage unless you set it.

Videos on backtesting

An overview of backtesting on a chart, with Q&A afterward.

The mechanics of backtesting.

Performance tip

Keep NinjaTrader’s database small (NinjaTrader’s performance tip #11). Signs it has grown too big:

  • NinjaTrader or the chart pauses whenever an order is submitted, on any account.
  • Orders take longer than usual to execute.
  • A strategy takes longer to start.

To fix it, clear the simulation account history (NinjaTrader’s steps), or reset the database: Control Center » Tools » Database Management » Reset DB.

NinjaTrader strategy help

Backtesting and running strategies can be complex. These NinjaTrader pages explain the details.

TopicNinjaTrader pages
Running strategiesRunning a NinjaScript strategy from a chart
Strategy position vs. account position
Setting real-time strategy options
BacktestingDiscrepancies: real-time vs. backtest
Forex: real-time order fills vs. backtesting (in “How bars are built and orders filled”)
DisconnectsOptions: connection loss handling
How to keep strategies running during a disconnect
Reconnection logic (see posts 2 and 6)
Lost connection and not reestablished
When a strategy loses connection

Know the risks of computerized trading

Many systems are involved

Your computer runs Windows, which runs NinjaTrader, which runs the strategy (BlackBird or Raven). When the strategy acts on a signal, it sends an order request to NinjaTrader, which sends it to your broker, who approves it and sends it to the exchange. Fills are reported back the same way: exchange, broker, NinjaTrader, then the strategy. Any miscommunication, internet lag or overloaded server along the way can leave the strategy out of sync with your real position at the exchange.

If you suspect a problem with live orders, use Flatten Everything in the NinjaTrader Control Center, then call your broker to check. See NinjaTrader’s Risks of electronic trading.

In this section

Still stuck? Contact support