Adaptive MACD
By LuxAlgoAug 21, 2023
Adaptive MACD is an indicator on Vela, our next-generation charting platform, written in Pine Script®.
Adaptive MACD rebuilds MACD for markets that refuse to stay trending. A rolling R-squared coefficient continuously measures how directional price has been, and that reading drives a blending weight that reshapes the filter itself: high values keep it close to the traditional calculation and preserve long-term trends, low values shift it toward short-cycle detection so consolidation stops printing false momentum. The familiar anatomy survives intact: MACD line, signal line, histogram.
How to Trade the Adaptive MACD?
- MACD line above 0: bullish momentum in force; below 0, the downtrend read applies.
- Histogram: the gap between MACD and signal lines. Watch it for crossovers and transitions in momentum.
- Divergences: highs or lows in price left unconfirmed by the oscillator flag potential reversals, read exactly as on the classic.
With matched fast and slow lengths, the adaptive version reacts to genuine structural change while filtering range noise: adaptive parameterization doing the regime work a fixed filter cannot.
Adaptive MACD Settings
- R2 Period: observation window for the R-squared coefficient; larger periods classify trend versus range on a broader horizon.
- Fast: the short EMA interval. Lower values sharpen sensitivity.
- Slow: the long EMA interval. Higher values weight prolonged moves.
- Signal: smoothing applied to derive the signal line from the MACD line.
Frequently Asked Questions
Free to use
Run it on Vela. Go further with a paid plan.
- Up to 500 strategy alerts, with webhook automation
- Up to 10× the chart history of Free
- Orderflow lookback up to full history
- More Quant usage to customize it, plus extra usage when you need it
- Futures data alongside crypto, stocks, forex and commodities
Also works on
Related indicators
All 3 MACD indicatorsRun it on Vela. Make it yours with Quant.
Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.





