Investment Studio > Expressions > Functions > Indicator > TP

float array[*][2] tp(float array[*][4] dhlc)

Returns a two-column array containing dates (first column) and corresponding Typical Price (TP) values (second column). Given n input rows in dc, n rows are returned.

dhlc is a four-column array containing daily price quotes. Each row is structured as follows:

Column # Content
1 The quote date.
2 The day's high (highest traded price).
3 The day's low (lowest traded price).
4 The day's close (last traded price).

The array is assumed to be time-sorted, with earlier dates preceding later dates.

Automatic type conversion allows the use of date strings as arguments instead of explicit date values.

Interpretation

TP is a simple arithmetic average of each trading day's high, low and close:

    high + low + close
TP  =  ¾¾¾¾¾¾¾¾
    3

Its primary use is as building block in other indicators (e.g. MFM, MFP).

For a real life example, consider Palm (NASD:PALM) from August 1 to October 31, 2001:

The red line shows TP overlayed on price (black and white candlesticks).

Example

Assuming standard US date format settings,

=tp({{"1/1/1990", 100, 90, 98}, {"1/2/1990", 97, 84, 86}})

returns {{32874, 96}, {32875, 89}}. 32874 is the date code for 1/1/1990; 96 = (100 + 90 + 98) / 3 is the TP on that date. 32875 is the date code for 1/2/1990; 89 is the TP on that date.

See also asi, si.