Indicator · Pine Script v5 · On the chart

Alert System with Trading Dashboard

by g-moe· code credited to goodgains

Alert System with Trading Dashboard calculates two exponential moving averages on the chart while tracking fast and slow EMA crossover states across four configurable timeframes.

View on GitHub

Repaints

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code77
Settings11inputs
LicenceNone statedfile: MPL-2.0
Last update5 months ago27 May 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

77 lines of Pine Script v5 from Tradingview/alert-system-trading-dashboard.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

alert-system-trading-dashboard.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains


//@version=5
indicator("Alert System with Trading Dashboard", overlay = true)

// @keywords: alert-system, trading-dashboard, multi-timeframe, mtf-ema, ema-crossover, ema-crossunder, dual-ema, crossover-alerts, crossunder-alerts, timeframe-status, bull-bear, status-table, four-timeframes, fast-slow-ema, ema-8-34, trend-direction, ema-trend, mtf-cross, table-dashboard, minute-timeframes

tf1 = input.timeframe('1', title = 'Timeframe 1')
tf2 = input.timeframe('3', title = 'Timeframe 2')
tf3 = input.timeframe('5', title = 'Timeframe 3')
tf4 = input.timeframe('15', title = 'Timeframe 4')

ma_length1 = input.int(8, title = 'MA Length 1')
ma_length2 = input.int(34, title = 'MA Length 2')

plot(ta.ema(close, ma_length1), title = "MA 1", color = color.yellow)
plot(ta.ema(close, ma_length2), title = "MA 2", color = color.teal)

cross_function(tf, length1, length2) =>
    cross_type = request.security(syminfo.tickerid, tf, ta.crossover(ta.ema(close[1], length1), ta.ema(close[1], length2)) ? 1 : ta.crossunder(ta.ema(close[1], length1), ta.ema(close[1], length2)) ? -1 : 0, lookahead = barmerge.lookahead_on)
    
    var last_cross = 0
    last_cross := cross_type == 1 ? 1 : cross_type == -1 ? -1 : last_cross[1]
    
    [cross_type, last_cross]
    

[tf1_function_value, tf1_last] = cross_function(tf1, ma_length1, ma_length2)
[tf2_function_value, tf2_last]  = cross_function(tf2, ma_length1, ma_length2)
[tf3_function_value, tf3_last]  = cross_function(tf3, ma_length1, ma_length2)
[tf4_function_value, tf4_last]  = cross_function(tf4, ma_length1, ma_length2)

