Adx
ADX
Bases: IndicatorBase
Average Directional Index (ADX) indicator.
Computes both +DI and -DI internally, derives DX, then Wilder-smooths DX to produce the ADX. One scalar value in the range 0-100 is produced per incoming bar and stored per symbol.
The rolling state is maintained independently for each symbol.
Until enough bars are received, 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/adx.py
__init__(period=14, max_history=100, plot_at=1, plot_as=models.PlotStyle.LINE, plot_color=models.PlotColor.BLACK)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
int
|
Lookback period for the ADX calculation. |
14
|
max_history
|
int
|
Maximum number of computed indicator values retained per symbol. |
100
|
plot_at
|
int
|
Opaque plotting identifier forwarded to the charting backend. |
1
|
plot_as
|
PlotStyle
|
Visual style used to render the indicator. |
LINE
|
plot_color
|
PlotColor
|
Color used to render the indicator. |
BLACK
|
Source code in src/onesecondtrader/indicators/wilders/adx.py
_compute_indicator(incoming_bar)
Compute the ADX 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
|
ADX value (0-100), or |
Source code in src/onesecondtrader/indicators/wilders/adx.py
88 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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |