Moving Averages(2): What Are They?
来源:互联网 发布:java数组转字符串 编辑:程序博客网 时间:2024/06/06 11:44
By Casey Murphy, Senior Analyst ChartAdvisor.com
Among the most popular technical indicators, moving averages are used to gauge the direction of the current trend. Every type of moving average (commonly written in this tutorial as MA) is a mathematical result that is calculated by averaging a number of past data points. Once determined, the resulting average is then plotted onto a chart in order to allow traders to look at smoothed data rather than focusing on the day-to-day price fluctuations that are inherent in all financial markets.
在众多技术分析指标中,滑动平均(MA)常常是一个用来评估当前趋势的指标。
MA的计算有很多种,但每一种都是利用过去的一些数据,经过某一些规则的加工,平均以后生成出来的“平滑”的的数据。(去掉一些价格的波动,就更能体现出趋势。所谓的低通滤波器。)
The simplest form of a moving average, appropriately known as a simple moving average (SMA), is calculated by taking the arithmetic mean of a given set of values. For example, to calculate a basic 10-day moving average you would add up the closing prices from the past 10 days and then divide the result by 10. In Figure 1, the sum of the prices for the past 10 days (110) is divided by the number of days (10) to arrive at the 10-day average. If a trader wishes to see a 50-day average instead, the same type of calculation would be made, but it would include the prices over the past 50 days. The resulting average below (11) takes into account the past 10 data points in order to give traders an idea of how an asset is priced relative to the past 10 days.
Figure 1
最简单的MA,大概就是SMA了。确定窗长,加窗,算术平均。滑动窗口,重复操作。
Perhaps you're wondering why technical traders call this tool a "moving" average and not just a regular mean? The answer is that as new values become available, the oldest data points must be dropped from the set and new data points must come in to replace them. Thus, the data set is constantly "moving" to account for new data as it becomes available. This method of calculation ensures that only the current information is being accounted for. In Figure 2, once the new value of 5 is added to the set, the red box (representing the past 10 data points) moves to the right and the last value of 15 is dropped from the calculation. Because the relatively small value of 5 replaces the high value of 15, you would expect to see the average of the data set decrease, which it does, in this case from 11 to 10.
Figure 2
What Do Moving Averages Look Like?
Once the values of the MA have been calculated, they are plotted onto a chart and then connected to create a moving average line. These curving lines are common on the charts of technical traders, but how they are used can vary drastically (more on this later). As you can see in Figure 3, it is possible to add more than one moving average to any chart by adjusting the number of time periods used in the calculation. These curving lines may seem distracting or confusing at first, but you'll grow accustomed to them as time goes on. The red line is simply the average price over the past 50 days, while the blue line is the average price over the past 100 days.
注意啊,国外的K线和中国的K线,颜色是反的-_-!
我大中华的大A股,绿油油一片,你就完蛋了!
Figure 3
MA的窗口长度,time period。常常听见有人说10日均线,60日均线,就是MA的窗口长度不同。MA10,MA60。
Now that you understand what a moving average is and what it looks like, we'll introduce a different type of moving average and examine how it differs from the previously mentioned simple moving average.
下面,我们将介绍另一种类型的MA(指数MA,EMA),并看看它和上文提到的SMA的区别。
虽然这种最简单的、最常规的MA,即SMA,非常流行,但仍受到一些质疑和批评。
许多人这样抨击SMA,SMA的作用有限,因为过去的数据,只要是在窗口中,它们就等权重。其实似乎应该考虑它们出现的先后顺序。
批评者认为离当前时刻近的数据“应该”比离当前更远的数据更为重要。这似乎是有道理的。因此,我们可以赋予距离当前时刻更近的点更高的权重,而赋予更古老的数据更小的权重。(想一想,这和很多现代频谱仪的造法是一样的。历史数据是一种被逐渐遗忘的过程。)
这也可以认为是对信号加不同类型的窗。(想想信号处理里也会有很多窗函数。SMA就是矩形窗,还有各种窗……)其中,最流行的就是加指数形状的窗函数。
The exponential moving average is a type of moving average thatgives more weight to recent prices in an attempt to make it more responsive to new information. Learning the somewhat complicated equation for calculating an EMA may be unnecessary for many traders, since nearly all charting packages do the calculations for you.However, for you math geeks out there, here is the EMA equation: 可以看看EMA的算法。尽管现在很多软件和工具可以直接计算EMA。
Figure 4
When using the formula to calculate the first point of the EMA, you may notice that there is no value available to use as the previous EMA. This small problem can be solved by starting the calculation with a simple moving average and continuing on with the above formula from there. We have provided you with a sample spreadsheet that includes real-life examples of how to calculate both a simple moving average and an exponential moving average.
这是一个递推的方程。关于初值的话,可以简单地用EMA计算。
Now that you have a better understanding of how the SMA and the EMA are calculated, let's take a look at how these averages differ. By looking at the calculation of the EMA, you will notice that more emphasis is placed on the recent data points, making it a type of weighted average. In Figure 5, the numbers of time periods used in each average is identical (15), but the EMA responds more quickly to the changing prices. Notice how the EMA has a higher value when the price is rising, and falls faster than the SMA when the price is declining. This responsiveness is the main reason why many traders prefer to use the EMA over the SMA.
Figure 5
从上图可以看出EMA和SMA的一些区别。EMA的响应比SMA更为灵敏。对于价格变化的灵敏度更高。这种快速的响应也是投资者更青睐于EMA的主要原因。当然,这不一定永远是好事。比如,交易频率越高,手续费就会更高。
What Do the Different Days Mean?
Moving averages are a totally customizable indicator, which means that the user can freely choose whatever time frame they want when creating the average. The most common time periods used in moving averages are 15, 20, 30, 50, 100 and 200 days. The shorter the time span used to create the average, the more sensitive it will be to price changes. The longer the time span, the less sensitive, or more smoothed out, the average will be. There is no "right" time frame to use when setting up your moving averages. The best way to figure out which one works best for you is to experiment with a number of different time periods until you find one that fits your strategy.窗口长度会给MA的结果带来怎样的影响?窗口长度越长,结果越平滑,平滑能力更强,“噪声”去掉得越干净。
这对应于更小的低通滤波器的截止频率。Low Pass Filter。
对应于奇异值分解中仅保留更少的数值较大的奇异值。Singular Value Decomposition。[U,S,V] = svd(Mat);
对应于小波分析里的更低阶的空间V。f ≈ fj-1 + wj-1 = (fj-2 + wj-2) + wj-1 = ...
当然,没有正确的窗长,只有合适的窗长。最好的窗长,就是那个适合你的交易策略的窗长。
然而,这可能会导致过分依赖参数的问题。
不管怎么说,均线系统还是很霸气的!
- Moving Averages(2): What Are They?
- Templates-what are they?
- Moving Averages(1): Introduction
- Moving Averages(5): Strategies
- Moving Averages(7):Conclusions
- Moving Averages(4): Factors To Consider
- Moving Averages(6):Different Flavors
- Drupal 7 Entities:What are they?
- 特征是什么?---Features: What are they?
- trend anlysis--Moving Averages
- Moving Averages(3): How To Use Them
- Hardening Sprints. What are they? Do you need them?
- Hot reloading and time travel debugging: what are they?
- Codeforces #364(Div.2)C.They Are Everywhere【思维】
- What is meaning of run level in Linux system? What are they?
- PAT A1060 are they equal (25)
- Four Logical Relationships of Project Management: What They Are and How To Use Them
- JWT vs JWS vs JWE - What They Are and When to Use Which
- 23种设计模式之解释器模式
- 为什么Hibernate建议你的实体类实现hashCode和equals方法?
- 嵌入式Linux入门:概述
- 往同一张表中的不同字段分别添加图片路径(既多张图路径上传到不同的字段上)
- secureCRT 7.0远程CentOS6.5时setup命令乱码问题
- Moving Averages(2): What Are They?
- 打造自己的下拉刷新库(Ultra-Pull-To-Refresh)(二)
- Linux版SMB远程代码执行漏洞(CVE-2017-7494)-SambaCry 分析报告
- 1025: 最大字符
- 打印回环数字
- JS学习笔记(5)内置对象
- nginx 简单负载和反向代理
- 空壳邮件
- jdk-ConcurrentLinkedQueue(一)