SZSE:002576   JIANGSU TONGDA POW
**什么是超级趋势**:
超级趋势(Supertrend)是类似于移动平均线的趋势跟踪指标。 它绘制在价格主图上,当前趋势可以简单地通过其相对于价格的位置来确定。 这是一个非常简单的指标,仅在两个参数(周期Period和乘数Multiplier)的帮助下构建。因为在构建 Supertrend 指标策略时,平均真实范围 (ATR) 的默认参数为 10,乘数为 3。 平均真实范围 (ATR) 在“超级趋势”中起着关键作用,因为该指标使用 ATR 来计算其价值,并表明价格波动的程度。


**我的超级趋势X的初衷与结果**:
超级趋势最大的问题就是折衷稳定性和灵敏度的问题。或者说超级趋势的优点是能非常明朗的看趋势,但是其代价是响应比较迟滞。针对这个问题,有很多的方法改进,我也学了和做了很多尝试,都不能满足我的要求。于是,大约在1年多前,我自己开发了一个超级趋势,命名为X,就是为了减少迟滞效应。当时,我记得对比了很多超级趋势版本择优选出的。但是这两天趁着春节拿出来再改进,发现居然并没有比TradingView官方的超级趋势算法优越。因为有些时候的确可以相应的更加及时,但是有些时候却和官方的算法一致。于是,我将这个指标闭源发布在TradingView社区,

指标名称: L3 SupertrendX MTF
指标地址:
它的特点是支持多周期显示,并且用我经典的趋势强度渐变色标识趋势强度以供预判反转。上升趋势从弱到强依次渐变色为:蓝、绿、黄、红、紫。


**TradingView 官方超级趋势算法**:
```pine
//@version=5
indicator("Supertrend TradingView", overlay=true, timeframe="", timeframe_gaps=true)

// The same on Pine Script™
pine_supertrend(factor, atrPeriod) =>
src = hl2
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand)
prevUpperBand = nz(upperBand)

lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if na(atr)
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand



atrPeriod = input(10, "ATR Length")
factor = input.float(3.0, "Factor", step = 0.01)

// = ta.supertrend(factor, atrPeriod)
= pine_supertrend(factor, atrPeriod)

bodyMiddle = plot((open + close) / 2, display=display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style=plot.style_linebr)
downTrend = plot(direction < 0? na : supertrend, "Down Trend", color = color.red, style=plot.style_linebr)

fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps=false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps=false)
```
为了对比官方超级趋势(红绿细线)和我的版本,我贴了如下图供各位参考:

BTCUSDT行情来自TradingView

AXSUSDT行情来自TradingView

黄金行情来自TradingView

通达动力行情来自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
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.