blackcat1402

说一种全新的唐奇安通道技术

SSE:000001   SSE Composite Index

在 Stella Osoba 2023 年特刊的文章“使用价格通道”中,她提出了一个想法:为什么许多分析技术都基于价格通道的概念。在她对唐奇安通道的解释中,她解释说它们用于识别趋势,并且最后一个时期的价格不包括在计算中。 我在TradingView网站上开源发布并且采用Pine重写了这个想法。 这个脚本允许用户选择包含最近的时期。 要不包括最近的时间段,请将 IncludeRecentPeriod 输入设置为 false。

说起唐奇安通道, 期货交易员理查德·唐奇安 (Richard Donchian) 创建了唐奇安通道作为趋势指标。 他后来被称为“趋势跟踪之父”。发展至今已经建立了几种基于唐奇安通道的交易方法,但日内交易者可以创建自己的方法,因为该指标是通用的并且可以以不同的方式解释。其中著名的海龟交易法则也只是唐奇安技术的变体。唐奇安通道在一段时间内资产的最高价和最低价之间划出一条线,通常使用K线作为时钟。 K线是图表上的图表区域,显示特定股票的开盘价、最高价、最低价、收盘价和时间范围。它们因其形状而得名。 当指标应用于图表时,线条在当前价格周围形成通道。当日交易时,唐奇安通道对于突出趋势和区间周期非常有用。 如果需要,可以在顶线和底线之间添加第三条线。 上部和下部通道线被平均以形成该中心带。 该指标可用于所有时间范围,包括一分钟和五分钟图表(其中每一或五分钟形成一根K线),并且可用于加密、外汇、股票、期货和期权交易, 可以说通用性比较强。

感兴趣的朋友可以关注我在TradingView上发的帖子,包含源代码,可以在TradingView指标库中搜索: " L1 Stella Osoba Donchian Channels", 直接加载并显示在主图上。 该脚本页面链接为:


这个脚本的源代码如下:

```c

// 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(" L1 Stella Osoba Donchian Channels", overlay=true, max_bars_back=5000, max_labels_count=500)

// TASC AUGUST 2023
// Using Price Channels
// Indicator: Richard Donchian
// Article Author: Stella Osoba

//inputs:
Length = input( 20 )
IncludeRecentPeriod = input( true )
IncludeMiddleLine = input( true )

//variables:
UpperBand = 0.0
lowerBand = 0.0
MiddleLine = 0.0
Displace = ( iff( IncludeRecentPeriod, 0, 1 ) )

UpperBand := highest(high, Length)
lowerBand := lowest(low, Length)
MiddleLine := (UpperBand + lowerBand) * 0.5

plot(UpperBand, "Donchian high", color=color.new(color.green, 20), linewidth = 3)
plot(lowerBand, "Donchian low", color=color.new(color.red, 20), linewidth = 3)
plot(IncludeMiddleLine ? MiddleLine : na, "Donchian Avg", color=color.new(color.yellow, 20), linewidth = 4)

```

两张效果图:

BTCUSDT日线行情来自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.