//DASHBOARD
panelbull_color = input.color(#27a69b, title='Bull Color', inline='1', group='Visual Settings')
panelbear_color = input.color(#b63632, title='Bear Color', inline='1', group='Visual Settings')

LabelSize = input.string(defval='Medium', options=['Small', 'Medium', 'Large'], title='Dashboard Size', inline='2', group='Visual Settings')
label_size = LabelSize == 'Small' ? size.small : LabelSize == 'Medium' ? size.normal : LabelSize == 'Large' ? size.large : size.small
positioning = position.top_right 
dashboard_color = input.color(color.new(#131722, 0), title='BG Color', inline='2', group='Visual Settings')
dashboard_text = input.color(#ffffff, title='Text Color', inline='2', group='Visual Settings')
dashboard_bull = color.new(panelbull_color,40)
dashboard_bear = color.new(panelbear_color,40)

tf1_color = tf1_last == 1 ? panelbull_color : panelbear_color
tf2_color = tf2_last == 1 ? panelbull_color : panelbear_color
tf3_color = tf3_last == 1 ? panelbull_color : panelbear_color
tf4_color = tf4_last == 1 ? panelbull_color : panelbear_color

if tf1_function_value == 1 and tf1_function_value[1] != 1
    alert(tf1 + 'min Cross Above' , alert.freq_once_per_bar)
if tf2_function_value == 1 and tf2_function_value[1] != 1
    alert(tf2 + 'min Cross Above' , alert.freq_once_per_bar)
if tf3_function_value == 1 and tf3_function_value[1] != 1
    alert(tf3 + 'min Cross Above' , alert.freq_once_per_bar)
if tf4_function_value == 1 and tf4_function_value[1] != 1
    alert(tf4 + 'min Cross Above' , alert.freq_once_per_bar)

if tf1_function_value == -1 and tf1_function_value[1] != -1
    alert(tf1 + 'min Cross Below' , alert.freq_once_per_bar)
if tf2_function_value == -1 and tf2_function_value[1] != -1
    alert(tf2 + 'min Cross Below' , alert.freq_once_per_bar)
if tf3_function_value == -1 and tf3_function_value[1] != -1
    alert(tf3 + 'min Cross Below' , alert.freq_once_per_bar)
if tf4_function_value == -1 and tf4_function_value[1] != -1
    alert(tf4 + 'min Cross Below' , alert.freq_once_per_bar)


//TABLE
var table t = table.new(positioning, 4, 1, frame_color=color.new(dashboard_color, 100), frame_width=1, border_color=color.new(dashboard_color, 100), border_width=1)
if barstate.islast
    table.cell(t, 0, 0, text= tf1 , width=0, bgcolor=tf1_color, text_color=dashboard_text, text_size=label_size, text_halign=text.align_center)
    table.cell(t, 1, 0, text= tf2, width=0, bgcolor=tf2_color, text_color=dashboard_text, text_size=label_size, text_halign=text.align_center)
    table.cell(t, 2, 0, text= tf3, width=0, bgcolor=tf3_color, text_color=dashboard_text, text_size=label_size, text_halign=text.align_center)
    table.cell(t, 3, 0, text= tf4, width=0, bgcolor=tf4_color, text_color=dashboard_text, text_size=label_size, text_halign=text.align_center)

Overview

Alert System with Trading Dashboard displays a visual table on the price chart showing the directional bias for each timeframe. Automated alerts trigger whenever a crossover or crossunder occurs on any of the selected timeframes. Note that the higher-timeframe security calls use lookahead mode.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Screeners & dashboards, Moving averages, Trend

Markets

Any symbol

Timeframes

M1-M5, M15-H1

Risk Notes

  • Reads higher-timeframe data with lookahead on, so the history can show signals that were not there in real time

Settings

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

SettingTypeDefaultVariable
Timeframe 1timeframe1tf1
Timeframe 2timeframe3tf2
Timeframe 3timeframe5tf3
Timeframe 4timeframe15tf4
MA Length 1int8ma_length1
MA Length 2int34ma_length2
Bull Colorcolor#27a69bpanelbull_color
Bear Colorcolor#b63632panelbear_color
Dashboard SizestringMediumLabelSize
BG Colorcolorcolor.new(#131722, 0)dashboard_color
Text Colorcolor#ffffffdashboard_text
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

218 stars

TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of TradersPost Trading Checklist
92 stars

This indicator plots five moving averages of a chosen source on the price chart, defaulting to EMA lengths 10, 20, 30, 40 and 50. The user can switch the average type to SMA, WMA or HMA and recolor each line. Wide translucent glows sit under the lines, and sof

Indicator v5 TrendMoving averages
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev Rainbow MA Ribbon 10-50

EMA Ribbon Overlay

by iamrichardD
57 stars

Calculates exponential moving averages for fast, pivot, and slow lengths along with optional 50, 100, and 200 simple moving average context lines. It visualizes bullish and bearish ribbon fills on the main price chart alongside MACD calculations to generate ea

Indicator v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Overlay
53 stars

This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of Candle Counter + MA + RSI + Mode
43 stars

This indicator evaluates market momentum and risk by calculating trend metrics and volatility stats, displaying them in an on-chart table pane. It measures short-term and long-term trend strength via two MACD configurations built on three customizable EMA leng

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility

Market Monitor - 15m

by chris-c-thomas
14 stars

Market Monitor - 15m is a directional bias chart overlay designed for 15-minute intraday chart analysis. It calculates a triple exponential moving average ribbon with EMA cloud shading, session VWAP with multiplier bands, prior day levels, a 30-minute opening

Indicator v6 TrendMoving averages
Updated 6 months ago · MIT GitHub repository of Market Monitor - 15m

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