Risk Disclosure

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View full risk disclosure.

Bar Length Solver


The Bar Length solver is used to detect the bar’s total range (vertical length) from low to high. Similar to the Range indicator. An output value is given in both directions.

Parameters

This section is common to all solvers.  A description can be found here.
This section is common to all solvers.  A description can be found here.

Range

Sets the threshold value for when Output → Above Max value will be used.  Use this setting to find bars of certain length or larger.

Measurement
Sets the type of measurement to calculate the Max.  Possible measurements are Points, Ticks, Renko Bricks, & ATRs.

Sets the threshold value for when Output > Below Min value will be used.  Use this setting to find small bars of certain length or smaller.

Measurement
Sets the type of measurement to calculate the Min value.  Possible measurements are Points, Ticks, Renko Bricks, & ATRs.

Output

Sets the solver’s output value when the range exceeds the Range → Max value.

Sets the solver’s output value when the range is below the Range → Min value.

Period

The number of bars to analyze.  1 analyzes the current bar only.  2 will analyze the current bar and one bar back. 3 will analyze the current bar and two bars back.
Selects the function used to calculate the bar length (bar range) across the number of bars set by the period. Mode only applies when the period is 2 or more.

Average
Uses the average bar length (bar range) over the period to compute the range.

Largest
Pick the largest bar over the period to use as the computed range.

Smallest
Pick the smallest bar over the period to use as the computed range.

Video Tutorial


Examples


Example 1: The Basics

This demonstrates the basic function of the Bar Length solver by testing for a bar range (High – Low) of 10 ticks or greater.  A simultaneous output of 1 & -1 indicates a bar length is 10 ticks or more.

  • Add the Bar Length Solver.
  • Set the Max to 10 Ticks.

As seen in the chart, an output of 1 & -1 occurs on bars 10 ticks or more.

Example 2: News Volatility

In this next example let’s look for a possible news event affecting price volatility.  This could be done by searching for a bar range that exceeds the ATR by a certain factor.  This example will use 400 percent.  And, lets give the market 15 minutes or 5 bars afterwards to settle down.

  • Add the Bar Length Solver.
  • Set the Mode to Largest.  This will track bars with the largest range.
  • Set the Period to 6.  The “signal” bar is 1, plus 5 more bars afterwards.
  • Set the Max to 4 ATRs.

As seen in the chart, a racing stripe occurs when the bar range is 4 times or greater than the ATR.  1.778 x 4 = 7.152, rounded to the nearest tick size = 7.2pts.  Note that several bars after the signal still had high ranges, although the bar did not quite meet the racing stripe threshold, which, for these examples, is set to 0.8.