Up

GenSavePvts ModHA Function for ADE MM_01

 

 

Package:  ModHA Function for ADE

Modified Heikin-Ashi trend direction and consolidation function for ADE.

What It Is

This function calculates the Modified Heikin-Ashi on ADE data (instead of chart bars).

A good description of the basic Heikin-Ashi may be found here, or in the February 2004 TASC.

The "modified" part of ModHA is the addition of examination of a number of comparison bars
backwards and using that information to condition the Trend value.

This function makes the further innovation of returning a count of consolidation bars for indicator or strategy use.  Thus, the user has the ability to use the function to examine trend status or consolidation status on multiple timeframes in the ADE environment.

Some further discussion and various single-timeframe, non-ADE HA codes may be found  here and here.

Detail Description

The Heikin-Ashi method essentially creates a synthetic bar by calculating a custom Open value and a custom Close value. This is done on the ADE higher timeframe (HTF), as specified by the 'Interval' input.

An initial Trend direction for each bar is assigned based on the direction of the synthetic bar.

Then, the trend direction may be modified by comparing the current bar HA Open and Close to the range of prior HA bars. If current HA bar's range is within immediately prior HA bar range(s), then trend direction remains the same, even though the progress of the trend has "paused".

This function specifically detects these consolidation bars and returns a count of them in sequence when they appear. Thus, a caller of this function can determine if the current Trend is in consolidation, and for how long.

Sample call:

Trend =ADF.ModHA.p("OHLCV", GetSymbolName, Interval, ADE.BarID, CompBars, haOpen, haClose, haConsCount, DbgLevel) ;

Return values:

oHAopen Open value of HA synthetic bar
oHAclose Close
oConsCount Count of recent HA bars where current HA range is engulfed by prior HA ranges

Educational Note:

The ModHA calculation is one which relies upon its own previous values.  This is an intermediate/advanced concept to code in a function that operates on ADE data and thus does not have access to  TradeStation's normal lookback bracket notation.  This function illustrates how this challenge may be overcome using ELC lists inside a function.

Requirements:

You need to have ELC/ADE installed in your TradeStation environment to take advantage of this function, and you will need a general familiarity with ADE concepts to grok what this is all about.

What You Get

The full source code of the function. 

Customer support as needed to answer any function-specific questions you may have.

This function-only package is for those who want to take the hand-off and write desired indicators, paintbars, strategies, on their own.  For a more complete ADE starting point that also includes this function, see ModHA Indicator for ADE .

What It Costs

$150 gets you this useful and educational example of ADE function programming.

How You Get It

This package will be emailed to you after your PayPal payment is processed.  Please be aware of the caveats before you order. 

 

Copyright 2003 - 2009  Steve Johns,  all rights reserved.