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

Slope Solver

Slope solver node

The Slope solver identifies how an indicator is sloping: rising or falling, steeply or gently, or flat.

For example: is the SMA rising, is the EMA falling, or is the HMA flat enough to suggest consolidation? Slope is measured as the change from one bar to the next, in ticks or points, not in degrees (why).

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.

Parameters

Parameters: Slope Period
SettingWhat it does
Slope PeriodSmooths the Input with an SMA of this many bars before measuring the slope. Useful for jagged indicators such as the CCI or MACD. The default, 1, means no smoothing; 2 smooths slightly. For a different kind of smoothing (EMA, HMA), nest the indicator instead.

Output Rules

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

Output: Slope Rules

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 whether the Input is rising, falling or flat, for example “is the SMA rising?”. The sentence above the settings changes to describe the condition as you edit it.

  1. The name of the Input, for example the indicator name or the bar price.
  2. The condition. Flat: no slope, or less than the amount in 4 and 5 (keep that small; charts are rarely perfectly flat). Not Flat: a slope of at least that amount, either way. Rising or Falling: sloping that way, by the amount in 3, 4 and 5.
  3. At Least: rising or falling by at least the amount in 4 and 5. At Most: by no more than that.
  4. The amount of slope.
  5. The unit for that amount. Moving averages are usually best in Ticks; indicators in their own sub-panel (MACD, CCI, Stochastics) in Points.
  6. 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.

For example, SMA [ Rising ] by [ At Least ] [ 0.5 ] [ Ticks ] is true while the SMA rises at least half a tick from one bar to the next: a moderate rise.

Why not degrees?

The price axis of every trading chart expands and shrinks to fit the prices on screen, so any angle changes as the chart rescales: a line at 40° during a quiet range flattens to perhaps 30° once the market trends to new highs, though the line itself hasn’t changed. The only reliable measure is the change in value from one bar to the next. On crude oil (CL), an SMA moving from 50.00 to 50.50 has a slope of 0.5 points, or 50 ticks.

Range rules

A Range rule identifies when the slope is between a minimum and a maximum, for example rising by between 0.5 and 2 ticks per bar.

  1. The name of the Input.
  2. The minimum slope of the range.
  3. The maximum slope of the range.
  4. The unit for 2 and 3: Ticks for moving averages, Points for indicators in their own sub-panel.
  5. The output value when the slope is in the range. 1 suits most systems.
Ranged Output (fuzzy logic, advanced)

With Ranged Output on in the rule’s Settings menu, two Output fields appear: the output confidence value when the slope is at the minimum (2), and when it is at the maximum (3). Between them, the output is interpolated. If one of them is 1, the other should be less. Only use this when building a fuzzy logic system.

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, July 2024.

Examples

Example 1A: The basics

Which way the SMA 14 is sloping: Long while it rises, Short while it falls, nothing while it is flat.

Settings and chart

Input settings

  • Leave the Input as SMA 14.

Rules window

  • No changes needed.

Result

A Long output while the SMA points up, a Short output while it points down, and no output while it is flat.

Example 1B: Filtering out weak slopes

Only a strong slope of the SMA 14, at least 1 point per bar, counts; weaker slopes are ignored.

Settings and chart

Input settings

  • Leave the Input as SMA 14.

Rules window

  • Open the Rules window with the ellipsis (…) button next to Slope Rules, then set the rule as shown.

Result

An output only while the SMA slopes more than 1 point per bar, in either direction.

Example 1C: Identifying flatness (consolidation)

Finds flat stretches of the HMA 50, a sign of consolidation, for example as part of an exit signal.

Settings and chart

Input settings

  • Set Indicator to HMA 50.

Rules window

  • Open the Rules window with the ellipsis (…) button next to Slope Rules, then set the rule as shown.

Result

Long and Short outputs together while the HMA is flat. Flat has no direction, so a non-directional condition like this should normally output both sides.

Example 2: Finding consolidation with the ADXVMA

A more specialized way to find consolidation, using the SiADXVMA indicator (Lizard Trader has a similar one), for use in an exit system.

Settings and chart

Input settings

  • Set Indicator to amaADXVMA.

Rules window

  • Open the Rules window with the ellipsis (…) button next to Slope Rules, then set the rule as shown.

Result

Long and Short outputs together while the ADXVMA is flat, which is neither long nor short.

Still stuck? Contact support