//@version=5
indicator("ADX and DI Bands", overlay=true, shorttitle="ADX")
// --------------------
// INPUT PARAMETERS
// --------------------
// ADX and DI Parameters
adxLength = input.int(14, title='ADX Length')
adxSmoothing = input.int(14, title='ADX Smoothing Length') // Added smoothing
parameter
diColorUp = input.color(color.green, title='DI+ Color')
diColorDown = input.color(color.red, title='DI- Color')
adxColor = input.color(color.blue, title='ADX Color')
// ADX and DI Calculation
[diPlus, diMinus, adx] = ta.dmi(adxLength, adxSmoothing) // Updated with
adxSmoothing parameter
plot(diPlus, color=diColorUp, title='DI+')
plot(diMinus, color=diColorDown, title='DI-')
plot(adx, color=adxColor, title='ADX')
// Fill ADX and DI Bands
fill(plot(diPlus, color=diColorUp, title='DI+'), plot(diMinus, color=diColorDown,
title='DI-'), color=diPlus > diMinus ? color.new(diColorUp, 90) :
color.new(diColorDown, 90), title='DI Bands')