Skip to Content

ADX Level Line Color

January 15, 2026 by
ADX Level Line Color
Al-Juarismi-Lab

TradingView® Thinkorswim® 

Description of the indicator. 

This indicator belongs to the category of classic or traditional technical analysis indicators that have been customized or improved in some way. It is not a completely new or original code, as it is based on the pre-built functions of PineScript or Thinkorswim.

In this case, the «ADX Level Line Color» refers to the classic ADX indicator, which is constructed based on the unplotted +DI and -DI lines, only that color has been added to the area and the ADX line: when it is above the level, it is painted green, and when it is below the level, it is painted red. The user can also choose the respective colors. 

The code was adapted from ThinkScript to PineScript. 

Explanation of the code.

Block 5-9: We declare that the indicator's graph appears in a rectangle below the main price graph; in PineScript, overlay = false is assumed as given. Additionally, we declare the input variables: the period of the ADX, the type of moving average, and the activation level line, which is traditionally 20.

Block 11-17: We plot the ADX by passing the period and the type of moving average as parameters to the pre-built DMI function. Then, we define the color of the ADX line based on whether it is above, at, or below the activation level line. Next, we plot the activation level line, its color, and style.

Block 19-24: We define the condition (if-else) that must be met for the ADX line to be colored. We also declare the color that will fill the space between the ADX and the activation level line as global colors so that the user can choose the type of fill color. The pre-built function AddCloud will be passed those parameters to logically fill that space.

Block 26-27: Finally, here we define the alerts that the user can activate or deactivate directly in the settings of the current studies on the chart; these alerts meet the condition of upward or downward crossing of the ADX in relation to the activation level line.

PineScript [TradingView®]: 

ThinkScript [Thinkorswim®]:

Share