Vector Hyperbolic Cosine

Technical Analysis Indicator: cosh

Fork me on GitHub

Function Prototype

/* Vector Hyperbolic Cosine */
/* Type: simple */
/* Input arrays: 1    Options: 0    Output arrays: 1 */
/* Inputs: real */
/* Options: none */
/* Outputs: cosh */
int ti_cosh_start(TI_REAL const *options);
int ti_cosh(int size,
      TI_REAL const *const *inputs,
      TI_REAL const *options,
      TI_REAL *const *outputs);

Description

This documentation is still a work in progress. It has omissions, and it probably has errors too. If you see any issues, or have any general feedback, please get in touch.

Vector Hyperbolic Cosine calculates the Trigonometric hyperbolic cosine of each element in the input array.

$$cosh_{t} = \cosh{input_{t}}$$

This is sometimes useful as a building block to more complex functions.

See Also

References

Example Usage

Calling From C

/* Example usage of Vector Hyperbolic Cosine */
/* Assuming that 'input' is a pre-loaded array of size 'in_size'. */
TI_REAL *inputs[] = {input};
TI_REAL options[] = {}; /* No options */
TI_REAL *outputs[1]; /* cosh */

/* Determine how large the output size is for our options. */
const int out_size = in_size - ti_cosh_start(options);

/* Allocate memory for output. */
outputs[0] = malloc(sizeof(TI_REAL) * out_size); assert(outputs[0] != 0); /* cosh */

/* Run the actual calculation. */
const int ret = ti_cosh(in_size, inputs, options, outputs);
assert(ret == TI_OKAY);

Calling From Lua (with Tulip Chart bindings)

-- Example usage of Vector Hyperbolic Cosine
cosh = ti.cosh(input)

Example Calculation

dateinputcosh
2005-11-010.201.02
2005-11-020.301.05
2005-11-030.401.08
2005-11-040.301.05
2005-11-070.501.13
2005-11-080.701.26
2005-11-090.751.30
2005-11-100.901.43
2005-11-110.901.43
2005-11-141.001.54
2005-11-151.001.54
2005-11-160.201.02
2005-11-170.101.01
2005-11-18-0.101.01
2005-11-21-0.501.13

Chart

 

Other Indicators

Previous indicator: Vector Cosine

Next indicator: Crossany

Random indicator: Absolute Price Oscillator