Overlap Studies

Moving Average with Variable Period (MAVP)

Moving average with variable period

Deep Dive

Everything You Need to Know

Under the Hood

How It Works

MAVP is a unique moving average where the calculation period changes dynamically based on an external input series rather than being fixed. The period can vary between min_period (default 2) and max_period (default 30) for each bar, controlled by a separate data series. This allows the moving average to adapt to changing market conditions based on volatility, volume, or any other metric. The ma_type parameter (default 0=SMA) selects which moving average calculation to use with the variable period.

In Practice

How Traders Use It

Advanced cryptocurrency traders use MAVP to create adaptive moving averages driven by market conditions like volatility or volume. For example, using ATR to control the period makes MAVP faster during high volatility and slower during calm periods. MAVP enables sophisticated adaptive strategies where MA responsiveness adjusts automatically to market regimes. It's particularly powerful when combined with volatility indicators (ATR, NATR) or cycle indicators (HT_DCPERIOD) to control the period. MAVP is favored by algorithmic traders building adaptive systems that respond intelligently to changing market dynamics.

Highlights

MAVP at a Glance

Moving average with externally controlled variable period
Period changes dynamically each bar based on input series
Min_period (2) to max_period (30) range constrains values
Can be driven by volatility, volume, cycles, or any metric
ma_type parameter selects MA calculation method
Creates truly adaptive moving averages
Ideal for regime-adaptive trading strategies
Best combined with ATR, volume, or cycle indicators
Popular among algorithmic and quantitative traders

Get Started

Automate MAVP with cryptorobot.ai

Build automated strategies using Moving Average with Variable Period and hundreds of other indicators. Connect to your favourite exchange and let the bot execute trades 24/7 — no code required.