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

Threshold Solver

Threshold solver node

The Threshold solver compares its Input with one or more fixed levels, to identify when an indicator is above or below a set value.

For example: the CCI above 100 or below -100, the Stochastics above 80 or below 20, or the MACD above or below zero.

Tip

To compare an indicator with another indicator, with bar prices or with any other value that changes, use the Comparison solver.

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

What the solver evaluates. Choose a data type in the Type menu; the settings below it change to match.

Input with Type set to Indicator Value: Indicator and Displacement settings
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.

Output Rules

Output rules decide when the solver gives a Long or Short output. Open the Rules window with the ellipsis (…) button next to Threshold Rules.

Output: the Threshold Rules setting

The Rules window

Where you define the conditions the solver looks for. One solver can combine several rules, so complex conditions don’t need several solvers.

How the Rules window works

Click a rule’s title bar (the strip that says Fixed or Range) to expand or collapse it.

ControlWhat it does
Add Rule menu (top left)Adds a rule. A Fixed rule is the most common: it compares the Input with a value, or with Input B. A Range rule compares the Input with a lower and upper limit, or with a range of distance between Input A and Input B. To use a Range rule instead of the default Fixed rule, delete the Fixed rule, then add a Range rule.
Output Calculation menu (top right)Decides the output when two or more rules are true at the same time. See below.
Settings window (Range rules)Finer control over the values being evaluated. See below.
Delete buttonDeletes the rule. Undo brings it back.

Output Calculation options

OptionOutput
FirstThe output of the first true rule, working down from the top of the list.
LargestThe largest output of all the true rules. For fuzzy logic systems.
SmallestThe smallest output of all the true rules. For fuzzy logic systems.
AverageThe average of the outputs of all the true rules. For fuzzy logic systems.
AdditionThe outputs of all the true rules added together. For fuzzy logic systems.

Range rule settings

SettingWhat it does
Outside / InsideWhether the rule is true inside the range or outside it.
Exclude / IncludeInclude counts the range limits themselves (>= and <=). Exclude doesn’t (> and <).
Fixed Output / Ranged OutputFixed Output is a simple on/off output: 0, or the value on the far right (usually 1). Ranged Output turns on fuzzy logic: two Output fields appear, and when the Input is between the limits, the output is interpolated linearly between those two values.

Fixed rules

A Fixed rule identifies when the Input is above, below or equal to a level. For example, whether the CCI is above 150 or below -150, or whether the MACD is above or below zero.

  1. The name of the Input, for example the indicator name or the bar price.
  2. The comparison (see the table below).
  3. The threshold level. When the comparison is true, the rule is true.
  4. The output value when the rule is true. 1 (100% confidence) suits most systems; use a smaller value only when building a fuzzy logic system.
ComparisonTrue when the Input is
=equal to the level
!=not equal to the level
>greater than (above) the level
<less than (below) the level
>=greater than or equal to the level
<=less than or equal to the level

For example, CCI [ > ] [ 150 ] is true while the CCI is above 150. See the examples below.

Range rules

A Range rule identifies when the Input is between two levels.

  1. The name of the Input, for example the indicator name or the bar price.
  2. One end of the range. For the Long calculation this is usually the lower level, with 3 the upper level; for the Short calculation it’s usually the other way round, as in the image.
  3. The other end of the range.
  4. The output value when the rule is true. 1 (100% confidence) suits most systems; use a smaller value only when building a fuzzy logic system.
Ranged Output (fuzzy logic, advanced)

With Ranged Output turned on in the rule’s Settings menu, two Output fields appear, 4 and 5. Only use this when building a fuzzy logic system.

  • 4: the output confidence value when the Input is at level 2.
  • 5: the output confidence value when the Input is at level 3.

If one of them is 1 (100% confidence), the other should be less.

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 video

From the weekly training workshop, April 2025.

Examples

This video shows how to detect price interacting with a threshold level, using three different solvers, including Threshold.

Example 1A: The basics

Detects overbought (above 80) and oversold (below 20) conditions on the Stochastics D plot.

Settings and chart

Input settings

  • Set Indicator to Stochastics » D.

Rules window

Open the Rules window with the ellipsis (…) button next to Threshold Rules, then set the levels as shown.

Result

A Long output while the Stochastics D is above 80, and a Short output while it’s below 20.

Example 1B: Volatility

Detects when the ATR is above 7. Some systems need, or take advantage of, higher volatility.

Settings and chart

Input settings

  • Set Indicator to ATR.

Rules window

Open the Rules window with the ellipsis (…) button next to Threshold Rules, then set the levels as shown. The Long and Short settings are the same.

Result

Long and Short outputs when the ATR goes above 7, showing when trading activity picks up. The ATR has no direction, which is why both outputs appear at the same time.

Example 1C: A basic MACD filter

Uses the MACD’s zero line as a filter: Long above zero, Short below.

Settings and chart

Input settings

  • Set Indicator to MACD.

Rules window

No changes needed.

Result

A Long output while the MACD is above zero, and a Short output while it’s below. A simple filter.

Example 2A: A discretionary support/resistance level

Allows longs only above a price level you choose, and shorts only below it, using the close price.

Settings and chart

Input settings

  • Set Input » Type to Price.

Rules window

Open the Rules window with the ellipsis (…) button next to Threshold Rules, then set the levels as shown.

Result

A Long output while the close is above 11,200.0, and a Short output while it’s below.

Example 2B: Two discretionary support/resistance levels

Above the lower level, only longs are allowed; below the upper level, only shorts. Between the two levels, both can occur.

Settings and chart

Input settings

  • Set Input » Type to Price.

Rules window

Open the Rules window with the ellipsis (…) button next to Threshold Rules, then set the levels as shown.

Result

A Long output while the close is above 11,160.0, a Short output while it’s below 11,200.0, and both while it’s between the two levels.

Still stuck? Contact support