Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
talib.TANH
Calculates the hyperbolic tangent of each element (Vector Trigonometric Tanh).
talib.TANH(inReal)Examples
Compute the hyperbolic tangent of a few numbers.
javascript
function main() {
var data = [-1, 0, 1]
var ret = talib.TANH(data)
// Output: about [-0.7616, 0, 0.7616]
Log(ret)
}
python
import talib
import numpy as np
def main():
data = [-1.0, 0, 1.0]
ret = talib.TANH(np.array(data))
# Output: about [-0.7616, 0, 0.7616]
Log(ret)Returns
| Type | Description |
numeric array | Results, the same length as the input. |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | K-line array (close prices are used) or numeric array; in Python, pass a numeric array such as |
See Also
Remarks
TA-Lib equivalent: TANH(Records[Close]) = Array(outReal).