indicator · on price · open source

Median Moving Average

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Median Moving Average replaces the mean with the median of the last N bars. Robust to outlier prints — a wick or flash spike barely moves the line.

  • Cleaner than an SMA when markets whip around.
  • Excellent on crypto where wicks dominate candles.
  • Raise N for ultra-stable S/R; lower it for tight swing tracking.

Source code

//@version=5
indicator("Median Moving Average", overlay=true)
len = input.int(20, "Length", minval=2, maxval=500)
src = input.source("close", "Source")
median = ta.median(src, len)
p_Median_MA = plot(median, "Median MA", color=color.teal, linewidth=2)
alertcondition(ta.crossover(close, median), "Price crosses above Median", "Price crossed above the median MA")
alertcondition(ta.crossunder(close, median), "Price crosses below Median", "Price crossed below the median MA")

Comments

No comments yet.

Sign in to comment.