ADX指标详解

无论你是交易股票、期货、外汇还是加密货币,你一定经常会听到有人谈论趋势,但问题是,趋势到底有多强?有没有一个指标能够对趋势的强弱进行量化?答案是有的,它就是我们今天要介绍的ADX指标(Average Directional Index)。简单来说,ADX并不是告诉你市场在上涨还是下跌,而是告诉你当前的趋势到底有多强劲。就比如你在爬一座山,ADX就是那个告诉你山坡有多陡的工具,而不是告诉你山在什么方向。如果你想知道当前市场的趋势强弱度,无论是牛市还是熊市,ADX都能帮你判断市场是否处在强劲的趋势之中。

说到ADX,就不得不提它的发明者Welles Wilder。这位大牛可是技术分析领域的传奇人物,大名鼎鼎的RSI指标也是这哥们发明的。他在1978年推出了ADX,最初的目标是帮助交易者更好地判断市场趋势的强度。Wilder的初衷非常简单:给市场一个明确的信号,告诉大家什么时候该进场,什么时候该观望。

其实,ADX并不是一个单一的指标,它是DMI系统的一部分。DMI(Directional Movement Index)系统里有两个核心,+DI和-DI,分别代表着市场的上升力量和下降力量。而ADX的作用就是把这两个指标的力量整合起来,给出一个总的趋势强度的数值。ADX可以帮助你更好地理解市场的趋势强度,而不是仅仅依赖价格的涨跌来做判断。

ADX的计算方法

和其他技术指标一样,要想彻底了解它,最好是搞清楚它们是如何计算的。要理解ADX的计算过程,首先需要了解它的基本组成部分,也就是+DI和-DI

+DI和-DI

+DI(正向动量)和-DI(负向动量)实际上是用来衡量市场在两个不同方向上的动量。计算它们的方法是比较今天和昨天的最高价和最低价,看哪个方向的变化更大。具体来说:

  • 如果今天的最高价比昨天的最高价高出很多,那么就认为市场有了更强的上升动量,这就是+DI。
  • 相反的,如果今天的最低价格比昨天的最低价低,则代表市场的下降趋势更强,这就是-DI。

计算公式听上去可能有点复杂,但本质上就是看看市场是更倾向于上升还是下降。

计算DX

接下来,我们把+DI和-DI这两个指标结合起来,得到DX(Directional Index)。DX的计算方法是将+DI和-DI的差值取绝对值,然后除以它们的总和,最后乘以100。这个DX值就是市场方向的变化幅度,有了它,我们就能进一步计算ADX。

平滑处理得到ADX

不过,单靠DX还不够,因为市场每天的波动性会导致DX值上下起伏,这时候我们就需要进行平滑处理。这就像把一条崎岖的小路铺平,使其更容易走。我们采用的方法叫做“指数平滑”,这个过程类似于计算移动平均值。通过这个步骤,DX值变得更平滑、更稳定,最终就得到了我们所说的ADX。

实际计算案例

为了让这个过程更加清晰,我们来举个例子吧。假设某只股票在一周内的最高价和最低价如下:

  • 周一:最高价100,最低价95
  • 周二:最高价102,最低价96
  • 周三:最高价103,最低价97
  • 周四:最高价101,最低价95
  • 周五:最高价104,最低价99

1. 首先计算每天的正负向动量

周一到周二

+DM = 102 – 100 = 2

-DM = 96 – 95 = 1

周二到周三

+DM = 103 – 102 = 1

-DM = 97 – 96 = 1

周三到周四

+DM = 101 – 103 = 0(不计算负值)

-DM = 97 – 95 = 0

周四到周五

+DM = 104 – 101 = 3

-DM = 99 – 95 = 0

2. 计算+DI和-DI

+DI 和 -DI 是将 +DM 和 -DM 归一化后得出的,通常用以下公式计算:

+DI=+DMTrueRange×100+DI=+DMTrueRange×100

-DI=-DMTrueRange×100-DI=-DMTrueRange×100

接下来计算我们需要计算真实区间,即所谓的True Range。它的计算方法是选取下面三个值中的最大值:

  • 当天的最低价与前一天的收盘价的差
  • 当天的最高价与最低价的差
  • 当天的最高价与前一天的收盘价的差

注意是要取绝对值。

