Quicktip 59 | Daily hammer on intraday chart

Quicktip 59 is designed to be applied to intraday charts. It calculates whether the currently forming daily bar (or completed daily bars) is a hammer or inverse hammer pattern in its current state of development (i.e. if you took a snapshot of the daily bar (so far) is it a hammer or inverse hammer pattern?)

See how hammer pattern is defined in this quick tip below.

The quick tip is based on program 54 which is a strategy that uses hammer and inverse hammer patterns in its algorithm. Quick tip 59 uses the OpenD( 0 ), HighD( 0 ), and LowD( 0 ) functions which provide the open, high and low of the current day.

This quick tip also gives an example of the use of the _Quicktip59_FN function. The function returns -1 for an inverse hammer pattern and returns + 1 for a hammer pattern.

Hammer pattern

In this program, the hammer pattern is defined as when the body of the candle is relatively small compared to the wick and occurs above the middle horizontal line shown in the image to the right. A user input: BarPercentage determines the exact position of the middle horizontal line.

Similarly, an inverse hammer pattern is defined as when the body of the candle is relatively small compared to the wick and occurs below the middle horizontal line. For inverse hammer patterns the position of the middle line is measured from the high of the bar.

The formulae for determining the patterns are:

Hammer definition

HiBar = Open > ( ( High – Low ) * BarPercentage / 100 ) + Low and Close > ( ( High – Low ) * BarPercentage / 100 ) + Low;

Inverse hammer definition

LoBar = Open < High – ( ( High – Low ) * BarPercentage / 100 ) and Close < High – ( ( High – Low ) * BarPercentage / 100 );

It would be relatively straightforward to modify this if you required a more stringent definition of a hammer (for example, if the close or open had to be near or at the top of the bar for a hammer pattern).