View Full Version : Simple Moving Average (SMA)
ScriptBoss
02-11-2010, 12:47 PM
Simple Moving Average (SMA)
The MA indicator (Moving Average indicator) is one of the oldest technical modern indicators and the most often used indicator in technical analysis.
A simple moving average is formed by computing the average (mean) price of a security over a specified number of periods. While it is possible to create moving averages from the Open, the High, and the Low data points, most moving averages are created using the closing price when you attach SMA indicator to the chart there is an option will appear from witch you can choose either lose, open, high, or low. For example: a 10-day simple moving average is calculated by adding the closing prices for the last 10 days and dividing the total by 10 see the chart below 1.1.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%201/1.1.JPG
Figure 1.1, (10 moving average).
A moving average is an average of a shifting body of data, as seen from its name. For example, a 10-day moving average is got by adding closing prices for the last 10 periods being measured and dividing by 10. The term "moving" is used as only the last 10 days are used in the measurement. That's why the data body is averaged shifted forward with every next trading day.
Simple, in other words, arithmetical moving average is calculated by summing up the prices of instrument closure over a certain number of single periods (for instance, 1 hour). This value is then divided by the number of such periods.
The calculation of the SMA (Simple Moving Average) goes the following way: the currency closing prices taken for some period of time are summed and divided by the amount of these periods. Generally speaking, the average price of the certain period is represented by SMA.
SMA = SUM (CLOSE, N)/N
Where:
N — is the number of calculation periods.
Example on 10 days moving average in numbers :
12+15+19+18+20+14+20+23+20+19 = 180
180/10=18
And for next period:
15+19+18+20+14+20+23+20+19+20 = 200
200/10=20
In this figure (Figure 1.2) 10 SMA closing candles attached to “30 Minutes” EUR/USD CHART.
Right click in the chart and choose “show as list”, it will show you all the prices of high, low, ask, and bid. We will calculate SMA. For red arrow point. See figure 1.2.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%201/1.1.JPG
Figure 1.2
To be sure, please see this figure 1.3 it will help you more.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%201/1.3.JPG
Figure 1.3
The figure 1.3 shows you the prices of red arrow point and the time of it, the last ten prices before 5:00 AM, and you can sum the last ten prices and divide them over 10, the result is the SMA for this point.
This simple illustration highlights the fact that all moving averages are lagging indicators and will always be "behind" the price. The price of this symbol is trending down, but the simple moving average, which is based on the previous 10 days of data, remains above the price. If the price were rising, the SMA would most likely be below. Because moving averages are lagging indicators, they fit in the category of trend following indicators. When prices are trending, moving averages work well. However, when prices are not trending, moving averages can give confusing signals.
ScriptBoss
02-11-2010, 12:52 PM
Technical Analysis Lessons
Series
The moving average line will be placed directly in the price shifting chart. The moving average is measured with a definite predefined period. The sensibility of the moving average is weaker if the period is longer. The probability of false signals is higher if the period is shorter.
Short period is more sensitive and has false signal, more than long period because the long period is divided on long number and the sensitivity of big number is less than small number.
In figure 2.1 you will see tow of SMA indicator one for 10 SMA, and other for 25 SMA.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%202/2.1.JPG
Figure 2.1
The yellow indicator is “10 SMA”, and the red indicator is “25 SMA”, the yellow is shorter than red, as you see yellow indicator is more sensitive than the red, it align to the market more than the red one, the red indicator has a big move to response to market.
When the price of symbols working well the SMA is working well too, but of the last ten prices are well and the 11th one is away from the real price and start go away in 12th and 13th the SMA is will not work well depend in the last 10 prices. . Short-term averages respond quickly to changes in the price of the underlying, while long-term averages are slow to react
On the whole, the moving average is a smoothing tool. Low and high prices are covered and the basic trend of the market is more precisely seen by averaging the price information. But by its very nature the moving average line is behind the market action. See figure 2.2 explain tow indicator the red indicator is 40 SMA and the yellow indicator is 5 SMA, A shorter period moving average (3-5 days) would hug the price action more closely than a 40-day moving average. Shorter term moving averages are more influenced by everyday shifts.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%202/2.2.JPG
Figure 2.2.
In other words, this is the average stock price over a certain period of time. Keep in mind that equal weighting is given to each daily price. As shown in the chart above (Figure 2.2), many traders watch for short-term averages to cross above longer-term averages to signal the beginning of an uptrend See Figure 2.3 for more details. As shown by the yellow arrows, short-term averages (e.g. 5-period SMA) act as levels of support when the price experiences a pullback. Support levels become stronger and more significant as the number of time periods used in the calculations increases.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%202/2.3.JPG
Figure 2.3
As you see in Figure 2.4, when the yellow indicator (short period) cross over red indicator (long period) it mean that the big upper move will start, it mean buy signal”uptrend”.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%202/2.4.JPG
Figure 2.4.
As you see in figure 2.5, when a short-term average (yellow indicator 5-day) crosses above a longer-term average (Red indicator 40-day). Downward momentum is confirmed when a short-term average crosses below a long-term average, it mean sell signal.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%202/2.5.JPG
Figure 2.5
ScriptBoss
02-11-2010, 12:53 PM
Technical Analysis Lessons
Series
Support
Another common use of moving averages is in determining potential price supports. It does not take much experience in dealing with moving averages to notice that the falling price of an asset will often stop and reverse direction at the same level as an important average. For example, in Figure 3.1 you can see that the 200-day moving average was able to prop up the price of the stock after it fell from its high near $1.2870. Many traders will expect a bounce off of major moving averages and will use other technical indicators as confirmation of the expected move.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%203/3.1.JPG
Figure 3.1.
Resistance
Once the price of an asset falls below an influential level of support, such as the 200-day moving average, it is not uncommon to see the average act as a strong barrier that prevents investors from pushing the price back above that average. As you can see from the chart below, this resistance is often used by traders as a sign to take profits or to close out any existing long positions. Many short sellers will also use these averages as entry points because the price often bounces off the resistance and continues its move lower. If you are an investor who is holding a long position in an asset that is trading below major moving averages, it may be in your best interest to watch these levels closely because they can greatly affect the value of your investment. See figure 3.2.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%203/3.2.JPG
Figure 3.2.
Momentum
Many beginner traders ask how it is possible to measure momentum and how moving averages can be used to tackle such a feat. The simple answer is to pay close attention to the time periods used in creating the average, as each time period can provide valuable insight into different types of momentum. See figure 3.3, in general, short-term momentum can be gauged by looking at moving averages that focus on time periods of 20 days or less “yellow indicator”. Looking at moving averages that are created with a period of 20 to 100 “the middle indicator” days is generally regarded as a good measure of medium-term momentum. Finally, any moving average that uses 100 days or more in the calculation can be used as a measure of long-term momentum. Common sense should tell you that a 20-day moving average is a more appropriate measure of short-term momentum than a 200-day moving average”red indicator”.
Notice: when the yellow indicator 20 days SMA is under the big SMA indicator that’s mean there is down move will start.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%203/3.3.JPG
Figure 3.3.
One of the best methods to determine the strength and direction of an asset's momentum is to place three moving averages onto a chart and then pay close attention to how they stack up in relation to one another. The three moving averages that are generally used have varying time frames in an attempt to represent short-term, medium-term and long-term price movements. In Figure 3.4, strong upward momentum is seen when shorter-term averages are located above longer-term averages and the two averages are diverging. Conversely, when the shorter-term averages are located below the longer-term averages, the momentum is in the downward direction figure 3.3 above.
Notice: when the yellow indicator 14 days SMA is upper the big SMA indicator that’s mean there is up move will start.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%203/3.4.JPG
Figure 3.4.
ScriptBoss
02-11-2010, 12:55 PM
This article will focus on the most popular indicator used in technical analysis, the moving average convergence divergence (MACD). This indicator was developed by Gerald Apple in the 1960s and although the name of this indicator sounds very complicated, it's really quite simple to use. Read on to learn how you can start looking for ways to incorporate this powerful tool into your trading strategy.
In figure 4.1 you will see MACD with tow variable the yellow indicator is 14 period days and the red indicator 26 period days, as I told before when the yellow indicator cross over the red one it mean buy point, when the yellow indicator crosses above red indicator it mean it’s a sell point.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%204/4.1.JPG
Figure 4.1
Bollinger Band related with SMA.
A Bollinger band technical indicator looks similar to the moving average envelope “kindly, please read the previous post about Bollinger Band”, but differs in how the outer bands are created.
As you see in figure 4.2, the bands of this indicator are generally placed two standard deviations away from a simple moving average. In general, a move toward the upper band can often suggest that the asset is becoming overbought, while a move close to the lower band can suggest the asset is becoming oversold. Since standard deviation is used as a statistical measure of volatility, this indicator adjusts itself to market conditions. The tightening of the bands is often used by traders as an early indication that overall volatility may be about to increase and that a trader may want to wait for a sharp price move. (For further reading, check out The Basics of Bollinger Bands and my Technical Analysis tutorial.)
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%204/4.2.JPG
Figure 4.2
What is the EMA?
Generally, when you hear the term "moving average", it is in reference to a simple moving average. This can be important, especially when comparing to an exponential moving average (EMA).
Note:
A type of moving average that is similar to a simple moving average, except that more weight is given to the latest data. Also known as "exponentially weighted moving average".
This type of moving average reacts faster to recent price changes than a simple moving average. The 12- and 26-day EMAs are the most popular short-term averages, and they are used to create indicators like the moving average convergence divergence (MACD) and the percentage price oscillator (PPO). In general, the 50- and 200-day EMAs are used as signals of long-term trends.
Shorter length moving averages (MA's for short) are more sensitive and identify new trends earlier, but also give more false alarms. Longer moving averages are more reliable but only pick up the big trends.
In this tutorial, I’ve covered the basics of moving averages. Here's a brief recap:
• Few technical indicators are as popular and widely followed as the moving average.
• Moving averages come in various forms, but their underlying purpose remains the same: to help technical traders track the trend of financial assets by smoothing out the day-to-day price fluctuations, or noise.
• The simplest form of a moving average is appropriately known as a simple moving average (SMA). It is calculated by taking the arithmetic mean of a given set of values.
• Using moving averages can be very ineffective during periods where the asset is trending sideways.
• There are many different strategies involving moving averages. The most popular is the moving average crossover.
• Some of the primary roles of a moving average include identifying trends and reversals, measuring the strength of an asset's momentum and determining potential areas where an asset will find support or resistance.
• Moving averages are used in the creation of a number of other very popular technical indicators such as the moving average convergence divergence (MACD) or Bollinger bands.
• Moving averages won't solve all your investing problems. However, when used judiciously, they can be valuable tools in planning your trading strategy.
• The exponential moving average (EMA) assigns a weighting to recent data because many traders regard this as the major downfall of the SMA.
ScriptBoss
02-11-2010, 12:56 PM
Using VTL script on SMA indicator.
The VTL scrip help you to back tracing the buy and sell to all points of SMA which attached to chart.
How to use trade script:
1-Please attach simple moving average indicator to see where the sell and buy points.
2- Right click on the simple moving average indicator and choose attach to chart.
3-Then go to the script tree node, and write click on the tree and choose create.
4- Write in buy script this code:
#buy Script:
SET A = SMA(CLOSE, 5)
SET B = SMA(CLOSE, 20)
CROSSOVER (A, B) = TRUE
And in the sell script:
#Sell Script:
SET A = SMA(CLOSE, 5)
SET B = SMA(CLOSE, 20)
CROSSOVER (B, A) = TRUE
To help you, I’m adding this simple moving average (SMA) VTL Scrip code; there are three codes the first one is for buy, the second for sell and the final one is for closing sell or buy position, and the buy script should be written in the buy script area, the sell and exit should be written in the Sell and exit Area.
If you want to add this scrip to your chart manually you have to do these steps.
1- Right click on the scrip on the left hand tree, then choose create.
2- VertexFX Trading Scrip Language (VTL) Editor Screen will be appearing.
3- Chose script choice then press next.
4- Write advice name and author then press ok.
5- Write this buy script on the buy screen :
#buy Script:
SET A = SMA(CLOSE, 5)
SET B = SMA(CLOSE, 20)
CROSSOVER (A, B) = TRUE
6- Write this Sell script on the sell screen :
#Sell Script:
SET A = SMA(CLOSE, 5)
SET B = SMA(CLOSE, 20)
CROSSOVER (B, A) = TRUE
7-then write the exit script:
#Exit Script:
#“There is no exit script”
For more details how to create a script “step by step” please see previous post in http://www.forum.hybrid-solutions.com/showthread.php?t=504
See the final lesson “5” Bollinger band Charts/Technical Analysis/Trading Scripts.
And you well learn how to add this script in the tree in details.
Then go to script tree and go to SMA script -- > right click -- > choose attach to chart. See figure 5.1.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%205/5.1.JPG
Figure 5.1
6- Then the platform will be busy fro a while to process the script then the back tracing study will be shown as a report on the screen.
The report will show you how many point will be success on this symbol and how many time will be failed. And more details. See figure 5.2.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%205/5.2.JPG
Figure 5.2
See figure 5.3, it show you the sell point and buy points, the red arrows showing you sell point and the green arrows showing you a buy points. But you have to know that there are some points are not profitable and another and profitable, that’s dependent on you VTL study, the report that appeared in figure 5.2 show you the result of your study.
http://www.forum.hybrid-solutions.com/VTL/SMA/Lesson%205/5.3.JPG
Figure 5.3.