| title | Parabolic SAR |
|---|---|
| permalink | /indicators/ParabolicSar/ |
| type | stop-and-reverse |
| layout | indicator |
get_parabolic_sar(quotes, acceleration_step=0.02, max_acceleration_factor=0.2)
get_parabolic_sar(quotes, acceleration_step, max_acceleration_factor, initial_factor)
| name | type | notes |
|---|---|---|
quotes |
Iterable[Quote] | Iterable of the Quote class or its sub-class. • See here for usage with pandas.DataFrame |
acceleration_step |
float, default 0.02 | Incremental step size for the Acceleration Factor. Must be greater than 0. |
max_acceleration_factor |
float, default 0.2 | Maximum factor limit. Must be greater than acceleration_step. |
initial_factor |
float | Initial Acceleration Factor. Must be greater than 0 and not larger than max_acceleration_factor. Default is acceleration_step. |
You must have at least two historical quotes to cover the warmup periods; however, we recommend at least 100 data points. Initial Parabolic SAR values prior to the first reversal are not accurate and are excluded from the results. Therefore, provide sufficient quotes to capture prior trend reversals, before your intended usage period.
quotes is an Iterable[Quote] collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.
ParabolicSARResults[ParabolicSARResult]- This method returns a time series of all available indicator values for the
quotesprovided. ParabolicSARResultsis just a list ofParabolicSARResult.- It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first trend will have
Nonevalues since it is not accurate and based on an initial guess.
| name | type | notes |
|---|---|---|
date |
datetime | Date |
sar |
float, Optional | Stop and Reverse value |
is_reversal |
bool, Optional | Indicates a trend reversal |
See Utilities and Helpers for more information.
from stock_indicators import indicators
# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")
# calculate ParabolicSar(0.02,0.2)
results = indicators.get_parabolic_sar(quotes, 0.02, 0.2)Created by J. Welles Wilder, Parabolic SAR (stop and reverse) is a price-time based indicator used to determine trend direction and reversals. [Discuss] 💬
