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

If Then Node

If Then node

The If Then node is a switch. A signal at its IF input passes whatever is connected to THEN through to the output; no signal passes whatever is connected to ELSE.

One of THEN or ELSE always reaches the output. The Long output and the Short output each have their own switch inside the node and are switched separately: a Long signal at IF switches only the Long side to THEN.

How it works

Signal at IFLong outputShort output
Long onlyfrom THENfrom ELSE
Short onlyfrom ELSEfrom THEN
Long and Shortfrom THENfrom THEN
Nonefrom ELSEfrom ELSE
A Long signal at IF
A Short signal at IF
Long and Short signals at IF

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.

Properties

This node’s settings apply to this node only. Unlike a solver, which can be used in several places with shared Global Properties, each of these nodes is a single, independent node.

Options

Options: Signal Threshold
SettingWhat it does
Signal ThresholdThe smallest value at the IF input that counts as a signal and switches that side to THEN. Checked separately for the Long and Short sides: a Long value at or above it switches only the Long output.

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

How the If Then node works inside, from 3:16. It shows BloodHound v1, but the settings and how they work are the same.

Letting system A override system B. System A (connected to IF and THEN) identifies overbought and oversold conditions; system B (connected to ELSE) identifies a trend. Whenever system A has a Long or Short output, the chart shows system A; when it is neutral, it shows system B.

Still stuck? Contact support