Indicator · Pine Script v6 · Own pane

Lightweight Indicator Template

by MoDarK-MK· code credited to {{SHORTTITLE}}

This lightweight indicator template calculates a simple moving average based on a user-selected price source and lookback length.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code27
Settings2inputs
LicenceMPL-2.0
Last update8 weeks ago4 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

27 lines of Pine Script v6 from assets/templates/indicator_lite_template.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

indicator_lite_template.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © {{SHORTTITLE}}

//@version=6
indicator(
     "{{TITLE}}", shorttitle="{{SHORTTITLE}}", overlay={{OVERLAY}})

// Lightweight indicator template — no dashboard, no test block.
// Best for: simple overlays, single-line indicators, quick scripts.
// Use the "full" profile when you need a dashboard, tests, or theming.

// ————— Inputs
int   lengthInput = input.int(14, "Length", minval=1, maxval=2000,
     tooltip="Lookback in bars.")
float sourceInput = input.source(close, "Source",
     tooltip="Price series to compute from.")

// ————— Calculations
float maValue = ta.sma(sourceInput, lengthInput)
bool  trendUp = sourceInput > maValue

// ————— Visuals
color maColor = trendUp ? #089981 : #f23645
plot(maValue, "MA", color=maColor, linewidth=2)

// ————— Alerts
alertcondition(ta.cross(sourceInput, maValue), "MA Cross", "Price crossed the MA")

Overview

Lightweight Indicator Template plots the calculated moving average line, dynamically coloring it green when the price is above the moving average and red when below. The script also includes a price cross alert condition. It serves as a minimalistic starter scaffold for developing simple Pine Script v6 indicators without additional complex overhead like dashboards or embedded testing blocks.

Details

Published by

MoDarK-MK on GitHub

Code credit

{{SHORTTITLE}}, as written in the script's header

Draws

Separate pane below the chart

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

ci-cdindicatorslinterpine-scriptpythonstrategiestradingview

Settings

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

SettingTypeDefaultVariable
Lengthint14lengthInput
SourcesourceclosesourceInput
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
228 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
99 stars

Calculates the Archer Moving Averages Trends (AMAT) indicator by comparing fast and slow Exponential Moving Averages (EMAs) alongside their slope directions. A bullish trend (+1) is identified when the fast EMA exceeds the slow EMA with both rising, while a be

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Archer Moving Averages Trends (AMAT)

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 6 days ago · GPL-3.0 GitHub repository of Colored fill

More Moving averages scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers