什么是Hull’s Moving Average什么叫移动平均线线HMA

什么是Hull’s Moving AverageHMA?
Hull’s Moving Average(HMA) 是一种快速,没有延迟的移动平均线。移动均线是股票技术分析中经常用到的一个重要的技术指标,但是一般的简单移动均线有一个严重的问题,就是:滞后。而HMA是一个相对平滑的紧随价格变动的移动平均线,这使它在交易中得到广泛应用。这个指标的发明者是Allan Hull。
Hull’s Moving Average移动平均线的计算公式:
X=2*WMA(C,ROUND(N/2))-WMA(C,N);
HULLMA=WMA(X,ROUND(SQRT(N)));
其中,N是计算周期数,例如16。
Hull’s Moving Average移动平均线的使用方法:
这个指标的用途与简单移动平均线一样。例如,判断股价趋势方向:HMA上升,股票价格为上升趋势;HMA下降,股价为下降趋势;HMA走平,则没有趋势。
这个指标在本质上是一个均线,它只是一种均线的计算方法,就像SMA, EMA, WMA, FRAMA等一样都是均线,只是计算方法不同而已。可能有人很好奇:为什么有那么多种计算均线的方法?因为,均线在技术分析中实在是太重要了。很多技术指标,交易方法都使用了均线。为什么均线很重要?因为,它反映了趋势,而趋势是技术分析的中心概念。大部分的交易策略,方法,系统等都是在跟踪趋势。所以,对于趋势的发生,发展,结束的分析是技术分析的核心。
下图是通达信股票软件中主图里显示的Hull Moving Average。
原创文章链接:
http://www.danglanglang.com/gupiao/2439
推荐股票书籍
股票博客文章分类
最新股票博客
本博客内容只是提供信息,不可以做为交易依据。HMA移动平均线
& & 作者: WEN
&如果你的策略有用到简单移动平均线,趁週末假日,不妨换种均线测试看看,也许会有不错的效果。
&今天来介绍一个我觉得还蛮好用的均线,大部份的均线都有延迟的问题,也就是当均线由下反转向上翻扬时,实际上价格早已涨了一段,相反当均线由上反转向下时,价格也通常都早就下杀一大段。澳洲的一位Alan
Hull为此开发了一种较贴近实际价格的均线,能够对起起伏伏的价格做平滑化,但是又不会延迟于实际的价格太久远,这个均线就是用他的名字命名叫Hull
Moving Average。原始的HMA是利用Weight Moving
Average加以改良而来以期更贴近实际价格,后来更有人又针对週期的加权方式改善成另一种形式的HMA,这在网路上已经有很多人分享出程式码,所以我也不太确定最原始的出处是哪裡,程式码如下:
Inputs: price(NumericSeries),
length(NumericSimple);&
Vars: halvedLength(0),
sqrRootLength(0);&
if ((ceiling(length / 2) - (length /
2)) &&= 0.5)
halvedLength = ceiling(length /
halvedLength = floor(length /
if ((ceiling(SquareRoot(length)) -
SquareRoot(length)) &&= 0.5)
sqrRootLength =
ceiling(SquareRoot(length))&
sqrRootLength =
floor(SquareRoot(length));&
Value1 = 2 * WAverage(price,
halvedLength);&
Value2 = WAverage(price,
Value3 = WAverage((Value1 - Value2),
sqrRootLength);&
HMA=Value3;
我们先来看看简单移动平均线Length=30时如下图
再来是HMA在Length=30时如下图
&平滑后的均线会较贴近于实际价格,不过一般的读者大概会有个疑问,我们先来看看下面这张简单移动平均在Length=7时的图:
&看起来跟较短週期的均线差不多的样子,但HMA比较起来会比短週期的简单移动平均线更平滑,但是比长週期的简单移动平均线更贴近价格。
&下图的yellow=HMA(Length=30)、cyan=SMA(Length=7)
&下图的yellow=HMA(Length=30)、cyan=SMA(Length=30)
& & &后记:
&不同移动平均线在策略撰写上都有不同的帮助,如果使用简单移动平均线,反应速度较慢,可以用在确认行情或抓到末升段;但是比较敏感的均线则能帮助在行情初期就先进市场卡位,但缺点就是可能会有一些假突破出现。另一种均线的用法则是作为移动停利线,这时候我就不建议只用简单的移动平均线了(因为出场的价格一定很烂。
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。移动平均线 Moving Average - MA_百度百科
清除历史记录关闭
声明:百科词条人人可编辑,词条创建和修改均免费,绝不存在官方及代理商付费代编,请勿上当受骗。
移动平均线 Moving Average - MA
本词条缺少名片图,补充相关内容使词条更完整,还能快速升级,赶紧来吧!
移动平均线( Moving Average -MA) 也叫移动平均价, 是利用统计学上移动平均数的原理,将过去一定天数的证券,期货成交价格加以(加权)平均,连贯所得出的价位线。并根据其排列顺序、乘离、穿越、跌破等现象,来研究判进出场的时点。
解释: 依加权时期的长短可分为3种波动,即长期移动平均线,中期移动平均线与短期移动平均线。短期平均线一般为3日线,6日线,或10日线,15日线;中期平均线一般则为25日线(即日线),30日线或75日线(即季线);长期平均线则包括150日线,200日线或295日线(即年线)。使用移动平均线最简单的方法是观察短期线与长期线交叉的情况,当短期向上穿过长期线时,为买入信号;当短期向下穿过长期线时,为卖出信号。移动平均数的计算有:简单算术平均数,阶梯式加权,线性加权,平均系数加权等数种。一般而言,短期线以加权移动平均较优;长期则以算术平均即可。
长期移动平均线,中期移动平均线与短期移动平均线。短期平均线一般为3日线,6日线,或10日线,15日线;中期平均线一般则为25日线(即日线),30日线或75日线(即季线);长期平均线则包括150日线,200日线或295日线(即年线)。使用移动平均线最简单的方法是观察短期线与长期线交叉的情况,当短期向上穿过长期线时,为买入信号;当短期向下穿过长期线时,为卖出信号。移动平均数的计算有:简单算术平均数,阶梯式加权,线性加权,平均系数加权等数种。一般而言,短期线以加权移动平均较优;长期则以算术平均即可。
清除历史记录关闭Moving Averages
Moving Averages Stuff
Motivated by e-mail from Robert B.
I get this e-mail asking about the Hull Moving Average () and ...
>And you never heard of it before.
Uh ... that's right. In fact, when I googled I discovered lots of moving averages which I'd never heard of, such as:
So I thought we'd talk about moving averages and ...
>Haven't you done that before, like
Yes, yes, but that was before I knew of all these other moving averages.
In fact, the only ones I played with were these, where P1, P2, ... Pn are the last n stock prices
being the most recent):
Simple Moving Average (SMA) = (P1 + P2 + ... + Pn) / K & where K = n.
Weighted Moving Average (WMA) = (P1 + 2 P2 + 3 P3 + ... + n Pn) / K & where K = (1+2+...+n) = n(n+1)/2.
Exponential Moving Average (EMA) = (Pn + α Pn-1 + α2 Pn-2 + α3 Pn-3 + ... ) / K & where K = 1+ α+α2+... = 1/(1-α).
>Whoa! I've never seen that EMA formula before. I always thoguht it was ...
Yeah, it's normally written differently, but I wanted to show that these three have similar prescriptions.
(See the EMA stuff
Indeed, they all look like:
the general Weighted Average = (w1P1 + w2P2 + w3P3 + ...) / K
& where K = the sum of the weights = w1 + w2 + w3 + ...
Note that, if all the Ps are equal to, say, Po, then the moving average equals Po as well ... and that's the way any self-respecting average should behave.
>So which is best?
Define "best".
Here are a few moving averages, attempting to track a series of stock prices that vary in a sinusoidal fashion:
>Stock prices that follow a sine curve? Where did you find a stock like that?
Pay attention!
Notice that the commonly used moving averages (SMA, WMA and EMA) reach their maximum later than the sine curve. That's lag and ...
>But what about that HMA guy. He looks pretty good?
Yeah, and that's what we want to talk about. Indeed ...
>And what's that 6 in HMA(6) and I see something called MMA(36) and ... ?
Hull Moving Average
We start by calculating the 16-day Weighted Moving Average (WMA) like so:
[1] & & & WMA(16) =
(P1 + 2 P2 + 3 P3 + ... + 16 Pn) / K with K = 1+2+...+16 = 136.
Though it's nice and smoooth, it'll have a lag larger than we'd like:
So we look at the 8-day WMA:
>I like it!
Yes, it follows the price variations quite nicely ... but there's more.
While WMA(8) looks at more recent prices, it still has a lag, so we see how much the WMA has changed when going from 8-day to 16-day.
That difference would look like this:
In a sense, that difference gives some indication of how WMA is changing ... so we add this change to our earlier WMA(8) to give:
[2] & & & MMA(16) =
WMA(8) + [ WMA(8) - WMA(16) ] = 2 WMA(8) - WMA(16).
>MMA? Why call it MMA?
I stutter.
Anyway, MMA(16) would look like this:
>I'll take it!
Patience ... there's more.
Now we introduce the magic transformation and get
... ta-DUM!
>That's Hull?
>But what's the magic ritual?
Having generated a series of MMAs involving the 8-day and 16-day weighted moving averages, we stare intently at this sequence of numbers.
Then we calculate the WMA over the past 4 days.
That gives the Hull Moving Average that we've called HMA(4).
>Huh? 16 days then 8 days then 4 days. Do you toss a coin to see how many ... ?
You pick some number of days, like n = 16.
Then you look at WMA(n) and WMA(n/2) and calculate MMA = 2 WMA(n/2) - WMA(n).
& (In our example, that'd be
2 WMA(8) - WMA(16).
Then you calculate WMA(sqrt(n)) using just the last sqrt(n) numbers from the MMA series.
& (In our example, that'd be calculating a WMA(4), using the MMA series.)
>And for that funny SINE chart? How'd it do?
>So where's the spreadsheet?
I'm still working on it:
It's interesting to see how the various moving averages react to spikes:
>Is HMA really a "weighted" moving average?
Well, let's see:
MMA = 2 WMA(8) - WMA(16) = 2 [ (P1 + 2 P2 + 3 P3 + ... + 8 Pn) / 36]
(P1 + 2 P2 + 3 P3 + ... + 16 Pn) / 136
MMA = [2 (1/36) - (1/136)] [ P1 + 2 P2 + ... + 8 P8]
- (1/136)[9 P9 + 10 P10 + ... + 16 P16]
For sanitary reasons, we'll write this like so:
MMA = [ w1P1 + w2P2 + ... w16P16 ].
Note that all the weights add to 1.
Further, wk = [2 (1/36) - (1/136)] K for K = 1, 2, ... 8
and wk = -(1/136)] K for K = 9, 10, ... 16.
Then, doing the magic square-root ritual (where sqrt(16) = 4), we have (recalling that P16 is the most recent value):
HMA = the 4-day WMA of the above MMAs
( w1P1 + w2P2 + ... w16P16 )
+ 2( w1P0 + w2P1 + ... w16P15 )
+ 3( w1P-1 + w2P0 + ... w16P14 )
+ 4( w1P-2 + w2P-1 + ... w16P13 )
(noting that
1+2+3=4 = 10).
>Huh? P0? P-1? What ...?
The MMA(16) uses the last 16 days, back to the price we're callling P1.
If we calculate the 4-day weighted average of them thar MMAs, we'll be using yesterday's MMA (and that goes back 1 day before P1)
and the day before that, the MMA goes back to 2 days before P1 and the day before that ...
>Okay, so you're calling them prices P0, P-1 etc.etc.
You got it.
>So a 16-day HMA actually uses info which goes back more than 16 days, right?
You got it.
>But there are negative weights for them old prices! Is that legal?
The proof is in the ...
>Yeah, yeah ... the proof is in the pudding. So what does the spreadsheet do?
So far it looks like this: (Click on the picture to download.)
You can choose a SINE series or a RANDOM series of stock prices. For the latter, each time you click a button you get another set of prices.
Then you can choose the number of days: that's our n. (For example, we used n = 16 for our example, above.)
Further, if you choose the SINE series, you can introduce "spikes" and move them along the chart ... like .
Note that we've used n = 16 and n = 36 (in the picture of the spreadsheet) 'cause n/2 and sqrt(n) are both integers.
If you use something like n = 15 then the spreadsheet uses the INTeger part of n/2 and sqrt(n), namely 7 and 3.
>So, is the Hull Moving Average the best?
Define "best".
>What about that Jurik Average?
I know nothing about it. It proprietary and you gotta pay to use it ... however, let's play with moving averages.
Another Moving Average
Suppose that, instead of the Weighted Moving Average (where the weights are proportional to 1, 2, 3 ...),
we use the magic Hull ritual with the Exponential Moving Average.
That is, we consider:
MAg = 2 EMA(n/2) - EMA(n)
Yes, that's Moving Average gimmick or Moving Average generalized or Moving Average grand or ...
>Or Moving Average gummy?
Pay attention!
We pick our favourite number of days, like n = 16, and calculate MAg(n, α, k) = α EMA(n/k) - (1-α)EMA(n).
We can play with α and k and see what we get:
For example, here are a few MAgs (where we're sticking to 16 days but changing the values of α and k):
MAg(16) = 2 EMA(4) - EMA(16)
MAg(16) = 1.5 EMA(5) - 0.5 EMA(16)
Note that when we pick k = 3 we get n/k = 16/3 = 5.333 which we change to plain-and-simple 5.0.
>Why don't you stick with Hull's choices: α = 2 and k = 2?
Good idea. We'd get this:
MAg(16) = 2 EMA(8) - EMA(16)
>Looks like the chart with α = 1.5 and k = 3.
It does, doesn't it?
>Did you goof ... again!
Possibly ...
>So what about that square-root ritual?
I leave that as an exercise ... for you!
Okay, while playing with that MAg thing I find that Hull's k = 2 works quite well ... so we'll stick to that.
However, we often get a pretty nice average when we add just a little piece of the "change": EMA(n/2) - EMA(n).
In fact, we'll add just a fraction β
of that change.
That'd give: MAg(n,β) = EMA(n/2) + β [ EMA(n/2) - EMA(n) ].
That is, we choose β = 0.5 or maybe just β = 0.25 or whatever and use:
MAg(n,β) = (1+β)
EMA(n/2) - β EMA(n)
For example, if we compare our gaggle of moving averages as they track a STEP function, we get this, where we add (for MAg) only β = 1/2 of the change::
>Yeah, but what's the best value of beta?
Define "best":
Note that beta = 1 is the Hull choice ... except we're using EMAs instead of WMAs.
>And you leave out that square-root thing.
Uh, yes ... I forgot that.
Note: The spreadsheet changes from hour to hour. It currently looks like
You pick a stock and click a button and get a year's worth of daily prices.
The you choose either HMA or MAg, changing the number of days and, for MAg, the parameter, and see when you should BUY ro SELL.
>When? Based upon what criteria?
If the moving average is DOWN x% from its maximum over the last 2 days, you BUY. (In the example, x% = 1.0%)
If it's UP y% from its minimum over the last 2 days, you SELL. (In the example, y% = 1.5%)
You can change the values of x and y.
>Is it any good ... these criteria?
I said it was something to play with.
There's this other "smoothing" technique called the .
With the help of Ron McEwan, it's now included in this spreadsheet:
>Is it any good?
Play with it !! You'll notice that there's a parameter you can change in cell M3 ... and BUY and SELL signals.

我要回帖

更多关于 移动平均线是什么 的文章

 

随机推荐