talib.SAR

The talib.SAR() function is used to calculate the Parabolic SAR (Stop and Reverse) indicator.

The talib.SAR() function returns a one-dimensional array. array

talib.SAR(inPriceHL) talib.SAR(inPriceHL, optInAcceleration) talib.SAR(inPriceHL, optInAcceleration, optInMaximum)

The inPriceHL parameter is used to specify the K-line data. inPriceHL true {@struct/Record Record} structure array The optInAcceleration parameter is used to set the Acceleration Factor, with a default value of 0.02. optInAcceleration false number The optInMaximum parameter is used to set the AF Maximum (Acceleration Factor Maximum), with a default value of 0.2. optInMaximum false number


function main() {
    var records = exchange.GetRecords()
    var ret = talib.SAR(records)
    Log(ret)
}

import talib
def main():
    records = exchange.GetRecords()
    ret = talib.SAR(records.High, records.Low)
    Log(ret)

void main() {
    auto records = exchange.GetRecords();
    auto ret = talib.SAR(records);
    Log(ret);
}

The SAR() function is described in the talib library documentation as: SAR(Records[High,Low],Acceleration Factor = 0.02,AF Maximum = 0.2) = Array(outReal)