https://www.tradingview.com/script/IfAfKJGc-Reverse-DMI/ is the idea I am trying to look for. I know a Reverse MACD and Reverse RSI exist on TOS but not for DMI.
Was hoping if someone could reverse this DMI specifically.
#thinkScript 3: Morgan Visual Trend Indicator
declare lower;
input length = 14;
input averageType = AverageType.WILDERS;
def lowerDiff = low[1] - low;
def upperDiff = high - high[1];
def DMminus = if lowerDiff > upperDiff and lowerDiff > 0 then lowerDiff else 0;
def DMPlus = if upperDiff > lowerDiff and upperDiff > 0 then upperDiff else 0;
def AvgTrueRange = MovingAverage(averageType, TrueRange(high, close, low), length);
plot "DI+" = 100 * MovingAverage(averageType, DMplus, length) / AvgTrueRange;
plot "DI-" = 100 * MovingAverage(averageType, DMminus, length) / AvgTrueRange;
def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-") / ("DI+" + "DI-") else 0;
plot ADX = MovingAverage(averageType, DX, length);
"DI+".SetDefaultColor(GetColor(9));
"DI-".SetDefaultColor(GetColor(2));
ADX.SetDefaultColor(GetColor(4));
Was hoping if someone could reverse this DMI specifically.
#thinkScript 3: Morgan Visual Trend Indicator
declare lower;
input length = 14;
input averageType = AverageType.WILDERS;
def lowerDiff = low[1] - low;
def upperDiff = high - high[1];
def DMminus = if lowerDiff > upperDiff and lowerDiff > 0 then lowerDiff else 0;
def DMPlus = if upperDiff > lowerDiff and upperDiff > 0 then upperDiff else 0;
def AvgTrueRange = MovingAverage(averageType, TrueRange(high, close, low), length);
plot "DI+" = 100 * MovingAverage(averageType, DMplus, length) / AvgTrueRange;
plot "DI-" = 100 * MovingAverage(averageType, DMminus, length) / AvgTrueRange;
def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-") / ("DI+" + "DI-") else 0;
plot ADX = MovingAverage(averageType, DX, length);
"DI+".SetDefaultColor(GetColor(9));
"DI-".SetDefaultColor(GetColor(2));
ADX.SetDefaultColor(GetColor(4));