Indicator · Pine Script v4 · On the chart

TPCharts Alert Levels

by TPCharts

TPCharts Alert Levels evaluates price breakouts across multiple timeframes, ranging from two minutes up to monthly intervals.

View on GitHub

GitHub stars10on the repository
Pine versionv4older, still runs
Lines of code58
Settings0inputs
LicenceGPL-3.0
Last update5 years ago1 Dec 2020

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

58 lines of Pine Script v4 from TPCharts-Alert-Levels.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

TPCharts-Alert-Levels.pine
//@version=4
study("TPCharts Alert Levels", overlay=true)

// Monthly
isOutsideRangeMh = crossover(close, security(syminfo.tickerid, "M", high[1]))
alertcondition(condition=isOutsideRangeMh, title="M High Cross", message="Crossed over previous monthly high.")

isOutsideRangeMl = crossunder(close, security(syminfo.tickerid, "M", low[1]))
alertcondition(condition=isOutsideRangeMl, title="M Low Cross", message="Crossed under previous monthly low.")

// Weekly
isOutsideRangeWh = crossover(close, security(syminfo.tickerid, "W", high[1]))
alertcondition(condition=isOutsideRangeWh, title="W High Cross",  message="Crossed over previous weekly high.")

isOutsideRangeWl = crossunder(close, security(syminfo.tickerid, "W", low[1]))
alertcondition(condition=isOutsideRangeWl, title="W Low Cross", message="Crossed under previous weekly low.")

// Daily
isOutsideRangeDh = crossover(close, security(syminfo.tickerid, "D", high[1]))
alertcondition(condition=isOutsideRangeDh, title="D High Cross", message="Crossed over previous daily high.")

isOutsideRangeDl = crossunder(close, security(syminfo.tickerid, "D", low[1]))
alertcondition(condition=isOutsideRangeDl, title="D Low Cross", message="Crossed under previous daily low.")

// 4h
isOutsideRangeH4h = crossover(close, security(syminfo.tickerid, "240", high[1]))
alertcondition(condition=isOutsideRangeH4h, title="4h High Cross", message="Crossed over previous 4h high.")

isOutsideRangeH4l = crossunder(close, security(syminfo.tickerid, "240", low[1]))
alertcondition(condition=isOutsideRangeH4l, title="4h Low Cross", message="Crossed under previous 4h low.")

// 1h
isOutsideRangeH1h = crossover(close, security(syminfo.tickerid, "60", high[1]))
alertcondition(condition=isOutsideRangeH1h, title="1h High Cross", message="Crossed over previous 1h high.")

isOutsideRangeH1l = crossunder(close, security(syminfo.tickerid, "60", low[1]))
alertcondition(condition=isOutsideRangeH1l, title="1h Low Cross", message="Crossed under previous 1h low.")

// 15m
isOutsideRange15mh = crossover(close, security(syminfo.tickerid, "15", high[1]))
alertcondition(condition=isOutsideRange15mh, title="15m High Cross", message="Crossed over previous 15m high.")

isOutsideRange15ml = crossunder(close, security(syminfo.tickerid, "15", low[1]))
alertcondition(condition=isOutsideRange15ml, title="15m Low Cross", message="Crossed under previous 15m low.")

// 5m
isOutsideRange5mh = crossover(close, security(syminfo.tickerid, "5", high[1]))
alertcondition(condition=isOutsideRange15mh, title="5m High Cross", message="Crossed over previous 5m high.")

isOutsideRange5ml = crossunder(close, security(syminfo.tickerid, "5", low[1]))
alertcondition(condition=isOutsideRange15ml, title="5m Low Cross", message="Crossed under previous 5m low.") 

// 2m
isOutsideRange2mh = crossover(close, security(syminfo.tickerid, "2", high[1]))
alertcondition(condition=isOutsideRange2mh, title="2m High Cross", message="Crossed over previous 2m high.")

isOutsideRange2ml = crossunder(close, security(syminfo.tickerid, "2", low[1]))
alertcondition(condition=isOutsideRange2ml, title="2m Low Cross", message="Crossed under previous 2m low.")

Overview

TPCharts Alert Levels checks whether the current close crosses above the previous bar high or crosses below the previous bar low using higher-timeframe security calls. Built-in alert conditions notify traders when these breakout thresholds are breached for monthly, weekly, daily, four-hour, hourly, 15-minute, 5-minute, and 2-minute horizons. The indicator runs on the main price chart without plotting visual levels and offers no user-adjustable input settings.

Details

Published by

TPCharts on GitHub

Type

Indicator, Pine Script v4

Draws

On the price chart

Category

Support & resistance, Breakout

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.

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

Sideway Zones Live

by dearvn
257 stars

Sideway Zones Live is an overlay indicator that estimates inner and outer sideways bands from recent highs and lows with a rational quadratic kernel. It tracks swing pivots over a loopback period and counts bars that remain between the outer high and low. Afte

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Sideway Zones Live
219 stars

This indicator identifies High Of Low Price (HOLP) and Low Of High Price (LOHP) candlestick setups based on price extremes over a specified lookback period. A HOLP signal triggers when the current bar closes above the high of a recent session low, whereas a LO

Indicator v5 Candlestick patternsBreakout
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns - HOLP-LOHP
218 stars

This indicator plots dynamic support and resistance levels on the price chart. It detects pivot highs and lows using the pivot length and tracks touches to build strength-based levels. Support and resistance zones appear as colored boxes while lines mark key l

Indicator v6 Support & resistanceBreakout
Updated 3 months ago · None stated GitHub repository of Dynamic Support & Resistance

Donchian Channels (DC)

by mihakralj
99 stars

This indicator calculates and plots Donchian Channels directly on the price chart. It determines the highest high and lowest low over a user-selected lookback period using an optimized monotonic deque algorithm, as well as a middle basis line computed as their

Indicator v6 Volatility & bandsSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Donchian Channels (DC)

Lows from New Highs

by be-thomas
65 stars

This indicator tracks bar lows during consecutive rising highs using Pine Script arrays. When at least four lows accumulate or the price breaches the minimum low in the stack, the script sorts the recorded lows in ascending order and flushes them. It plots up

Indicator v4 Support & resistanceBreakout
Updated 4 days ago · GPL-3.0 GitHub repository of Lows from New Highs

This indicator tracks smart money market structure directly on the price chart. It calculates dual-period swing highs and swing lows to detect Changes of Character (CHoCH), Breaks of Structure (BOS), inducements, and liquidity sweeps. When structural levels ar

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · Apache-2.0 GitHub repository of Market Structure with Inducements & Sweeps [LuxAlgo]

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