Raven is a NinjaTrader Strategy, which extends the functionality of BloodHound to automatically place trade entries and exits.  It is free and complementary with BloodHound.

With Raven, you can take your BloodHound template and use it to place trade entries for a fully automated trading system within NinjaTrader.  You can specify a Profit target and Stop Loss, and Raven can even use BloodHound signals to flatten the position.

Using Raven

In NinjaTrader, you can choose to run a strategy by attaching it to a chart (similar to how you would start BloodHound) or by adding it directly to the Strategies tab in the NinjaTrader Control Center.  For more information on how to instantiate a NinjaTrader strategy see NinjaTrader’s documentation here.

Both methods are identical in terms of setting up Raven.  Below we will cover the more common way of running a Strategy by adding Raven to a chart.
Special Notes from NinjaTrader when running a strategy:
Strategy Position vs. Account Position

Setup

Begin by opening up a chart in NinjaTrader with your desired timeframe and indicators.  It is suggested to leave BloodHound off the chart, because Raven will add BloodHound to the chart.

Having BloodHound already on your chart before adding Raven will not affect Raven in any way, since the instance of BloodHound on the chart runs separately from Raven’s copy/instance of BloodHound.

To add Raven start by right clicking on the chart and selecting “Strategies…”, followed by selecting SiRaven.  On the right hand side you will see the parameters for SiRaven. If Strategies… is grey & disabled see NinjaTrader’s documentation here to enable it.

Scroll to the top of the parameters list.  Begin with the Template parameter by clicking the “…” button, and opening the desired BloodHound template that you wish to auto-trade or back=test.

Specifying Entries

If your BloodHound template has Logic templates defined, and you would like to use one as your entry signals, select it in the Entry Logic Template properties.  If you do not have a Logic template defined, Raven will default to BloodHound’s Solver tab signals, which incorporates all the checked solvers on the Solver tab (the Standard version can not create Logic templates, and thus uses the Solver tab only).

Once a position has been opened Raven will not open or add any more contracts to the current position, in the same direction.  For example, if your BloodHound system gives a Long signal and Raven opens a Long position, then a few bars later BloodHound produces another Long signal, Raven will not open anymore Long positions until the current Long positions is closed or reversed.

Advanced feature:   If your BloodHound file contains multiple Logic templates for different entry signals, Raven can switch between them on-the-fly.  For example, say your BloodHound file has two Logic templates, one of the Logic templates works best in a trending market condition.  The other Logic template works best in a consolidating market.  In order to switch Raven from one Logic template to the other on-the-fly, leave the Entry Logic parameter on None.  Then, after Raven is loaded on the chart, use the pull-down menu as seen above, next to the Orange labeled button, to select which Logic template you want Raven to use to execute trade signals.

Specifying Exits

Just as you can specify the entry conditions to open a trade, you can also use BloodHound’s logic to create exit signals which will close/flatten a position.

To do this, create a new Logic template that gives signals when you want to exit a trade.  Keep in mind that exit signals are opposite of entry signals.  A Short signal will close a Long position, and a Long signal to close a Short position.  Select the exit template from the drop down menu in the Exit Logic parameter.  If an Exit signal occurs on the same bar of an Entry signal, the Entry signal is ignored.

Note:  A Short signal will close a Long position, and a Long signal to close a Short position.  Exit signals can Not open a position or reverse a position.

Starting & Ending Raven

There are a couple of NinjaTrader settings that affect order handling when enabling or disabling Raven.  The NinjaTrader settings mentioned are found in Options > Strategies tab > NinjaScript tab.
When enabling Raven, having NinjaTrader’s ‘Immediately submit live working historical orders‘ selected, Raven > Backtest Mode = True, and Raven > Manage Trades Using = Default, NinjaTrader will immediately submit an entry order in the direction of Raven’s last historical entry order.  Setting Raven > Backtest Mode = False will prevent immediate order submission.  If Raven > Manage Trades Using = ATM, ATM orders can not be immediately submitted, because NinjaTrader can not track/backtest historical ATM orders. To see the Backtest Mode option, ‘Start Auto Enabled On’ must be True or ‘Show Chart Trader’ must be False.

In Options > Strategies tab > NinjaScript tab > Order handling, you may want to select ‘Cancel entry orders when a strategy is disabled, and uncheck ‘Cancel exit orders when a strategy is disabled’.

Tip:  If you do not fully understand the setting in Control Center » Options menu » Strategies tab » NinjaScript tab, then we suggest selecting  ‘Wait until flat before executing live’.


Properties

System Template

General Options

Entry Order Options

Trade Management

