The resource loading... loading...

talib.LINEARREG_SLOPE

The talib.LINEARREG_SLOPE() function is used to calculate the Linear Regression Slope.

The return value of the talib.LINEARREG_SLOPE() function is: a one-dimensional array. array

talib.LINEARREG_SLOPE(inReal) talib.LINEARREG_SLOPE(inReal, optInTimePeriod)

The inReal parameter is used to specify the K-line data. inReal true {@struct/Record Record} structure arrays, numeric arrays The optInTimePeriod parameter is used to set the period, the default value is 14. optInTimePeriod false number

function main() {
    var records = exchange.GetRecords()
    var ret = talib.LINEARREG_SLOPE(records)
    Log(ret)
}
import talib
def main():
    records = exchange.GetRecords()
    ret = talib.LINEARREG_SLOPE(records.Close)
    Log(ret)
void main() {
    auto records = exchange.GetRecords();
    auto ret = talib.LINEARREG_SLOPE(records);
    Log(ret);
}

The LINEARREG_SLOPE() function is described in the talib library documentation as: LINEARREG_SLOPE(Records[Close],Time Period = 14) = Array(outReal)

talib.LINEARREG_INTERCEPT talib.STDDEV