Skip to content

Parabolic SAR

Parabolic SAR is used to identify potential reversal points in the market.

Method

tm.ta.sar(source_high, source_low, acceleration, maximum)

Inputs

ParameterArgument typeDescriptionDefault Value
source_highpd.SeriesHigh prices series-
source_lowpd.SeriesLow prices series-
accelerationfloatAcceleration factor for the indicator0
maximumfloatMaximum value for the indicator0

Outputs

OutputType
sarnp.ndarray

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Parabolic SAR
sar = tm.ta.sar(data.high, data.low, acceleration=0, maximum=0)
# Get the last value and print
last_value = sar.iloc[-1]
tm.log(f"Last value of Parabolic SAR is {last_value}")
# Plot the values of sar
tm.plot(sar, title="Parabolic SAR", overlay=False)