比如周二的真实区间可以这样算:

  • 当天最高价与最低价的差:102 – 96 = 6
  • 当天最高价与前一天收盘价的差:102 – 95 = 7
  • 当天最低价与前一天收盘价的差:96 – 95 = 1

在这三个值中,7是最大值,因此周二的真实区间为7。用同样的方法对其他日期进行计算:

周三 = 6

周四 = 8

周五 = 9

接下来就可以计算+DI和-DI:

计算+DI和-DI:

周二

+DI = (2 / 7) × 100 ≈ 28.57

-DI = (1 / 7) × 100 ≈ 14.29

周三

+DI = (1 / 6) × 100 ≈ 16.67

-DI = (1 / 6) × 100 ≈ 16.67

周四

+DI = (0 / 8) × 100 = 0

-DI = (0 / 8) × 100 = 0

周五

+DI = (3 / 9) × 100 ≈ 33.33

-DI = (0 / 9) × 100 = 0

3. 计算DX

计算公式如下:

DX=|+DI – -DI|+DI + -DI×100DX=|+DI – -DI|+DI + -DI×100

计算结果如下:

周二:≈33.33

周三:=0

周四:=0

周五:=100

4. 计算ADX

ADX 是DX的平滑平均值。通常,我们使用14天的ADX周期,但在此例子中,为简化计算,我们将用简单的平均值来计算:

  • 周二 = 33.33(因为是初始值,直接取DX值)
  • 周三 = (33.33 + 0) / 2 = 16.67
  • 周四 = (16.67 + 0) / 2 = 8.34
  • 周五 = (8.34 + 100) / 2 = 54.17

下面是计算的汇总:

日期最高价最低价+DM-DMTrue Range (TR)+DI-DIDXADX
周一100950000000
周二1029621728.5714.2933.3333.33
周三1039711616.6716.67016.67
周四101950080008.34
周五1049930933.33010054.17

指标解读:用ADX判断动量还是反转

正如前文所述,当你看ADX指标时,它实际上是在告诉你目前市场的“劲儿”有多大。你可以把它想象成一个音量旋钮,值越大,声音越大,也就是趋势越强。让我们来看看不同的ADX值究竟代表了什么:

  • ADX < 20:当ADX值低于20时,市场的趋势几乎可以忽略不计。这通常意味着市场处于震荡状态,价格波动幅度小,方向不明确。交易者在这个时候可能会发现很难找到明确的买入或卖出机会,因为市场缺乏明显的趋势。
  • ADX 20-40:当ADX值在20到40之间时,说明市场有一定的趋势,但并不算强劲。这时的趋势强度属于中等水平,价格开始表现出某种方向性,但力量还不够大。对于交易者来说,这个区间的ADX可能意味着机会正在酝酿,市场正在逐渐走出震荡区间。
  • ADX 40-60:ADX值达到40到60时,市场已经进入了强趋势区间。这意味着当前的趋势具有很强的持续性,无论是上涨还是下跌,市场都在明确的方向上发力。这个时候,交易者通常会更积极地跟随趋势操作,因为市场的动力非常强。
  • ADX > 60:如果ADX值超过60,那么我们可以说市场的趋势非常强烈。这样的趋势通常意味着市场处于极端的单边行情中,价格快速向某一方向推进。这种情况下,交易者需要格外注意,因为虽然趋势很强,但市场可能也会随时出现大幅回调。

需要注意,除了判断趋势的强弱,ADX的变化本身也能提供一些重要的市场信号。

  • ADX上升趋势:当ADX值逐步上升时,无论它当前的绝对值是多少,都意味着市场的趋势正在加强。上升的ADX值告诉你,市场的方向越来越明确,无论是上涨还是下跌,价格走势变得更有力度。因此,当你看到ADX从低位开始攀升,这可能是一个信号,表明市场将迎来更明显的趋势,值得关注并寻找交易机会。
  • ADX下降趋势:相反,当ADX值开始下降时,这意味着市场的趋势正在减弱。即使当前的ADX值还处于较高水平,它的下降趋势预示着市场动力的衰退,趋势可能会逐渐进入震荡或者反转。这种情况下,交易者需要谨慎对待现有的持仓,并考虑可能的趋势反转或盘整。

使用ADX指标时该注意什么

虽然ADX指标在衡量趋势强度方面非常有用,但它也有一个明显的局限性,那就是滞后性。由于ADX是基于一系列的平滑处理(也就是上面提到的移动平均)计算得出的,也就是说它其实对市场的反应速度相对是较慢的。换句话说,ADX通常会在趋势已经形成一段时间后才显示出明显的变化。这种滞后性在某些情况下可能会让你错过最佳的进场或退场时机。例如,当市场突然出现快速反转时,ADX可能还显示着强趋势的信号,而实际上市场已经进入了震荡或反转阶段。

另一个需要注意的地方是,仅依赖ADX来进行交易决策可能存在较高的风险。这在我们以前的教程中有反复提及过,任何投资决策都不应该依赖单一的指标,虽然ADX能有效地衡量趋势的强度,但它并不提供趋势方向的信息。因此,单靠ADX来判断市场走势可能会让你在不明朗的市场环境中迷失方向。比如,ADX上升可能意味着动量增强,但它并不能告诉你是上涨动量还是下跌动量在增强。

为了弥补这一缺陷,建议将ADX与其他技术指标结合使用,例如与MACD、RSI、均线等指标配合。这些指标可以提供更多关于趋势方向、市场超买或超卖状态的信息,使交易决策更加全面。例如,MACD可以帮助识别趋势方向,RSI可以提示市场是否过度扩展,而均线可以提供长期趋势的背景信息。通过将ADX与这些指标综合使用,交易者能够更好地捕捉市场动向,减少误判的风险。

代码示例:用Python计算ADX指标

import pandas as pd

def calculate_ADX(data, period=14):

# 计算TR (True Range)

data[‘TR’] = data[[‘High’, ‘Low’, ‘Close’]].apply(lambda x: max(x[‘High’] – x[‘Low’],

abs(x[‘High’] – x[‘Close’].shift(1)),

abs(x[‘Low’] – x[‘Close’].shift(1))), axis=1)

# 计算+DM和-DM

data[‘+DM’] = data[‘High’].diff()

data[‘-DM’] = -data[‘Low’].diff()

data[‘+DM’] = data[‘+DM’].where((data[‘+DM’] > data[‘-DM’]) & (data[‘+DM’] > 0), 0.0)

data[‘-DM’] = data[‘-DM’].where((data[‘-DM’] > data[‘+DM’]) & (data[‘-DM’] > 0), 0.0)

# 计算平滑后的TR, +DM和-DM

data[‘TR_smooth’] = data[‘TR’].rolling(window=period).mean()

data[‘+DM_smooth’] = data[‘+DM’].rolling(window=period).mean()

data[‘-DM_smooth’] = data[‘-DM’].rolling(window=period).mean()

# 计算+DI和-DI

data[‘+DI’] = 100 * (data[‘+DM_smooth’] / data[‘TR_smooth’])

data[‘-DI’] = 100 * (data[‘-DM_smooth’] / data[‘TR_smooth’])

# 计算DX

data[‘DX’] = 100 * (abs(data[‘+DI’] – data[‘-DI’]) / (data[‘+DI’] + data[‘-DI’]))

# 计算ADX

data[‘ADX’] = data[‘DX’].rolling(window=period).mean()

return data[[‘+DI’, ‘-DI’, ‘ADX’]]

# 假设你有一个DataFrame ‘df’,其中包含 ‘Date’, ‘High’, ‘Low’, ‘Close’ 列

# df = pd.read_csv(‘your_market_data.csv’)

# 计算ADX

adx_data = calculate_ADX(df)

# 查看结果

print(adx_data.tail())

