Expansion Contraction
The Expansion Contraction solver analyzes whether Input A and Input B are expanding away from each other, contracting toward each other, or are moving parallel with each other. Using the Rules window, the Long & Short output conditions can be independently customized for multiple conditions. This solver is new for BloodHound v2 only.
Properties tab
Properties tab
This section provides quick access to commonly used output modifiers.
Please note: The buttons only modify the individual instance of the selected node(s) on a Logic Board. Thus, the buttons are only visible when a node is selected on the Logic Board. The buttons are not available when a solver is selected in the Solvers panel, because the original solver's output can not be globally modified.
This behavior is consistent with adding a function node afterwards, so that the original solver's output remains unmodified elsewhere in the system. It is similar to having an SMA(50) on several charts. Changing the plot color on one chart does not modify the plot color on the other charts.
Global Properties
Global Properties
Behavior
Input A
This is the first input data to be evaluated against Input B. Use the Type drop-down menu to select the data type.
The menu will change based on which data type is selected. Click on Type to see the various data types available and the corresponding documentation.
The Input section determines the data type to be evaluated. Use the 'Type' menu to select the data type. See below for detailed information on each data type.
Type: Fixed Value
Type: Price
This option allows price data to be used in the solver. The price data can be shaped/manipulated by the various settings before it is used by the solver.
Custom Prices
SharkIndicators has custom system development prices that are very useful in reducing the number of solvers, and simplifying system logic, when evaluating the open and close (body) prices.
Body Top: Regardless of the bar direction, this returns the upper price of the candlestick body. Either the close or open price. Whichever is on top. e.g. For an up bar, the Body Top equals the close price.
Body Median: This returns the median price of the candlestick body. The formula is (Close + Open) ÷ 2.
Body Bottom: Regardless of the bar direction, this returns the lower price of the candlestick body. Either the close or open price. Whichever is the bottom. e.g. For an up bar, the Body Bottom equals the open price.
Type: Volume
Volume will feed the current bar volume into the solver.
To evaluate the volume from a few bars back, use Indicator Value. Then select the VOL indicator, and use the Displacement setting.
Type: Indicator Value
Type: Swing Point Prices
Swing Point Prices uses the Swing Highs & Lows indicator plots for input price data. This is useful when you need to access the lowest low or highest high prices from the latest swing point.
You can add the bundled indicator Swing Highs & Lows to the chart to help you visualize the price data the solver is using.
Type: Linear Regression Channel
Input B
This is the second input data to be evaluated against Input A. For documentation scroll up to section Input A.
Use the Type drop-down menu to select the data type. The menu will change based on which data type is selected.
Output Rules
Options tab
Options tab
This section is used to modify the node's final output value. It is only useful for designing fuzzy logic systems, or a fuzzy logic section of a system.
Please note: The Weight controls only modify the individual instance of the selected node(s) on a Logic Board. Thus, the Weight controls are only visible when a node is selected on the Logic Board. The controls are not available when a solver is selected in the Solvers panel, because the original solver's output can not be globally modified.
This behavior is different than BloodHound 1.0. In BH 1.0, the Weight controls modified the nodes output globally (every instance). This change in BH 2.0 adds more system design granularity.
Multiply Output: This takes the internal values (the Long and Short values determined via the Properties tab » Output Rules section) and multiplies them by this value. Note: the final output will not exceed a value of 1, as described in the Slider control below.
Slider control: The slider constrains the final output to a value of 0 to 1. The left side of the slider sets a minimum value that is output regardless if the solver condition is true or not. The right side sets a maximum value that is output. The output is capped.
e.g. Three indicator conditions are being checked, and thus three solvers are created. Only two out of the three indicator conditions are needed. An Additive logic node is used to add the solver's outputs together. Just two out of the three solvers need to add up to a value of 1. Therefore, the right slider (max output value) for all three solvers is set to 0.5. When two indicator/solver conditions are found, thus the outputs = 0.5, then the calculation, in the Additive node, is 0.5 + 0.5 + 0 = 1. A value of 1 means the two out of three condition is true.
Hedge Operation: This applies a mathematical formula to the internal value.
None: No modification is applied.
Very (square output): A squaring formula is applied. Output = value^² .
Somewhat (square root output): A square root formula is applied. Output = √value .
Description
Description
This text area provides a place to write a full description of what the node is doing, used for, or what ever you want.
Note: The Description is global to all instances of the node. It is not applied individually to each instance as the Weight controls are.
Help tab
Help tab
This tab displays the documentation page (from this web site) of the selected node.
Please note: NinjaTrader v8.0.26.0 or newer is required for the built in web viewer to work, and thus the documentation to be displayed.
Video Tutorial
Example: Identify When the Bar Length Increases/Decreases
Examples
Example 1A: The Basics
This example identify when the Bollinger indicator upper and lower bands are expanding away from each other. Both a Long & Short output is generated when the bands expand, because expansion or contraction is not identifying trend direction, but rather price volatility.
- Set Input A to the Bollinger » Upper Band plot.
- Set Input B to the Bollinger » Lower Band plot.
Rules window Settings:
Open the Rules window by clicking the ellipses button in section Output » Expansion/Contraction Settings.
- Set up the Fixed rule as show below.
The chart shows when price volatility is increasing per the Bollinger bands. Note how the bands can expand or contract even though the bands are both sloping in the same direction.
Example 1B: Expanding MA's
This looks at expanding moving averages (MA), which like Example 1A is really identifying price volatility/expansion, but in a secondary manor can identify trend moves and continuations. Both a Long & Short output is generated when the MA's expand, because expansion or contraction is not identifying trend direction, but rather price expansion.
- Set Input A to the EMA 20.
- Input B is adjusted to the SMA 50.
Rules window Settings:
Open the Rules window by clicking the ellipses button in section Output » Expansion/Contraction Settings.
- Set up the Fixed rule as show below.
The chart shows when price expansion is increasing per the two MA's. Note when the MA's have just crossed-over it is not a perfect solution, just as a MA crossover system is not a perfect trading system.
Example 2: Expansion Exhaution
This identifies extensive expansion between two moving averages (MA). It is very similar to Example 1B, but identifies extreme MA expansion, which can indicate the recent price move is over extended and exhausted. Both a Long & Short output is generated when the MA's expand, because expansion or contraction is not identifying trend direction, but rather price expansion.
- Set Input A to the EMA 20.
- Input B is adjusted to the SMA 50.
Rules window Settings:
Open the Rules window by clicking the ellipses button in section Output » Expansion/Contraction Settings.
- Set up the Fixed rule as show below. Note, the Points value is set to 2.5.
The chart shows when price expansion, per the two MA's, has made an extensive move, and thus a period of consolidation may follow.
Example 3: MACD Expansion
This is similar to Example 1B, but uses the MACD indicator. The MACD is basically a dual moving average indicator packaged in a different format. When the MACD line is expanding away from the Average line, it can indicate a trend move or continuation. Both a Long & Short output is generated when the MACD lines expand, because expansion or contraction is not identifying trend direction, but rather price expansion.
- Set Input A to MACD » MACD plot.
- Set Input B to MACD » Avg plot.
Rules window Settings:
Open the Rules window by clicking the ellipses button in section Output » Expansion/Contraction Settings.
- Set up the Fixed rule as show below.
The chart shows when price expansion is increasing per the MACD. Note when the MACD lines crossover it is not a perfect predictor of a trend reversal.
Example 4: Averaged Price Consolidation
This is the opposite of Example 1B. It identifies contraction between two moving averages (MA), which can coincide with price consolidation. The first input is a fast HMA of the median bar price to smooth out the jumpy nature of the closing bar prices. Both a Long & Short output is generated when the MA's contract, because expansion or contraction is not identifying trend direction, but rather price consolidation.
- Set Input A to the HMA. Then nest Chameleon into the HMA as shown below.
- Input B is adjusted to the SMA 50.
Follow the directions in the image to set up the HMA. Chameleon is used to feed the Median price as the Input Series of the HMA.
Rules window Settings:
Open the Rules window by clicking the ellipses button in section Output » Expansion/Contraction Settings.
- Set up the Fixed rule as show below.