blackcat1402

阿隆13算法重合

SZSE:002261   拓维信息
**谁是阿隆**
AROON(阿隆)指标是 1995 年由Tushar Chande发明出的指标。其特点是并不是丝滑曲线,是棱角分明的折线。在技术分析领域中,有一个说法,一个指标使用的人越多,其效力越低。阿隆算是比较简单实用的那个,其建构思想独树一帜,意在测量个股走势中趋势的强度。该指标与一般的趋势跟踪指标不同,不会受到每天涨跌或收盘价微妙差异的影响,是稳定性较好的指标。

AROON 指标由两条线组成,分别为 AROON_UP黄色 及 AROON_DN紫色(为了避免中西方红绿颜色涨跌混淆,我喜欢用我的logo色,黄涨紫跌)。其具体的计算方式为∶
Aroon(上升)=*100 Aroon(下降)=*100

指定一个计算区间(一般为13 天),这个区间内创出收盘最高价的那天到起始日的时间距离作为分子,除以 13 天,即为AROON_UP指标。这一指标表明有多久时间,股价走势在近期最高点之下。AROON_DN 指标的计算方式相同,但将″收盘最高价″换成″收盘最低价″。另一与这两个指标相联系的是AROON Osc,是用AROON_UP减去AROON_DN 得到的指标。

如果一段时间之内,股价没有出现上升,创出13 根K线的一个相对高点,AROON_UP指标就会不断下行。
当 ARRON_UP 指标向下跌破 50 时,表示向上的趋势正在失去动力;
当 ARRON_DN 指标向下跌破50 时,表示向下的趋势正在失去动力;
如果两个指标都在低位,表示股价没有明确的趋势;
如果指标在70 以上,表示趋势十分强烈;
如果在30 以下,表明相反的趋势正在酝酿。
当AROON_UP下行到接近0 线之后,相反的(上升)趋势开始酝酿,随后跌势暂止。


**TradingView官方阿隆算法**

```pine
//@version=5
indicator(title="Aroon", shorttitle="Aroon", overlay=false, format=format.percent, precision=2, timeframe="", timeframe_gaps=true)
length = input.int(13, minval=1)
upper = 100 * (ta.highestbars(high, length) + length)/length
lower = 100 * (ta.lowestbars(low, length) + length)/length
plot(upper, "Aroon Up", color=color.yellow)
plot(lower, "Aroon Down", color= color.fuchsia)

```


**阿隆13算法**

阿隆13算法开源发布在TradingView社区,感兴趣朋友可以到​如下链接获取:


```pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © blackcat1402
//@version=4

study(" L2 Aroon13"," L2 Aroon13", overlay=false, max_bars_back=5000, max_labels_count =500)

xrf(values, length) =>
r_val = float(na)
if length >= 1
for i = 0 to length by 1
if na(r_val) or not na(values)
r_val := values
r_val
r_val

l13 = lowest(low,13)
aroon_dn = (13-iff(xrf(low,1)==l13,1,iff(xrf(low,2)==l13,2,iff(xrf(low,3)==l13,3,iff(xrf(low,4)==l13,4,iff(xrf(low,5)==l13,5,iff(xrf(low,6)==l13,6,iff(xrf(low,7)==l13,7,iff(xrf(low,8)==l13,8,iff(xrf(low,9)==l13,9,iff(xrf(low,10)==l13,10,iff(xrf(low,11)==l13,11,iff(xrf(low,12)==l13,12,iff(xrf(low,13)==l13,13,0))))))))))))))/13*100
h13 = highest(high,13)
aroon_up = (13-iff(xrf(high,1)==h13,1,iff(xrf(high,2)==h13,2,iff(xrf(high,3)==h13,3,iff(xrf(high,4)==h13,4,iff(xrf(high,5)==h13,5,iff(xrf(high,6)==h13,6,iff(xrf(high,7)==h13,7,iff(xrf(high,8)==h13,8,iff(xrf(high,9)==h13,9,iff(xrf(high,10)==h13,10,iff(xrf(high,11)==h13,11,iff(xrf(high,12)==h13,12,iff(xrf(high,13)==h13,13,0))))))))))))))/13*100

plot(aroon_up, "Aroon Up", color=color.yellow, linewidth =2)
plot(aroon_dn, "Aroon Down", color= color.fuchsia, linewidth =2)
```

表面上看这两个阿隆的算法不一样,实际上,这两个指标的效果在length==13的时候是几乎相同的(虽然细节上有些不一样,但是不影响整体使用):

冰糖橙行情来自TradingView

拓维信息1H行情来自TradingView

Avoid losing contact!Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq 防止失联,请立即行动,加入本猫聊天群: discord.com/invite/ZTGpQJq
免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。