Moving averages: SMA, EMA and VWAP
- Lesson 2 of 5
- Indicators
- steps
- 7
- metrics taught
- 4
- Your test
- Not taken yet
About this lesson
What you'll learn
Averages smooth out the noise so the trend is easier to see. You'll compare three kinds and see why they always run a little behind the price.
A moving average smooths the noise
A simple moving average (SMA) is the average of the last N closes. Each new candle adds a close and drops the oldest one, so the average moves along with the chart.
A short period follows the price closely; a long one is smoother. Move the period and watch the line change.
Averages run behind the price
An average is built from past closes, so it reacts late. When the price turns, the average keeps going the old way for a while.
Here the price tops out and the SMA 20 keeps rising for several more candles. Traders call that delay lag.
EMA: the newest candles count more
An exponential moving average (EMA) gives more weight to recent closes. With a period of 20, the newest close makes up about 9.5% of the EMA, while in the SMA every close counts for 5%.
That's why the EMA turns sooner. Change the period and compare the two lines.
Two averages crossing
Traders often draw a fast and a slow average together, like EMA 20 and EMA 50. When the fast one crosses above the slow one, recent prices are running higher than older ones.
A bot can watch for exactly this with the condition EMA 20 above EMA 50. Each dot marks a crossing.
VWAP: the average price where the volume traded
VWAP (volume-weighted average price) weighs each candle's price by how much traded in it. A candle with a lot of volume pulls the VWAP toward its price.
Bots here compute it over the last 24 candles. Make the low candle heavier and compare VWAP with a plain average.
Your turn: far from VWAP
This is three days of hourly candles. Distance from VWAP is how far the price sits from the VWAP, in percent. A typical condition is "distance from VWAP at or above 2%".
Move the threshold and count the Signals. Under the chart, the same condition runs on the live feed.
Test what you learned
Three quick questions, then a bot to build.
Read the strategy and set up a bot that follows it, with the direction and the conditions it names and no others. Passing depends on the build alone. Once it's right, the bot fires and you see what the market did next, which won't always go your way.
These lessons explain what each number measures. They are not trading advice, and the lesson charts use simulated data. Preview build: market data on this site is simulated.