Thinkorswim ADX DMI Watchlist 9

Custom Watchlist Column Color Coded Based on ADX/DMI Study

The Trend Detector indicator. The DMI (Directional Movement Index) is used by many traders to Thinkorswim ADX DMI Watchlistidentify the beginning and direction of trends in the price action. For many years, traders have used multiple time frames to identify opportunities to trade in the direction of the trend. In this video we show how to add three custom columns in a watchlist, one for Weekly, one for Daily and one for Hourly. You can set these to whatever time frames you prefer. Each of the custom columns display all three of the DMI plots. How do we do that? You’ll have to watch the video to find out!


Build your watchlist today

After following our step-by-step instructions you will have your own custom watchlist containing many chart’s worth of information. You will be able to see the position of the DI+ and DI- lines as well as the value of the ADX. All available in a single glance. After setting up the watchlist, we’ll conclude with a demonstration of how to read and interpret the output.

Here is the code you will need to set up your watchlist columns:

input length = 14;
input averageType = AverageType.WILDERS;
input threshold = 20;
def hiDiff = high - high[1];
def loDiff = low[1] - low;
def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM = if loDiff > hiDiff and loDiff > 0 then loDiff else 0;
def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
def diPlus = 100 * MovingAverage(averageType, plusDM, length) / ATR;
def diMinus = 100 * MovingAverage(averageType, minusDM, length) / ATR;
def DX = if (diPlus + diMinus > 0) then 100 * AbsValue(diPlus - diMinus) / (diPlus + diMinus) else 0;
# the value of the ADX is shown in the custom column
plot ADX = MovingAverage(averageType, DX, length);
# the colors change based on the postions of various lines to the threshold
# when ADX is below threshold, backgrond is black
# when ADX is above threshold, the background changes based on which di line is on top
# need to have sufficient contrast between color of background and value to ensure it's legible
# try using a white background
# the color of the adx value is green for diPlus > diMinus, otherwise red
ADX.AssignValueColor(if diPlus > diMinus then Color.DARK_GREEN else if diMinus > diPlus then Color.DARK_RED else Color.BLACK);
AssignBackgroundColor(if adx > threshold then Color.WHITE else Color.BLACK);

*Thinkorswim is a chart analysis platform offered by TD

TD Ameritrade provides financial services including the trading of Stocks, Futures, Options and Forex.


Please be sure to share this page with your friends and colleagues. Leaving comments below is the best way to help make the content of this site even better.

Watch the video, Thinkorswim ADX DMI Watchlist below:

__ Support our free content by making a purchase below. Thanks! __

Questions? Comments? Post a review?

9 thoughts on “Thinkorswim ADX DMI Watchlist

  • George

    I copied ADX script to TOS and the ADX Values in the watch list are different from the values in the TOS charts. Generally the values are higher in TOS

      • George

        Weekly, daily, and 4 hour. The 4h seems to be off the most. Values for the AUD/CAD currency pair. Watch list = W-25.13 D-15.21 4H-15.56. TOS chart = W-25.17 D-17.25 4H-38.08. TOS 4H chart isshowing a major trend to the upside

      • George

        You said there may be a problem with the watch list in TOS and I am not sure what to do next. Is there something I need to do, or is there something you could do to modify the code so the watch list works, or is this an internal problem with TOS. If it is a problem with TOS what do I show them and/or say to them to ID the problem?

      • Pete Hahn Post author

        What I am saying, and I thought I explained it pretty clear in that post I just linked…. is that the platform is clearly broken right now. Thinkorswim will need to fix this. I have no idea how many different things may be impacted. But it’s clear from the material I present in that post I linked, that something inside is broken. Something we have no control over.

  • Carmine

    I followed the instrument like you said on the video
    on my watchlist I get the same you have on the video. but on my charts I don’t have the study ADX I missing something

    • Pete Hahn Post author

      The chart study name is DMI. It’s one of the built in studies that come with Thinkorswim. The version I use in the video is a modified version. But the values are identical to the DMI.