所有评论(1)

  1. Andarine provides an extra increase to efficiency and will increase
    bone mineral density, so that you scale back damage danger.
    Stenabolic, with its very brief half-life, should be taken up to three times
    every day to maintain its results. You can run this stack
    for up to 12 weeks, but don’t discount even quick cycles of just four weeks with the power to ship excellent
    results. This stack must be an 8-week cycle; ideally, you’ll increase your dose as you go.
    Start with day by day doses of 10mg of YK-11, 10mg of Ligandrol, and 10mg of S23 for the first 4 weeks.

    Leal Herlitz, MD, examined the kidney operate of 10 bodybuilders who had utilized steroids long-term.

    She identified 90% of them with focal segmental glomerulosclerosis
    (5). Anabolic steroids may be addictive for some users due
    to larger levels of endorphins and enhanced physique composition during a cycle.
    Post-cycle bodybuilders can expertise a degree of muscle atrophy and decreased neurotransmitter levels, which may cause dependence in some bodybuilders.
    One of the most potent bulking combinations we now have encountered is
    the cycle above. It combines three powerful mass-building steroids concurrently, inflicting important results in terms of muscular energy and hypertrophy.
    In phrases of its benefits and adverse effects, we discover Winstrol to be slightly more potent than Anavar.

    If you are after huge muscle mass steroid cycle [https://nordichardware.se/wp-Content/pgs/pct_for_dianabol.html] and energy, then you should go for steroids.
    For those who want to keep their comparatively medium size
    and perform better on the similar time, we recommend taking
    HGH alone. There are many steroids to stack with HGH, but you must be careful
    to not create a bomb from it. If you should use high-energy steroids like Tren,
    the dosage should be very little. Girls who
    use anabolic steroids don’t need to undertake a post-cycle remedy protocol afterward.
    When it involves SARMs, abruptly stopping your
    cycle can doubtlessly trigger some issues like lethargy,
    depression, pimples, and hair loss in some girls.

    Nonetheless, by decreasing water weight via the discount of estrogen,
    we frequently see HDL ldl cholesterol drop further, elevating blood pressure.

    In contrast, injectable steroids aren’t thought-about hepatotoxic, having a extra
    direct passage into the bloodstream (via intramuscular injection)
    and thus bypassing the liver. To further examine
    the steadiness and conformational changes in ligand-bound protein methods, principal component analysis (PCA) and free vitality landscape (FEL) profiles had been generated from MD trajectories.

    A side-by-side comparison of the PCA and FEL profiles for all techniques is introduced in Fig 10.

    In the AR techniques (Figs 10A-10B), each complexes exhibit conformational stability, evidenced by a
    single massive vitality basin close to the minimal variability regions of PC1 and PC2.
    The ERβ-Ecdysterone complicated (Fig 10E) displayed elevated stability, as shown by a smaller power basin centered round 0 (PC1) and -5 (PC2).

    It was by no means supposed to be a fat-burning agent; as an alternative,
    it was researched and used medically for its advantages for respiratory
    circumstances like bronchial asthma. You can get away with stacking orals together – for example, Anadrol and
    Winstrol. I nonetheless largely choose injectables to keep away from hepatotoxicity, Anavar being
    one exception. But should you don’t like injecting, then orals are nonetheless a wonderfully viable option. This
    type of cycle will be centered on fat-burning
    and adding power.
    There aren’t any dosing or administration pointers obtainable for Trenbolone Acetate in a therapeutic capacity.
    Remember, Parabolan (Trenbolone Hexahydrobenzylcarbonate) is the
    only Tren compound ever accredited for human use. For physique associated
    purposes, most men will find a dose of mg every other day to be a fantastic range.

    Deficiencies in zinc and magnesium have been linked to
    lower ranges of testosterone and growth hormone. One research,
    published in 1996 in the scientific journal Diet, found that zinc levels within the blood were positively correlated with testosterone ranges
    (1). The top-performing pure alternatives to steroids for
    people who are wanting to construct muscle,
    get stronger, and perform higher. They combine vegetation and natural extracts which would possibly be thought to spice up testosterone,
    enhance human growth hormone, and speed up muscle restore and synthesis.
    When most people consider steroids, they’re thinking of placing
    on muscle. But for many males, boosting the extent
    of hormones like testosterone and HGH is the means by which they hope to restore their
    intercourse drive, libido, virility, and power.
    In our sincere opinion, this makes using the substance not well price the risk – regardless of
    its many benefits. This way, you presumably can work out tougher and longer and luxuriate in a faster restoration time.
    Bodybuilders everywhere in the world use Winstrol to give them a herculean efficiency in the gym.
    But, in case you are in a cutting part, then you can stack it with
    Anavar, Clenbuterol, and Winstrol. Considered the world of steroids’ action hero,
    Trenbolone packs fairly a punch. Stack Trenbolone with Dianabol, Deca Durabolin, Anadrol, Clenbuterol,
    Winstrol, and Sustanon. The more nitrogen you
    have in your muscle tissue, the more your cells will produce protein.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注