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

Lookback Node

Lookback node

The Lookback node looks back over earlier bars for a signal, or shifts a signal forward by a number of bars.

For example: has a signal happened in the last 10 bars? Or bring a signal from 3 bars ago to the current bar. In effect it can extend a signal forward for as many bars as you look back. The Long and Short sides are looked back over separately.

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: Displacement and Lookback Period
SettingWhat it does
DisplacementHow many bars back the Lookback Period starts. 0 is the current bar (no displacement), 1 the previous bar. With a Lookback Period of 1, the node simply outputs the value from that bar.
Lookback PeriodHow many bars to look through, starting at the Displacement bar. 1 is a single bar; 2 is that bar and the one before it, and so on.
Lookback ModeAppears when Lookback Period is 2 or more. How the bars in the period are combined, separately for each side:
Max: the largest value in the period. Use it to carry forward any signal that occurred in the period.
Min: the smallest value. Use it to require a signal on every bar of the period: one bar without a signal makes the output 0.
Average: the average of the values in the period.
Max and Min examples

Bar [0] is the current closed bar, bar [1] the one before it, and so on.

Max, Lookback Period 5, Displacement 1: a signal if any signal occurred from bar [1] to bar [5]. A signal is not shown on the bar it occurs on (bar [0]) but from the next bar, because of the displacement: in effect the signal is extended forward for 5 bars, starting one bar after it occurred.

Min, Lookback Period 5, Displacement 0: no signal if any of bars [0] to [4] has no signal. To get a signal, the current bar and the 4 before it must all have one.

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

Still stuck? Contact support