The talib.COS()
function is used to calculate the Vector Trigonometric Cos (cosine function).
The return value of the talib.COS()
function is: a one-dimensional array.
array
talib.COS(inReal)
The inReal
parameter is used to specify the K-line data.
inReal
true
{@struct/Record Record} structure arrays, numeric arrays
function main() {
var data = [-3.14, 0, 3.14]
var ret = talib.COS(data)
Log(ret)
}
import talib
import numpy as np
def main():
data = [-3.14, 0, 3.14]
ret = talib.COS(np.array(data))
Log(ret)
void main() {
std::vector<double> data = {-3.14, 0, 3.14};
auto ret = talib.COS(data);
Log(ret);
}
The COS()
function is described in the talib library documentation as: COS(Records[Close]) = Array(outReal)