Skip to content

Parabolic SAR - Extended

An extended version of Parabolic SAR with additional parameters.

Method

tm.ta.sarext(source_high, source_low, startvalue, offsetonreverse, accelerationinitlong, accelerationlong, accelerationmaxlong, accelerationinitshort, accelerationshort, accelerationmaxshort)

Inputs

ParameterArgument typeDescriptionDefault Value
source_highpd.SeriesHigh prices series-
source_lowpd.SeriesLow prices series-
startvaluefloatStarting value for the indicator0
offsetonreversefloatOffset on reverse for the indicator0
accelerationinitlongfloatInitial long acceleration for the indicator0
accelerationlongfloatLong acceleration for the indicator0
accelerationmaxlongfloatMaximum long acceleration for the indicator0
accelerationinitshortfloatInitial short acceleration for the indicator0
accelerationshortfloatShort acceleration for the indicator0
accelerationmaxshortfloatMaximum short acceleration for the indicator0

Outputs

OutputType
sarextnp.ndarray

Example usage

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