WideBot
English
English
  • Welcome to WideBot Wiki
  • About
    • What's new?
    • Supported Exchanges
  • How to work with bot
    • How to change profile information and to add API keys and secrets
    • How to create a new bot
    • How to use any bot
    • What is an arbitrage bot
    • Bot Parameters
      • Exchange
      • Candle Size
      • Pair
      • Simultaneous Trades
    • Transaction
      • Closed Orders
      • Closed Transactions
    • What is a depth chart
    • How to use trading view chart
    • What is backtesting
    • What is warm up period
  • Strategies & Indicators
    • Strategies
      • MAcrossover
      • MAgoldenCross
      • MACDgoldencross
      • RSIsignals
      • MACDandRSI
      • RSIandMACross
      • StochSignal
      • Stochcrossover
      • MACDandStoch
      • StoCrossSignal
      • Bollinger Band
    • Indicators
      • Moving Average(MA)
      • RSI
      • MACD
      • Stochastic
      • Bollinger Band
Powered by GitBook
On this page

Was this helpful?

  1. Strategies & Indicators
  2. Indicators

Moving Average(MA)

PreviousIndicatorsNextRSI

Last updated 4 years ago

Was this helpful?

In , a moving average (rolling average or running average) is a calculation to analyze data points by creating a series of of different subsets of the full data set. It is also called a moving mean (MM) or rolling mean and is a type of filter. Variations include: , and , or forms (described below).

Given a series of numbers and a fixed subset size, the first element of the moving average is obtained by taking the average of the initial fixed subset of the number series. Then the subset is modified by "shifting forward"; that is, excluding the first number of the series and including the next value in the subset.

Simple Moving Average(SMA)

In financial applications, a simple moving average (SMA) is the unweighted of the previous n data-points. However, in science and engineering, the mean is normally taken from an equal number of data on either side of a central value. This ensures that variations in the mean are aligned with the variations in the data rather than being shifted in time. An example of a simple equally weighted running mean for a n-day sample of the closing price is the mean of the previous n days' closing prices. Let those prices be . Let the mean over the first k data-points be . Thus, the mean over all the data-points is calculated as:

This means that the moving average filter can be computed quite cheaply on real time data with a FIFO / circular buffer.

When calculating successive values, a new value comes into the sum, and the oldest value drops out. This means that a full summation each time is unnecessary. Thus, the new mean can be calculated as:

The period selected depends on the type of movement of interest, such as short, intermediate, or long-term. In financial terms, moving-average levels can be interpreted as in a falling market or in a rising market.

statistics
averages
[1]
finite impulse response
simple
cumulative
weighted
mean
support
resistance
{\displaystyle p_{1},p_{2},\dots ,p_{n}}
{\displaystyle {\begin{aligned}{\overline {p}}_{n}&={\frac {p_{1}+p_{2}+\cdots +p_{n}}{n}}\\&={\frac {1}{n}}\sum _{i=1}^{n}p_{i}\end{aligned}}}
{\displaystyle {\overline {p}}_{n}={\overline {p}}_{n-1}+{\frac {1}{n}}(p_{n}-{\overline {p}}_{n-1})}
{\displaystyle {\overline {p}}_{k}}