Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
talib.SAR
Calculates the Parabolic SAR.
talib.SAR(inPriceHL)
talib.SAR(inPriceHL, optInAcceleration)
talib.SAR(inPriceHL, optInAcceleration, optInMaximum)Examples
Compute the Parabolic SAR from the latest K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.SAR(records)
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.SAR(records.High, records.Low)
Log(ret)Returns
| Type | Description |
numeric array | Indicator values, the same length as the input; the leading values without enough data are |
Arguments
| Name | Type | Required | Description |
inPriceHL |
| Yes | K-line array; the high and low fields are used. In Python, pass |
optInAcceleration | number | No | Acceleration factor. Default |
optInMaximum | number | No | Maximum acceleration factor (AF Maximum). Default |
See Also
Remarks
TA-Lib equivalent: SAR(Records[High,Low],Acceleration Factor = 0.02,AF Maximum = 0.2) = Array(outReal).