type
status
date
slug
summary
AI summary
AI translation
tags
category
password
icon
💡
By registering an account on OKX Crypto Exchange using the invitation link from blackcat1402, you can enjoy several benefits. These include a 10% rebate on spot contract trades, a 20% discount on fees, permanent access to blackcat1402 Membership and Advanced Indicators, free internal testing of the Advanced Trading System, and exclusive services such as member technical indicator customization and development.
💡
OKX Crypto Exchange blackcat1402 invitation registration link:
Today, I'm going to show you a technical analysis tool called the "Directional Movement Indicator" (DMI). This indicator was introduced by the technical analysis master J. Welles Wilder in 1978. Don't underestimate it, because just like the Relative Strength Index (RSI) and Average True Range (ATR), it is also a masterpiece by Wilder!
Firstly, DMI consists of three components, namely the Average Directional Index (ADX), Positive Directional Indicator (+DI), and Negative Directional Indicator (-DI). These three components work together to help traders identify and measure the strength and direction of the market trend. Doesn't it sound like a magical team?
notion image
Now, let's talk about how these buddies work. +DI and -DI are calculated by analyzing the highest and lowest prices in the market. Their main task is to tell you, "Hey, is the market going up or down?" Then, ADX steps in and doesn't care if the market is rising or falling, it only cares about "is this trend stable?" Simply put, ADX is like a focused and dedicated driver, only concerned about the smoothness of the speed.
For the specific calculation method, first, we need to find the highest and lowest prices of each period, then calculate the upward and downward movements. If the upward movement is greater than the downward movement, it is considered a positive direction; otherwise, it is considered a negative direction. Next, we need to smooth out these data using something called Average True Range (ATR), and finally multiply them by 100 to obtain +DI and -DI.
Calculating ADX is even more interesting. It is obtained by calculating the absolute difference between +DI and -DI, then dividing it by their sum, and multiplying it by 100. The larger this value, the more stable the trend. Wilder stated that ADX exceeding 25 indicates a significant market trend, while below 20 means a weak or nonexistent trend. However, each market has its own characteristics, so this value is not fixed.
notion image
Another important use of DMI is to generate trading signals. When the +DI line and -DI line cross, it could be a signal to buy or sell. However, keep in mind that the reliability of this signal depends on the value of ADX. The higher the ADX value, the more reliable the signal. At the same time, setting appropriate stop-loss is crucial.
Although DMI may sound like a panacea, it does have its limitations. Wilder originally designed DMI for currency and commodity markets, which typically have greater volatility and clearer trends than stock markets. Therefore, when using DMI in the stock market, some adjustments may be necessary.
notion image
In summary, DMI is a very powerful tool, but in order to truly master it, continuous learning and practice are necessary. By combining historical analysis and experience, traders can better understand and apply DMI, making it a part of their trading strategies.
This code is an indicator for calculating the Directional Movement Index (DMI). It uses the Pine Script language on the TradingView platform.
First, in the line //@version=5, the script declares the version number as 5.
Next, in the indicator() function, some parameters are set:
  • title="Directional Movement Index": The indicator title is set as "Directional Movement Index".
  • shorttitle="DMI": The abbreviation title is set as "DMI".
  • format=format.price: The price formatting is set to the default value.
  • precision=4: The decimal point precision is set to 4.
  • timeframe="": The timeframe is set as an empty string, indicating the current chart's timeframe.
  • timeframe_gaps=true: Allows displaying gaps between timeframes on the chart.
Then, two variables are defined:
  • lensig = input.int(14, title="ADX Smoothing", minval=1, maxval=50): Defines an integer input variable lensig with a default value of 14, a minimum value of 1, and a maximum value of 50. This variable controls the smoothing of ADX.
  • len = input.int(14, minval=1, title="DI Length"): Defines another integer input variable len with a default value of 14 and a minimum value of 1. This variable controls the length of DI.
Next, the specific calculations are performed:
  • First, the ta.change() function is called to calculate the price changes for up and down movements, which are assigned to the variables up and down, respectively.
  • Then, the variables plusDM and minusDM are calculated based on certain conditions. If up is greater than down and greater than 0, up is assigned to plusDM. If down is greater than up and greater than 0, down is assigned to minusDM. Otherwise, plusDM and minusDM are both set as "na" (not available).
  • Next, the ta.rma() function is used to calculate three variables: trur, plus, and minus:
    • trur represents the true range, which is calculated using the ta.tr function.
    • plus represents the +DI indicator and is calculated based on plusDM, len, and trur.
    • minus represents the -DI indicator and is calculated based on minusDM, len, and trur.
Finally, the script plots the ADX, +DI, and -DI lines on the chart and sets their colors.
掌握市场风向标:DMI指标全解析去趋势价格震荡指标(DPO):一种神奇的时间机器
blackcat1402
blackcat1402
This cat is an esteemed coding influencer on TradingView, commanding an audience of over 8,000 followers. This cat is proficient in developing quantitative trading algorithms across a diverse range of programming languages, a skill that has garnered widespread acclaim. Consistently, this cat shares invaluable trading strategies and coding insights. Regardless of whether you are a novice or a veteran in the field, you can derive an abundance of valuable information and inspiration from this blog.
Announcement
type
status
date
slug
summary
AI summary
AI translation
tags
category
password
icon
🎉Webhook Signal Bots for Crypto are Coming!🎉
--- Stay Tuned ---
👏From TradingView to OKX, Binance and Bybit Exchange Directly!👏