5.2.2.1The member parameter, and derived prices

There is one special initialisation parameter, the member. This is applicable when (a) the calculation is value-based rather than bar-based, and (b) you load candle data into the calculation rather than giving it an array just of close prices, or just of highs. It is not applicable to candle-based calculations, or to value-based calculations where you load in an array of values rather than of candles.

The member tells the value-based calculation which value to use from each candle. It can be any of the following, and defaults to c (close price) if not explicitly set. Note that the candle data which you load into the calculation does not need to include derived properties such as the range or median. The calculation automatically works these out from the open/high/low/close if required:

member

Description

c

Close price

o

Open price

h

High price

l

Low price

range

High minus low

median

Average of high and low

typical

"Typical" price: (high + low + close) / 3

weighted

"Weighed" price: (high + low + close + close) / 4

ohlc4

Average of open, high, low, and close

change

Close minus open

abschange

Absolute value of change; converted from negative to positive where applicable

For example:

// Create an exponential moving average of the high prices of candles

var myEma = new FXB.ta.EMA({period: 20, member: "h"});

// Load candle data into the calculation (rather than an array just of the highs)

myEma.LoadData([{o:1.2342, h: 1.2347, l: 12341, c: 1.2343}, … ]);