Moving average with variable period
Under the Hood
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
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.
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.