Indicator · Pine Script v6 · On the chart

Pulse Mean Accelerator

by eddiebelaval· code credited to MisinkoMaster

This indicator overlays a dynamic moving average on the price chart by adjusting a baseline mean with a pulse acceleration factor.

View on GitHub

GitHub stars7on the repository
Pine versionv6current
Lines of code137
Settings8inputs
LicenceNone statedfile: MPL-2.0
Last update3 months ago24 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

137 lines of Pine Script v6 from pinescript/moving_averages/pulse-mean-accelerator.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

pulse-mean-accelerator.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MisinkoMaster

//@version=6
indicator("Pulse Mean Accelerator", "PMA | MisinkoMaster", overlay = true, behind_chart = false)
/////////////////////////////////////////////////////////////////////////////////////////////////
//Import Libraries
import TradingView/ta/12
/////////////////////////////////////////////////////////////////////////////////////////////////
//Get User Defined Inputs
src = input.source(close, "Source",
     group = "Pulse Mean Accelerator | MisinkoMaster")

matype = input.string("RMA", "Moving Average Type",
     ["RMA", "SMA", "EMA", "WMA", "DEMA", "TEMA", "HMA"],
     tooltip = "Changes the Moving Average Type Used in the indicator.",
     group = "Pulse Mean Accelerator | MisinkoMaster")
len = input.int(20, "Moving Average Length", step = 1, minval = 2,
     tooltip = "Changes the lookback period of the Moving Average",
     group = "Pulse Mean Accelerator | MisinkoMaster")

palen = input.int(32, "Pulse Acceleration Lookback", step = 1, minval = 2,
     tooltip = "Changes the lookback for acceleration of the Moving Average.",
     group = "Pulse Mean Accelerator | MisinkoMaster")
max_ = input.float(0.2, "Maximum Acceleration", step = 0.01, minval = 0.01,
     tooltip = "Changes the maximum acceleration and how fast it accelerates.",
     group = "Pulse Mean Accelerator | MisinkoMaster")
vtype = input.string("Standard Deviation", "Volatility Type",
     ["ATR", "Standard Deviation", "MAD"],
     "Changes the type of volatility calculation used",
     group = "Pulse Mean Accelerator | MisinkoMaster")
     
smooth = input.string("Double Moving Average", "Smoothing",
     ["NONE", "Exponential", "Extra Moving Average", "Double Moving Average"],
     tooltip = "Changes how the indicator is smoothed",
     group = "Pulse Mean Accelerator | MisinkoMaster")
con = input.bool(true, "Use confirmation?",
     group = "Pulse Mean Accelerator | MisinkoMaster")
/////////////////////////////////////////////////////////////////////////////////////////////////
//Calculations
F_MA(source, length, MovingAverageType) =>
    ma = switch MovingAverageType
        "RMA" => ta.rma(source, length)
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "WMA" => ta.wma(source, length)
        "DEMA" => ta.dema(source, length)
        "TEMA" => ta.tema(source, length)
        "HMA" => ta.hma(source, length)

    [ma]

[ma] = F_MA(src, len, matype)

roc_ma = ma-ma[1]
roc_src = src-src[1]

step = max_/palen
acc = 0.0

for i = 0 to palen-1
    if math.abs(roc_src) > math.abs(roc_ma)
        acc += step
    if math.abs(roc_ma) > math.abs(roc_src)
        acc += -step

[atr] = F_MA(ta.tr(true), palen, matype)
[mad] = F_MA(math.abs(ma-src), palen, matype)
sd = ta.stdev(ma, palen)

vol = switch vtype
    "ATR" => atr
    "Standard Deviation" => sd
    "MAD" => mad

[avgr] = F_MA(roc_ma, palen, matype)
absr = math.abs(avgr)

direction = absr != 0.0 ? avgr / absr : 0.0


pma_ = ma+(acc*vol*direction)

sqrt = math.round(math.sqrt(len))
[pma_ma] = F_MA(pma_, sqrt, matype)

