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
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source_high | pd.Series | High prices series | - |
source_low | pd.Series | Low prices series | - |
startvalue | float | Starting value for the indicator | 0 |
offsetonreverse | float | Offset on reverse for the indicator | 0 |
accelerationinitlong | float | Initial long acceleration for the indicator | 0 |
accelerationlong | float | Long acceleration for the indicator | 0 |
accelerationmaxlong | float | Maximum long acceleration for the indicator | 0 |
accelerationinitshort | float | Initial short acceleration for the indicator | 0 |
accelerationshort | float | Short acceleration for the indicator | 0 |
accelerationmaxshort | float | Maximum short acceleration for the indicator | 0 |
Outputs
Output | Type |
---|---|
sarext | np.ndarray |
Example usage
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)