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

Bar Direction Solver

Bar Direction solver node

The Bar Direction solver identifies bars that closed in a direction: Long for up bars, Short for down bars. Bars must be at least the Minimum Bar Size to count.

For example: wait for three up bars in a row before allowing a long signal.

The animation shows BloodHound v1; the settings are the same in v2.

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.

Options

What counts as a bar in the right direction, and how many are needed.

Options: Minimum Bar Size, Mode, Number Bars, Signals For Dojis and Start Bars Ago
SettingWhat it does
Minimum Bar SizeThe smallest open-to-close size a bar must have to count, and its unit (Points, Ticks, Renko Bricks or ATRs, see Measuring distance). Smaller bars output 0.
ModeAll or Nothing (most used, for true/false systems): outputs 1 once all the bars in Number Bars are in the same direction, and 0 until then.
Percent (for fuzzy logic systems): each qualifying bar adds an equal share. With Number Bars at 4, each bar adds 0.25, and the 4th brings the output to 1.
Number BarsHow many bars, counting back from Start Bars Ago, must meet the condition.
Signals For DojisLets doji bars on Range charts count as having a direction. Gravestone: the Low, Open and Close are equal. Dragonfly: the High, Open and Close are equal. The definitions are strict, designed for Range charts.
Start Bars AgoHow many bars back to start checking.
Gravestone and Dragonfly doji bars on a chart

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

Examples

Example 1: The basics

An output in the direction of each bar.

Settings and chart

Settings

  • Add the Bar Direction solver and keep the default settings.

Result

A Long (green) output on up bars and a Short (red) output on down bars. Doji bars have no output.

Example 2: Strength on volume

Strong price movement on limited volume, which can hint at a lack of conviction or a “fake-out”. The chart uses Volume bars, which cap the volume per bar, so only price movement needs checking: at least 5 ticks per bar, 3 bars in a row.

Settings and chart

Settings

  • Add the Bar Direction solver.
  • Set Minimum Bar Size to 5 Ticks.
  • Set Mode to All or Nothing.
  • Set Number Bars to 3.

Result

No fake-out happened here, but price paused for a while after each detected move before continuing.

Still stuck? Contact support