adaptive moving average (ama)
Info
The adaptive moving average (ama) is a Indicator for MetaTrader 5 that the adaptive moving average (ama) is a tool for constructing a moving average with reduced sensitivity to price series noises, enabling timely trend detection. this indicator was introduced by perry kaufman in his book, offering a solution to the challenges posed by traditional smoothing algorithms.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use adaptive moving average (ama)
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
the adaptive moving average (ama) is a tool for constructing a moving average with reduced sensitivity to price series noises, enabling timely trend detection.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Quantora Moving Average Dashboard MT5 - Professional EMA SMA Trend Analysis - another powerful indicator for MetaTrader 5 traders.
the adaptive moving average (ama) is a tool for constructing a moving average with reduced sensitivity to price series noises, enabling timely trend detection.Also recommended: Relative Moving Average (RMA) Indicator for MT5 - similar indicator with strong performance on MetaTrader 5.
this indicator was introduced by perry kaufman in his book, offering a solution to the challenges posed by traditional smoothing algorithms.
one of the drawbacks of conventional smoothing methods is their susceptibility to generating false trend signals from random price fluctuations. conversely, these methods often lag in identifying genuine trends. the ama aims to address these issues.
calculation:
kaufman's approach involves the efficiency ratio (er), which is computed using the following formula:
er(i) = signal(i) / noise(i)
where:
- er(i) is the current efficiency ratio value.
- signal(i) = abs(price(i) - price(i - n)) represents the current signal value, derived from the absolute difference between the current price and the price n periods ago.
- noise(i) = sum(abs(price(i) - price(i-1)),n) signifies the current noise value, calculated as the sum of absolute differences between the current price and the previous price over n periods.
the efficiency ratio (er) approaches 1 in a strong trend and is slightly above 0 in the absence of a clear trend.
the calculated er is then incorporated into the exponential smoothing formula:
ema(i) = price(i) * sc + ema(i-1) * (1 - sc)
where:
- sc = 2/(n+1) is the ema smoothing constant, with n representing the period of exponential moving.
- ema(i-1) is the previous ema value.
the smoothing ratio for a fast-moving market is set to the ema period of 2 (fast sc = 2/(2+1) = 0.6667), while for a non-trending market, the ema period is 30 (slow sc = 2/(30+1) = 0.06452). this introduces a new variable, the scaled smoothing constant (ssc):
ssc(i) = (er(i) * (fast sc - slow sc) + slow sc
or
ssc(i) = er(i) * 0.60215 + 0.06425
kaufman suggests squaring the obtained smoothing constant to enhance its impact on the averaging period.
the final calculation formula is:
ama(i) = ama(i-1) + (ssc(i)^2) * (price(i) - ama(i-1))
or
ama(i) = price(i) * (ssc(i)^2) + ama(i-1)*(1-ssc(i)^2)
where:
- ama(i) is the current ama value.
- ama(i-1) is the previous ama value.
- ssc(i) is the current scaled smoothing constant value.
You may also like: multi-timeframe moving average indicator (v03) - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "robotfx"
#property link "https://robotfx.org"
#property version "1.00"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
#property indicator_label1 "ama"
#property indicator_type1 draw_line
#property indicator_color1 red
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.