Indicator · Pine Script v4 · Own pane

Easy Entry/Exit Trend Colors (With Alerts)

by theonetrade· code credited to countseven12 (PostalCrypt)

Easy Entry/Exit Trend Colors combines a MACD indicator wrapped in Bollinger Bands with long-term moving average crossovers.

View on GitHub

GitHub stars34on the repository
Pine versionv4older, still runs
Lines of code76
Settings9inputs
LicenceMIT
Last update2 weeks ago8 Nov 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

76 lines of Pine Script v4 from assets/indicator/bit-exact/easy_entry_exit_trend_colors_with_alerts_iheGVlUr.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

easy_entry_exit_trend_colors_with_alerts_iheGVlUr.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © countseven12 (PostalCrypt)

//@version=4
study("Easy Entry/Exit Trend Colors (With Alerts)", overlay=false)

length = input(10, minval=1, title="BB Periods")
dev = input(1, minval=0.0001, title="Deviations")

//MACD
fastLength = input(12, minval=1, title="FastLength") 
slowLength=input(26,minval=1, title="SlowLength")
signalLength=input(9,minval=1, title="SignalLength")
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA
multiscale = input(10000, minval=1, title="Scaling for ALTS")
scaleFactor = 100 / input(30, "% of vertical space used", step = 10, maxval = 100)

//DEATH AND GOLDEN CROSS
fast_period = input(50, minval=1, title="Short-Term SMA Length")
slow_period = input(200, minval=1, title="Long-Term SMA Length")


fastMA1 = sma(close, fast_period)
slowMA1 = sma(close, slow_period)
golden_cross = cross(slowMA1,fastMA1) and fastMA1[1] <= slowMA1[1]
death_cross = cross(slowMA1,fastMA1) and slowMA1[1] <= fastMA1[1] 


//plot(fastMA1, color=color.red)
//plot(slowMA1, color=color.blue)
//plot(cross(fastMA1, slowMA1) ? fastMA1 : na, color = (slowMA1 - fastMA1 > 0 ? color.red : color.lime) , style = shape.circle, linewidth = 4)
plotshape(death_cross ? fastMA1 : na, color=#880E4F, text="Death Cross", textcolor=color.white, style=shape.labeldown, location=location.top, title="Death Cross Text")
plotshape(golden_cross ? fastMA1 : na, color=color.lime, text="Golden Cross", textcolor=color.black, style=shape.labeldown, location=location.bottom, title="Golden Cross Text")
colorpick = cross(slowMA1,fastMA1) and slowMA1[1] <= fastMA1[1] ? #880E4F : na
colorpick1 = cross(slowMA1,fastMA1) and fastMA1[1] <= slowMA1[1] ? color.lime : na
bgcolor(colorpick, transp=10)
bgcolor(colorpick1, transp=10)

//BollingerBands

Std = stdev(macd, length)
Upper = (Std * dev + (sma(macd, length)))
Lower = ((sma(macd, length)) - (Std * dev))


Band1 = plot(Upper, color=color.gray, style=plot.style_line, linewidth=2,title="Upper Band")
Band2 = plot(Lower, color=color.gray, style=plot.style_line, linewidth=2,title="Lower Band")
fill(Band1, Band2, color=color.blue, transp=75,title="Fill")

//mc = macd >= Upper ? color.lime : color.red
mcl = macd >= Upper ? color.lime : na
mcr = macd <= Upper ? color.red : na
crossoverBear = cross(macd, Upper) and macd < Upper ? avg(macd, Upper) : na
crossoverBull = cross(macd, Upper) and macd > Upper ? avg(macd, Upper) : na

// Indicator
plotshape(crossoverBear, title='Bear MACD', style=shape.xcross, text='Bear', location=location.absolute, color=color.red, textcolor=color.red, size=size.normal) 
plotshape(crossoverBull, title='Bull MACD', style=shape.diamond, text='Bull', location=location.absolute, color=color.lime, textcolor=color.lime, size=size.normal)
plotshape(macd, color=mcl, style=shape.triangleup, title="Green Triangles", location=location.absolute, size=size.tiny)
plotshape(macd, color=mcr, style=shape.triangledown, title="Red Triangles", location=location.absolute, size=size.tiny)
zeroline = 0 
plot(zeroline, color= color.orange,linewidth= 1,title="Zeroline")

//buy
barcolor(macd >Upper ? color.yellow:na)
//short
barcolor(macd <Lower ? color.aqua:na)

//Volume
//barColorsOnPrevClose = false
//palette = barColorsOnPrevClose ? close[1] > close ? color.red : color.green : open > close ? color.red : color.green

//plot(volume/multiscale, color = palette, style=plot.style_area, title="Volume", transp=75)
//plot(volume/multiscale*-1, color = palette, style=plot.style_area, title="Volume", transp=75)

Overview

Easy Entry/Exit Trend Colors (With Alerts) calculates MACD using exponential moving averages and builds upper and lower volatility bands around it. Additionally, it identifies golden cross and death cross conditions using 50-period and 200-period simple moving averages. The indicator plots shape markers, background highlights, and colors price bars yellow or aqua when MACD breaks past the bands. Main settings control MACD parameters, band standard deviations, and SMA periods. It renders in a separate pane while recoloring candles on the main price chart.

Details

Published by

theonetrade on GitHub

Code credit

countseven12 (PostalCrypt), as written in the script's header

Type

Indicator, Pine Script v4

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

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
BB Periodsint10length
Deviationsint1dev
FastLengthint12fastLength
SlowLengthint26slowLength
SignalLengthint9signalLength
Scaling for ALTSint10000multiscale
% of vertical space usedint30% of vertical space used
Short-Term SMA Lengthint50fast_period
Long-Term SMA Lengthint200slow_period
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

MACD-V

by harryguiacorn
220 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V

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 2 years ago · None stated GitHub repository of MultiIndicator

PPO ATR Bands

by cryptorife
75 stars

PPO ATR Bands plots a percentage price oscillator in a separate pane. It compares a Hull average of typical price with a volume-weighted exponential average of Parabolic SAR, then scales three true-range bands around the slow average into matching oscillator l

Indicator v4 Oscillators & momentumMoving averages
Updated 3 years ago · GPL-3.0 GitHub repository of PPO ATR Bands

This indicator plots a relative strength index in a separate pane. It calculates RSI from the average of the previous ten opens rather than the current bar, so that source does not change during the live candle. A moving average of the RSI is plotted and can b

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of No Repaint - Relative Strength Index

More Oscillators & momentum 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