a = 2/(1+len)
pma_e = pma_*(1-a)+ma*a

[pma_d] = F_MA(pma_ma, sqrt, matype)
pma = switch smooth
    "NONE" => pma_
    "Exponential" => pma_e
    "Extra Moving Average" => pma_ma
    "Double Moving Average" => pma_d

CL = con ? (pma-pma[1])+(ma-ma[1])>0 : true
CS = con ? (pma-pma[1])+(ma-ma[1])<0 : true
/////////////////////////////////////////////////////////////////////////////////////////////////
//Trend Logic
var trend = 0

L = src > pma and CL 
S = src < pma and CS

if L
    trend := 1
if S
    trend := -1
/////////////////////////////////////////////////////////////////////////////////////////////////
//Plotting
var col = color.rgb(58, 58, 58)
var colM = color.rgb(58, 58, 58, 20)
var colT = color.rgb(58, 58, 58, 60)
var colMT = color.rgb(58, 58, 58, 40)

if trend == 1
    col := color.rgb(0, 255, 187)
    colM := color.rgb(0, 255, 187, 20)
    colMT := color.rgb(0, 255, 187, 40)
    colT := color.rgb(0, 255, 187, 60)
if trend == -1
    col := color.rgb(255, 0, 157)
    colM := color.rgb(255, 0, 157, 20)
    colMT := color.rgb(255, 0, 157, 40)
    colT := color.rgb(255, 0, 157, 60)

plotcandle(open, high, low, close, bordercolor = col, color = col, wickcolor = col, display = display.pane, force_overlay = true)
plotshape(trend == 1 and trend[1] != 1 ? src : na, style = shape.labelup, location = location.belowbar, size = size.normal, color = color.rgb(0, 255, 187), display = display.pane, force_overlay = true, text = "𝓛𝓸𝓷𝓰", textcolor = color.rgb(7, 114, 86))
plotshape(trend == -1 and trend[1] != -1 ? src : na, style = shape.labeldown,location = location.abovebar, size = size.normal,color = color.rgb(255, 0, 157), display = display.pane, force_overlay = true, text = "𝓢𝓱𝓸𝓻𝓽", textcolor = color.rgb(95, 11, 63))

map = plot(ma, "Moving Average", colM, linewidth = 2)
pmap = plot(pma, "Pulse Mean Accelerator", col, linewidth = 2)
s = plot(close, display= display.none, editable= false)

fill(map, pmap, colMT)
fill(pmap, s, colT, fillgaps = true)

Overview

Pulse Mean Accelerator measures rate of change differences between price and the moving average, scaling the displacement by volatility via standard deviation, average true range, or mean absolute deviation. Users can configure seven moving average types, select multiple post-processing smoothing methods, and toggle confirmation conditions. Plotted directly on price, the line reflects adaptive trend momentum, though indicator calculations inherently lag during sharp reversals and consolidating markets.

Details

Published by

eddiebelaval on GitHub

Code credit

MisinkoMaster, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Volatility & bands

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Sourcesourceclosesrc
Moving Average TypestringRMAmatype
Moving Average Lengthint20len
Pulse Acceleration Lookbackint32palen
Maximum Accelerationfloat0.2max_
Volatility TypestringStandard Deviationvtype
SmoothingstringDouble Moving Averagesmooth
Use confirmation?booltruecon
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

318 stars

This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Multiple Moving Averages

NVDA Trend Ribbon

by longsurf-ai
277 stars

This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre

Indicator v6 TrendMoving averages
Updated yesterday · MIT GitHub repository of NVDA Trend Ribbon

Bollinger Bands Force

by harryguiacorn
219 stars

This indicator modifies standard Bollinger Bands to measure directional trend force based on line alignment. It calculates a simple moving average basis along with upper and lower volatility bands. When all three lines move upward or downward simultaneously, i

Indicator v5 Volatility & bandsTrend
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Force

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers