Indicator · Pine Script v6 · Own pane

Archer Moving Averages Trends (AMAT)

by mihakralj

Calculates the Archer Moving Averages Trends (AMAT) indicator by comparing fast and slow Exponential Moving Averages (EMAs) alongside their slope directions.

View on GitHub

GitHub stars99on the repository
Pine versionv6current
Lines of code52
Settings3inputs
LicenceApache-2.0
Last update4 weeks ago27 Sep 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

52 lines of Pine Script v6 from lib/dynamics/amat/amat.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

amat.pine
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Archer Moving Averages Trends (AMAT)", "AMAT", overlay=false)

//@function Calculates AMAT using multiple EMAs to identify trend direction
//@param source Series to calculate AMAT from
//@param fast Fast EMA period
//@param slow Slow EMA period
//@returns Tuple [bullish_count, bearish_count, trend_strength]
amat(series float source, simple int fast = 10, simple int slow = 50) =>
    if fast <= 0 or slow <= 0
        runtime.error("Periods must be greater than 0")
    if fast >= slow
        runtime.error("Fast period must be less than slow period")
    
    float alpha_fast = 2.0 / (fast + 1)
    float alpha_slow = 2.0 / (slow + 1)
    
    var float ema_fast = source
    var float ema_slow = source
    var float ema_fast_prev = source
    var float ema_slow_prev = source
    
    ema_fast := alpha_fast * (source - ema_fast) + ema_fast
    ema_slow := alpha_slow * (source - ema_slow) + ema_slow
    
    float long_trend = ema_fast > ema_slow and ema_fast > ema_fast_prev and ema_slow > ema_slow_prev ? 1.0 : 0.0
    float short_trend = ema_fast < ema_slow and ema_fast < ema_fast_prev and ema_slow < ema_slow_prev ? -1.0 : 0.0
    
    ema_fast_prev := ema_fast
    ema_slow_prev := ema_slow
    
    float trend = long_trend + short_trend
    float strength = math.abs(ema_fast - ema_slow) / ema_slow * 100
    
    [trend, strength, ema_fast, ema_slow]

// ---------- Main loop ----------

// Inputs
i_fast = input.int(10, "Fast Period", minval=1)
i_slow = input.int(50, "Slow Period", minval=2)
i_source = input.source(close, "Source")

// Calculation
[trend, strength, ema_fast, ema_slow] = amat(i_source, i_fast, i_slow)

// Plot
plot(trend, "AMAT Trend", color=trend > 0 ? color.green : trend < 0 ? color.red : color.gray, style=plot.style_columns, linewidth=3)
plot(strength, "Trend Strength %", color=color.yellow, linewidth=2)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dashed)

Overview

A bullish trend (+1) is identified when the fast EMA exceeds the slow EMA with both rising, while a bearish trend (-1) occurs when the fast EMA is below the slow EMA with both falling. It plots directional trend columns and a percentage-based trend strength metric in a separate pane. User inputs allow custom fast and slow periods and source selection.

Details

Published by

mihakralj on GitHub

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Trend, Moving averages

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.

Topics

algorithmic-tradingcsharpdotnetpinescriptpythonquantitative-financesimdta-libtechnical-analysistechnical-indicators

Settings

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

SettingTypeDefaultVariable
Fast Periodint10i_fast
Slow Periodint50i_slow
Sourcesourceclosei_source
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

Beep Boop

by magic8bot
409 stars

This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome

Indicator v4 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of Beep Boop
218 stars

Multi-Timeframe Analysis Suite calculates trend direction and momentum conditions across five user-selected timeframes using moving averages, RSI, and Stochastic oscillators. It evaluates moving average slope and oscillator levels to compute trend alignment, m

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of Multi-Timeframe Analysis Suite

KamaFama

by Mastaaa1987
141 stars

KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev

Indicator v6 Moving averagesOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of KamaFama

MultiIndicator

by capissimo
114 stars

MultiIndicator combines multiple technical indicators into a single separate pane to save chart space. It calculates and displays market regime detection based on ordinary least squares regression, a Holt exponential smoothing crossover, normalized RSI, ADX, a

Indicator v4 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of MultiIndicator

Colored fill

by be-thomas
65 stars

This indicator plots two simple moving averages of close, one over five bars and one over twenty bars, in a separate pane. It shades the area between the two plots green when the shorter average is above the longer average and red when it is below. There are n

Indicator v4 Moving averagesTrend
Updated 4 days ago · GPL-3.0 GitHub repository of Colored fill

Hash Ribbons

by oguzhandilber
47 stars

This indicator plots the Hash Ribbon metric by calculating 30-day and 60-day simple moving averages of Bitcoin network hash rate data. Designed for long-term market cycle analysis, it draws in a separate pane and displays hash ribbons alongside optional buy si

Indicator v4 Moving averagesTrend Repaints
Updated 5 years ago · None stated GitHub repository of Hash Ribbons

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