Adaptive Consolidated Bars HL2 |
Top Previous Next |
Adaptive Consolidated Bars HL2 - computes a mean of the high and low values of a single virtual Adaptive Consolidated Bar which is formed from the combination of the most recent bars on a chart, but unlike the regular Consolidated Bars these Adaptive Consolidated Bars treat rising bars and falling bars independently. The Adaptive Consolidated Bars offer the option of consolidating a different number of bars for rising prices as contrasted to the number of bars for falling prices. Since the function of a consolidated bar is to absorb noise and rising price jitter is often different from falling price jitter, the Adaptive Consolidated Bars permit an asymmetrical definition to accommodate this.
In order to consolidate bars, you begin with a base chart of either time, range, or volume bars.
Bar Counts The next step is to specify a bar count for the number of rising bars you want to consolidate and the number of falling bars you want to consolidate. (An alternative is to let the optimizer choose the number of bars for rising and falling prices.) As stated above, the numbers don't have to match. For example, if you set the "Bar Count Higher" parameter to 4 and the "Bar Count Lower" parameter to 2, a new Adaptive Consolidated Bar cannot be formed until either 4 or 2 new bars of the base chart have been formed.
Rules for Forming and Displaying Bars One final step that must be considered before a consolidated bar is created is to determine if the following rules have been met:
A higher high and a higher or equal low (...on the bar under construction...) is an up bar. (Publish if the bar fulfills the Bar Count (Higher) requirement for number of bars and reset all indicators to re-initiate bar search.)
A lower or equal high and a lower low … is a down bar. (Publish if the bar fulfills the Bar Count (Lower) requirement for number of bars and reset all indicators to re-initiate bar search.)
A lower or equal high and a higher or equal low … is an inside bar, not up or down, absorb it but don't publish anything on the chart (if Gap Mode = 1) or publish the previous value of the bar in progress (if Gap Mode = 2). (See definition of Gap Mode in Parameters section below.)
A higher high and a lower low … is an outside bar and is evaluated as: If the Average of the current High, Low, and Close bars > last published bar = this bar is up and will be published on the chart If the Average of the current High, Low, and Close bars < last published bar = this bar is down and will be published on the chart
If both of these tests fail then repeat using the Average of the current High and Low.
If both of those sets of tests fail then absorb the bar but don't publish anything on the chart (if Gap Mode = 1) or publish the updated value of the bar in progress (if Gap Mode = 2). The new Adaptive Consolidated Bar is not up or down.
Every time a new Adaptive Consolidated Bar meets it specifications, it is reinitialized and begins creating the next bar. The indicator includes two "gap" parameters that let you decide how the indicator is computed when there is a break in trading.
Parameters: Bar Count (Higher) - the number of most recent rising bars that will be consolidated into a virtual Adaptive Consolidated Bar if the above rules are met Bar Count (Lower) - the number of most recent falling bars that will be consolidated into a virtual Adaptive Consolidated Bar if the above rules are met
Gap Half Days - A value of 1 represents a 3 hour gap. A Gap Half Days value of 1 is useful for daily futures or early morning lack of trades in a range or volume environment. A Gap Half Days value of 1 will also work for an overnight gap in stock trading.
Values 2-10 represent the number of 12 hour periods which defines a gap.
Gap Mode - 1) After a gap return “n/a” until “Bar Count” bars are available 2) Indicate the bar in progress on every bar of the base chart until you reach “Bar Count (Higher) or Bar Counter (Lower)”and the bar is in fact higher or lower
open,high,low,close,volume,date - these are required parameters which are not to be changed
When used with range or volume bars, the chart can be configured to a small bar size and the Adaptive Consolidated Bars can provide access to higher bar size attributes without having to wait for a genuine higher bar to complete. This effectively allows trading "inside" larger bars. On tick based charts (range and volume bars) these Adaptive Consolidated Bars act like variable time bars. A 5 bar consolidation of a .50 range bar will not yield a 2.50 range bar. Rather it will indicate the range bar performance over the time it took to create the 5 bars.
"Gap Half Days" defines a gap in prices. As an example, stocks trade from 8:00 AM or 9:30 AM to 4:00 PM or 6:00 PM. Then there's an overnight trading gap. Also there's a weekend trading gap and a holiday trading gap. Often stock prices will move sharply up or down when trading resumes. By recognizing gaps, the system can avoid building opening bars which reach back to a prior trading day to determine high and low prices. Without this capability, the following problem would exist. In a 1 minute chart which is generating 15 bar consolidations, the first 14 bars after the open would be distorted by either the high or low of the previous trading day's trailing 14 bars closing 1 minute bar. This same distortion would appear on range or volume bar charts. This problem may be addressed with the Gap parameters. If Gap Half Days = 1 then any lack of trading for a 3 hour period will be identified and the resulting Consolidation bars will be restarted. This will happen every day, every holiday and every weekend, If Gap Half Days = 4 then daily trade gaps will be ignored but the Adaptive Consolidated Bars will be reset on every 2 or 3 or 4 day weekend. A restarted Adaptive Consolidated bar ignores past bars and begins to accumulate data with the present bar. This means that any computations using this data will be moving in the right direction and with the correct momentum even if the previous trading day's close was considerably different.
Since the system is aware of trade breaks, the Gap Mode parameter is available. If set to 1 then the output will return "n/a" until an adequate number of bars is available to Consolidate. In mode 2 the behavior will be as described in the previous paragraph. Be aware that any indicator presenting a value of "n/a" inside a trading strategy or optimization will suspend trading until the "n/a" is resolved. One consequence of this is that you could prevent trading during the first "Bar Count (Higher) or Bar Count (Lower)" bars of a range bar chart regardless of how much time is required to generate the bars. |