There is one special initialisation parameter, the
The
| 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}, … ]);