DMI, modified by Yanga
// // @author yanga // // This DMI indicator is revised and modified by Yanga // // This script is released free of charge with no warranty // Please leave a not to the author of this script if it is used // whole or in part // study("DMI Yanga Indicator - @Yanga", shorttitle="DMI_Ya") N = input(14, title="DMI period") M = input(6, title="Moving Average") MTR= sum(max(max(high-low,abs(high-(close[1]))),abs(low-(close[1]))),N) HD = high-(high[1]) LD = (low[1])-low DMP= sum(((HD>0) and (HD>LD) ? HD : 0),N) DMM= sum(((LD>0) and (LD>HD) ? LD : 0),N) PDI= DMP*100/MTR MDI= DMM*100/MTR ADX= sma(abs(MDI-PDI)/(MDI+PDI)*100,M) ADXR=(ADX+(ADX[M]))/2 plot(PDI, color=orange) plot(MDI, color=lime) plot(ADX, color=fuchsia) plot(ADXR,color=black)