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

Crossover Solver

Crossover solver node

The Crossover solver signals when Input A crosses Input B, in the direction of Input A: Long when A crosses above B, Short when it crosses below.

For example: a fast moving average crossing a slow one, price crossing a moving average, or the Stochastics K crossing the D.

Properties tab

Property Inspector tabs, with the Properties tab selected

The essential settings for the node.

Modifiers

Buttons for the most common output modifiers. They change only the selected instance of a node on a Logic Board, so they appear only when a node is selected there, not when a solver is selected in the Solvers panel. That keeps the solver’s original output unchanged everywhere else it’s used, much like changing an SMA’s plot color on one chart leaves it unchanged on your other charts.

Modifiers: the Enabled, Invert and Swap buttons
ButtonWhat it does
EnableTurns the node on or off. When it’s off, the node is left out of the system’s calculations. It still looks connected on the Logic Board, but it’s ignored.
InvertInverts the node’s output. The same calculation as the Inverter function node, without its extra options.
SwapSwaps the outputs: Long becomes Short and Short becomes Long. The same as the Long/Short Modifier function node with Mode: Swap.

Global Properties

These settings apply to every instance of the solver: change one instance and they all change. To change just one, make a copy of the solver. The copy is a separate solver, with a number added to the end of its name.

Behavior

Turns off the Long or the Short output.

Behavior: the Evaluate setting
SettingWhat it does
EvaluateWhich outputs the solver calculates.
Both: Long and Short.
Long only: only Long; the Short output is removed.
Short only: only Short; the Long output is removed.

Input A

The first value the solver evaluates, compared with Input B. Choose a data type in the Type menu; the settings below it change to match.

TypeWhat it evaluates
Indicator ValueAny installed indicator with a plot or Series<T> output, chosen in the Select Indicator window. The default and most used type. Displacement reads the value from a number of bars back.
PriceA bar price (Open, High, Low, Close, or the Body Top, Median or Bottom), optionally processed over a lookback period.
VolumeThe current bar’s volume.
Swing Point PricesPrices from the latest swing highs and lows.
Linear Regression ChannelThe upper, middle or lower line of a regression channel.
Fixed ValueA single value that never changes. Only useful for solvers with two inputs, such as Comparison.

Every type and its settings in full: Data type selection.

Input B

The second value, compared with Input A. It has the same data types and settings as Input A.

Input A and Input B, each with Type, Indicator and Displacement

Settings

Settings: Crosses Occur When Equal and Lookback Period
SettingWhat it does
Crosses Occur When EqualCounts it as a cross when the inputs only touch (become equal) where they would cross, without actually crossing.
Lookback PeriodHow many bars back to look for a cross. In effect, the signal extends forward on the chart by this many bars.

Output

The output value for each situation, for the Long and Short sides.

Output: Crosses In Direction, Crosses Against Direction, Output Decreases as Crossover Ages By, and No Crossover
SettingWhat it does
Crosses In DirectionThe Long output when A crosses above B, and the Short output when A crosses below B.
Crosses Against DirectionThe opposite: the Short output when A crosses above B, and the Long output when A crosses below B.
Output Decreases as Crossover Ages ByReduces the output by this amount on each bar after the cross, until it reaches zero or the Lookback Period ends.
No CrossoverThe value of the Long output and the Short output when there is no cross. The Lookback Period must pass first.

Options tab

Property Inspector tabs, with the Options tab selected

Secondary settings shared by all nodes.

Weight

Changes the node’s final output value. Only needed when designing a fuzzy logic system, or a fuzzy logic part of a system.

How Weight works

Weight changes only the selected instance of a node on a Logic Board. So the controls appear only when a node is selected there, not when a solver is selected in the Solvers panel: a solver’s original output can’t be changed globally.

ControlWhat it does
Multiply OutputMultiplies the node’s internal Long and Short values (set by the Output Rules on the Properties tab) by this number. The final output still can’t go above 1 (see Slider).
SliderLimits the final output to between 0 and 1. The left handle sets a minimum output, given whether or not the condition is true. The right handle sets the maximum; the output is capped there.
Hedge OperationApplies a formula to the internal value.
None: unchanged.
Very: squares it (value²).
Somewhat: takes the square root (√value).

Example: two out of three

Three solvers check three indicator conditions, but only two need to be true. Connect them to an Additive logic node and set each solver’s maximum (the slider’s right handle) to 0.5. When any two are true, the Additive node adds 0.5 + 0.5 + 0 = 1, which means the two-out-of-three condition is met.

Description

Free text for describing what the node does or what it’s for. The Description is shared by every instance of the node, unlike Weight, which is set per instance.

Help tab

Property Inspector tabs, with the Help tab selected

Shows this page for the selected node, inside BloodHound. Click the node’s image at the top of the page to open it in a bigger window. The built-in web viewer needs NinjaTrader 8.0.26.0 or newer.

Tutorial videos

From the weekly training workshop, June 2015. It shows BloodHound v1, but the settings and how they work are the same.

A simple example: detecting price crossing a moving average.

Examples

Example 1: The basics

Long when the SMA 10 crosses above the EMA 30, Short when it crosses below.

Settings and chart

Settings

  • Add the Crossover solver to the Logic Board and connect it to the Result node.
  • Set Input A » Indicator to SMA 10.
  • Set Input B » Indicator to EMA 30.

Result

A Long signal when the SMA 10 crosses above the EMA 30, and a Short signal when it crosses below.

Example 2: A threshold filter

The Stochastics K crossing the D, with longs allowed only while the D is below 40 and shorts only while it is above 60. Shows combining two solvers with a Ratio node, then an AND node.

Settings and chart

Crossover solver

  • Add the Crossover solver to the Logic Board and connect it to the Result node.
  • Set Input A » Indicator to Stochastics » K.
  • Set Input B » Indicator to Stochastics » D.

The Crossover solver alone: every K/D cross.

Threshold solver (the filter)

  • Add a Threshold solver and connect it to the Result node.
  • Set Indicator to Stochastics » D.
  • Open its Rules window: Long rule <= 40, Short rule >= 60.

The Threshold solver alone: Long while the Stochastics is below 40, Short while it is above 60.

Combine with a Ratio node

  • Add a Ratio node, connect both solvers to it, and connect it to the Result node.

The Threshold output now filters the crossover signals.

Or combine with an AND node

  • Right-click the Ratio node and change it to an AND node.

Result

The AND node gives distinct signals: an output only when both solvers have an output in the same direction.

Still stuck? Contact support