The Trade Management section allows you to choose options for managing the Profit target and Stop Loss. You can have Raven manage the orders or use your saved NinjaTrader ATM strategy. Raven will manage a single Profit target and Stop Loss. These are submitted as OCO orders.

Managing Trades Using

Select Default to have Raven manage the Target and Stop Loss.  Or, select ATM to have Raven submit your predefined ATM of choice. Click the tab below for each mode.

Signal Alerts


Common NinjaTrader Properties


General

All the parameters in the General section are added by NinjaTrader and common to all strategies.  A description of each setting can be found in the Understanding strategy properties section of NinjaTrader’s Help guide.

Historical Fill Process

All the parameters in this section are added by NinjaTrader and common to all strategies.  A description of each setting can be found in the Understanding strategy properties section of NinjaTrader’s Help guide.

Order Handling

All the parameters in this section are added by NinjaTrader and common to all strategies.  Please note, regarding TIF parameter some instruments can not be traded using Gtc and must be changed to Day.  Your broker can help with in this matter.  A description of each setting can be found in the Understanding strategy properties section of NinjaTrader’s Help guide.

Order Properties

All the parameters in this section are added by NinjaTrader and common to all strategies.  A description of each setting can be found in the Understanding strategy properties section of NinjaTrader’s Help guide.


Video Tutorials


Backtesting with Raven
(original follow up to the first 3 BloodHound videos)


Older but more in-depth video:

This video will help you get started with the strategy component called Raven.  Raven will help you back-test your BloodHound system.

  •     These timestamps will open the video in a new YouTube tab.  Be sure to change the resolution to HD 1080p.
  • 00:32 - This workshop covers a complete overview of Raven, and includes some NinjaTrader tips for using strategies.
  • 15:36 - Adding and setting up a Time Session Solver.
  • 33:09 - The process of adding Raven to the chart.
  • 34:22 - Loading BloodHound into Raven.
  • 36:40 - Entry & Exit Logic - Note: Leaving Entry Logic set to -None- will allow you to choose your Entry Logic template from the chart’s drop-down menu. An Exit Logic must be selected in order to use the Exit Logic functionality. This was not explained in this video.
  • 38:26 - Long/Short Threshold values explanation.
  • 45:05 - Confidence Use Compare explanation.
  • 47:15 - Entry Order Options.
  • 59:06 - The difference between BloodHound and Raven.
  • 1:00:50 - Options - Note: This video was filmed before the ‘Start Auto Enabled On’ option was added.
  • 1:09:21 - Trade Management - Using an ATM.
  • 1:13:41 - Trade Management - Using the Default option.
  • 1:25:25 - Signals - Play Alert.
  • 1:26:29 - General Section - NT Standard Settings.
  • 2:41:09 - Is there a limitation to the number of charts, BloodHounds, and Ravens that can be run at the same time.
  • 2:44:16 - A quick lesson on using BloodHound in the Market Analyzer.

Click the YouTube logo or the Full Screen    icon
to expand the size.  Watch in HD 1080p for best results.


What's the difference between Raven and BlackBird?



Raven's Chart Trader


Raven’s Chart Trader provides manual control over Raven’s operations.  The exhibit below will explain the various interface components.


Discretionary Trade Management


Raven’s Chart Trader provides manual control over the Profit Target and Stop Loss price placement.

Number 1 Modifying Order Price  To modify the price of an order, left click with your mouse on the order line or the right section of the label. A ghost order line will appear and display the number of ticks you are away from the market.
When above the ask the label will display a positive value, below the bid the label will display a negative value. At the ask the label will display @Ask and at the bid the label will display @Bid.
Once you have the ghost order at the price you desire, left click with your mouse to complete the modification. This is a click once and click again method, you do NOT click and drag.
Note:  When Trail The Stop Loss is True, the Stop Loss will always move back to the calculated trailing stop price.

Number_2 Cancelling an Order  To cancel an order, left mouse click on the red X on the order marker.


Strategy Analyzer


Using Raven in the Strategy Analyzer allows you to run historical analysis on a basket of instruments.  Click here for the Strategy Analyzer Help guide.  Due to some unusual behavior of the Strategy Analyzer these simple steps should be followed before running the Strategy Analyzer.  Open the NinjaTrader Historical Data manager (found in Control Center » Tools » Historical Data) and download all the historical data you want to backtest against, while the data feed is connected.  Then disconnect the data feed before clicking Run Backtest.

Optimization

The Optimization feature is not able to access the dynamic nature and changeable indicator parameters inside BloodHound solvers, and therefore has limited practical value.  See the next section for more info on this.  The Profit Target and Stop Loss parameters of can be optimized.
Tip:  The NinjaTrader optimizer is CPU and memory intensive.  If the range of optimized parameters is too large, your computer or NinjaTrader itself will fail to complete or lock-up.  You will need to determine the limit of what your computer and/or the version of NinjaTrader you are running can handle before failing to complete.

Can Indicator Properties be Exposed to a NinjaTrader Window?
(for Optimization or simple changes to indicator settings)

Currently, NinjaTrader uses a static property grid (seen on the right) for their Indicators window, and all other windows such as the Strategy Analyzer/Optimizer window.  This means new indicator setting can not be added on-the-fly which is needed for the dynamic nature of SharkIndicators software that allows indicators to be added and removed on-the-fly.  A new indicator version must be created in order for NinjaTrader to add or change the list of Properties.   Therefore, the way NinjaTrader is currently designed, BloodHound is not able to expose indicator properties.
e.g.  If your system uses the MACD, the Fast , Slow , and Smooth properties need to be listed in the property grid.  But, later if you decide to remove the MACD and use the Momentum instead then the Period property needs to be added, while the Fast , Slow , and Smooth properties for the MACD need to be removed from the property grid.  Unfortunately, NinjaTrader does not allow that.  We hope a solution can be found in the future.


Backtesting Tips & Help

Simulated Orders

Click image to enlarge.

What are those Simulated order flags?.  You have probably never seen those simulated flags before when backtesting other strategies.  That is because they are only available with SharkIndicators' strategies.  They provide a visual reference for what NinjaTrader is doing.  When backtesting a strategy, quite often a historical entry is executed, but the exit orders did not get hit before the chart reaches real-time data.  That last backtest trade is converted into a simulated real-time trade so that NinjaTrader can finalize the backtest results, using real-time data.
NinjaTrader does not provide visual ques on the chart indicating a backtest trade needs to be finalized, except by carefully reading the last 'Plot executions » Text and markers' on the chart.  These simulated order flags do just that.


Calculating Backtest Results

Backtesting is Not performed by the SharkIndicator's strategy (i.e. Raven and BlackBird).  Backtesting results are calculated by NinjaTrader's backtesting framework.  Regardless of backtesting on the chart or through the Strategy Analyzer, the results are calculated by NinjaTrader.  All a strategy does is simple, it tells NinjaTrader when and where to place an order, along with changing an order's price when an order is moved (e.g. a trailing stop-loss).

Click image to enlarge.

Videos on Backtesting


An Overview of Backtesting on a Chart & Miscellaneous Q & A Afterwards


The Mechanics of Backtesting


Playback Connection Best Practices

This video was created during NinjaTrader 7.  However, the lessons taught are still good practice for NT 8.



Performance Tip

It is important from time to time to head NinjaTrader's Performance Tip #11.  #11 is about reducing the size of the NinjaTrader database, which helps greatly with performance.

Signs that the database is to large:

  • The NinjaTrader platform or the chart starts pausing when any order on any account is submitted.
  • A longer than normal delay in the time it takes for an order to execute.
  • BlackBird/Raven, or any other strategy, takes a longer time to start up,

Any of those behaviors is a sign that NinjaTrader’s database is to large, and resetting it or clearing the Sim account history helps.

Clearing the history of the simulation account(s):
-  Follow these steps from NinjaTrader.

Resetting the database:
-  Go to the Control Center.
-  Select the Tools menu, and then select Database Management.
-  Next go to Reset DB, and reset the database.


NinjaTrader Strategy Help

The links below are provided to help you understand the various aspects, discrepancies, and information you need to understand about backtesting and other aspects of running a strategy, which can be a complex topic.

Know the Risks of Computerized Trading

We want you to be aware there are numerous components, both hardware and software, involved with computerized and automated trading.  The process starts with your computer, running Windows, running NinjaTrader (NT), and running an NT strategy (i.e. Raven or BlackBird).  When the strategy receives a “signal” from the BloodHound logic, it sends an order request to NinjaTrader’s order submission framework.  At which point NinjaTrader transmits the order to your Broker, who must approve the order and then sends it to the Exchange.  If your order is filled, the exchange notifies your broker, who then notifies NinjaTrader, and finally NinjaTrader updates/notifies the strategy.  As this simplified example illustrates, there are several components & “players” involved and lots of software programs that make this all happen.  If there is any miscommunication, internet lag time, or server overloading among these components, the strategy may get out of sync with your position(s) at the Exchange.  If you suspect any issue with your live orders use the ‘Flatten Everything’ option in the NinjaTrader Control Center, and then call your broker immediately to verify.  See the "Risks of Electronic Trading with NinjaTrader" section for more information.