Parabolic Sar
_SARState
dataclass
Per-symbol mutable state for the Parabolic SAR computation.
Source code in src/onesecondtrader/indicators/wilders/parabolic_sar.py
ParabolicSAR
Bases: IndicatorBase
Parabolic Stop and Reverse (SAR) indicator.
Computes the Parabolic SAR as described by J. Welles Wilder Jr. One scalar value is produced per incoming bar and stored per symbol.
The rolling state is maintained independently for each symbol.
Until enough bars are received to initialise, the indicator yields numpy.nan.
name
property
Canonical indicator name.
Returns:
| Type | Description |
|---|---|
str
|
Stable identifier encoding all configuration parameters. |
Source code in src/onesecondtrader/indicators/wilders/parabolic_sar.py
__init__(af_start=0.02, af_step=0.02, af_max=0.2, max_history=100, plot_at=0, plot_as=models.PlotStyle.DOTS, plot_color=models.PlotColor.BLACK)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
af_start
|
float
|
Initial acceleration factor. |
0.02
|
af_step
|
float
|
Acceleration factor increment when a new extreme point is reached. |
0.02
|
af_max
|
float
|
Maximum acceleration factor. |
0.2
|
max_history
|
int
|
Maximum number of computed indicator values retained per symbol. |
100
|
plot_at
|
int
|
Opaque plotting identifier forwarded to the charting backend. |
0
|
plot_as
|
PlotStyle
|
Visual style used to render the indicator. |
DOTS
|
plot_color
|
PlotColor
|
Color used to render the indicator. |
BLACK
|
Source code in src/onesecondtrader/indicators/wilders/parabolic_sar.py
_compute_indicator(incoming_bar)
Compute the Parabolic SAR value for a single received bar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incoming_bar
|
BarReceived
|
Market bar used as input for the computation. |
required |
Returns:
| Type | Description |
|---|---|
float
|
SAR value, or |
Source code in src/onesecondtrader/indicators/wilders/parabolic_sar.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |