Plus Di
PlusDI
Bases: IndicatorBase
Positive Directional Indicator (+DI).
Computes +DI using Wilder's smoothing method. 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 to compute the initial smoothed values,
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/plus_di.py
__init__(period=14, max_history=100, plot_at=1, plot_as=models.PlotStyle.LINE, plot_color=models.PlotColor.GREEN)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
int
|
Lookback period for the +DI 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. |
GREEN
|
Source code in src/onesecondtrader/indicators/wilders/plus_di.py
_compute_indicator(incoming_bar)
Compute the +DI 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
|
+DI value (0-100), or |