Indicator · Pine Script v6 · Own pane

LunarTick ADX

by lunarticktrading· code credited to gambcl

LunarTick ADX calculates the Average Directional Index (ADX) along with positive (+DI) and negative (-DI) directional indicators in a separate pane.

View on GitHub

GitHub stars7on the repository
Pine versionv6current
Lines of code72
Settings5inputs
LicenceNone statedfile: MPL-2.0
Last update2 weeks ago10 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

72 lines of Pine Script v6 from LunarTick ADX.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

LunarTick ADX.txt
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © gambcl

//@version=6
indicator("LunarTick ADX", overlay = false)

////////////////////////////////////////////////////////////////////////////////////////////////////
// Version History
////////////////////////////////////////////////////////////////////////////////////////////////////
// v1.0.0
// - Initial release
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
// Constants
////////////////////////////////////////////////////////////////////////////////////////////////////

var DISPLAY_GROUP = "DISPLAY"
var DEVELOPER_GROUP = "DEVELOPER"


////////////////////////////////////////////////////////////////////////////////////////////////////
// Enums
////////////////////////////////////////////////////////////////////////////////////////////////////

enum VersionEnum
    version = "v1.0.0"
    

////////////////////////////////////////////////////////////////////////////////////////////////////
// Inputs
////////////////////////////////////////////////////////////////////////////////////////////////////

i_adx_smoothing = input.int(14, "ADX Smoothing", minval = 1)
i_di_length = input.int(14, "DI Length", minval = 1)
i_threshold = input.float(20.0, "Threshold", minval = 0.0, step = 0.1)

// Display
i_show_di_crossovers = input.bool(true, "Show DI Crossovers", group = DISPLAY_GROUP)

// Developer
VersionEnum i_version = input.enum(VersionEnum.version, "Version", display = display.none, group = DEVELOPER_GROUP)


////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculations
////////////////////////////////////////////////////////////////////////////////////////////////////

[diplus, diminus, adx] = ta.dmi(i_di_length, i_adx_smoothing)

bullish_di_cross = ta.crossover(diplus, diminus)
bearish_di_cross = ta.crossover(diminus, diplus)


////////////////////////////////////////////////////////////////////////////////////////////////////
// Plots
////////////////////////////////////////////////////////////////////////////////////////////////////

plotshape(bullish_di_cross, "Bullish DI Crossover", shape.xcross, location.belowbar, color.green, size = size.tiny, force_overlay = true, display = i_show_di_crossovers ? display.pane : display.none)
plotshape(bearish_di_cross, "Bearish DI Crossover", shape.xcross, location.abovebar, color.red, size = size.tiny, force_overlay = true, display = i_show_di_crossovers ? display.pane : display.none)

plot(adx, "ADX", color.blue, 1)
plot(diplus, "+DI", color.green, 1)
plot(diminus, "-DI", color.red, 1)
plot(i_threshold, "Threshold", color.gray, 1, display = display.pane)

bullish_cond = diplus > diminus and diplus > i_threshold
bearish_cond = diminus > diplus and diminus > i_threshold

bg_color = bullish_cond ? color.new(color.green, 90) : (bearish_cond ? color.new(color.red, 90) : na)
bgcolor(bg_color)

Overview

LunarTick ADX identifies trend direction by tracking crossovers between +DI and -DI, plotting crossover markers directly on the main price chart. The background highlights bullish or bearish conditions when the dominant directional line exceeds a configurable threshold level. Users can customize the ADX smoothing, DI period, and threshold value. The indicator does not generate automated trade orders, and signals update with the live bar.

Details

Published by

lunarticktrading on GitHub

Code credit

gambcl, as written in the script's header

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Trend, Oscillators & momentum

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
ADX Smoothingint14i_adx_smoothing
DI Lengthint14i_di_length
Thresholdfloat20.0i_threshold
Show DI Crossoversbooltruei_show_di_crossovers
VersionenumVersionEnum.versioni_version
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Schaff Trend Cycle

by everget
948 stars

This indicator plots the Schaff Trend Cycle in a separate pane. It subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and

Indicator v4 Oscillators & momentumTrend
Updated 10 days ago · GPL-3.0 GitHub repository of Schaff Trend Cycle

Beep Boop

by magic8bot
409 stars

This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome

Indicator v4 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of Beep Boop

[RS]Standardized Trend Map

by ricardosantos79
261 stars

Standardized Trend Map calculates series momentum relative to active price range across 40 distinct lookback periods ranging from 2 to 80 bars on an exponential moving average source. Each standardized calculation rounds to an integer values of -1, 0, or 1 to

Indicator v4 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of [RS]Standardized Trend Map

ADX Histogram

by harryguiacorn
219 stars

This indicator calculates and displays the Average Directional Index (ADX) as a column histogram in a separate pane. It evaluates market trend strength by calculating directional movement metrics based on specified smoothing and DI length inputs. When the ADX

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Histogram
218 stars

Multi-Timeframe Analysis Suite calculates trend direction and momentum conditions across five user-selected timeframes using moving averages, RSI, and Stochastic oscillators. It evaluates moving average slope and oscillator levels to compute trend alignment, m

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of Multi-Timeframe Analysis Suite

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers