//@version=5 //====================================================== // Adapted ADX DI Histogram indicator with Filters // Version 5.2.B // Created by GreenDragon //====================================================== // Tip jar - any help gratefully accepted // ETH 0x3D07FD9253479f76bC19bfDba594ed76C2F9E973 // BTC 3GDbgSvKiHkAeKuS1CMWASSgmSmK6R6Cgs //====================================================== // // Description // ----------- // This is a lower indicator that does not shows below main coin graph // to see ADX and DI as a Histogram. // If you use the Dark theme set it in settings. // 1. ADX Filter allows for the setting of DI Length (default 14) and ADX Threshold (Default 25) // NQ prefers 21, 31 - now using NQ preference as default //===================================================================== indicator('GD-ADX/DI Histogram V5.2.B', shorttitle='GD-ADXDI-Hist V5.2.B', overlay=false) // set main inputs // *************************** General Settings ******************************* ") dark = input.bool(false, title='       Using Dark Theme', group='General Settings') // ******************************** ADX Settings ******************************** ") diLen = input.int(21, title='              DI Length', group='ADX Settings') th = input.int(31, title='              Trend Threshold', group='ADX Settings') src = close noCandles = 2 // ADX and DI - function [diplus, diminus, ADX] = ta.dmi(diLen, diLen) di = th + diplus - diminus // set adx colours cr = color.gray cg = color.gray cr := ADX <= 22 ? color.new(color.green, 80) : ADX <= 34 ? color.new(color.green, 60) : ADX <= 46 ? color.new(color.green, 35) : ADX <= 58 ? color.new(color.green, 5) : ADX <= 70 ? color.new(color.green, 0) : color.new(color.green, 0) cg := ADX <= 22 ? color.new(color.red, 80) : ADX <= 34 ? color.new(color.red, 60) : ADX <= 46 ? color.new(color.red, 35) : ADX <= 58 ? color.new(color.red, 5) : ADX <= 70 ? color.new(color.red, 0) : color.new(color.red, 0) ///////////////////////////////////////////////////// // plot the Threshold horizontal based on dark choice // ADX based on Red/Green darkColour = dark == false ? color.gray : color.white adxRising = ta.rising(ADX, noCandles) adxFalling = ta.falling(ADX, noCandles) diRising = ta.rising(di, noCandles) diFalling = ta.falling(di, noCandles) plotAdxColour = adxRising ? color.green : adxFalling ? color.red : color.gray plotDiColour = diRising ? color.green : diFalling ? color.red : color.gray plot(th, color=darkColour, linewidth=2, title='Threshold') plot(di, style=plot.style_columns, linewidth=6, color=di >= th ? cr : cg, histbase=th, title='DI-Hist') plot(di, style=plot.style_line, linewidth=1, color=plotDiColour, histbase=th, title='DI-Line') plot(ADX, color=plotAdxColour, linewidth=2, title='ADX')