Indicator · Pine Script v6 · On the chart

TTM Scalper Alert

by mihakralj

TTM Scalper Alert marks three-bar pivot highs and lows on the price chart.

View on GitHub

Repaints

GitHub stars99on the repository
Pine versionv6current
Lines of code40
Settings5inputs
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

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

ttmscalper.pine
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("TTM Scalper Alert", "TTM_SCALPER", overlay=true)

//@function Detects 3-bar pivot patterns for scalping entry signals
//@param use_closes Use close prices instead of high/low for pivot detection
//@returns [pivot_high_price, pivot_low_price] Pivot values (na if no pivot)
ttmscalper(bool use_closes = false) =>
    bool is_pivot_high = false
    bool is_pivot_low = false

    if bar_index >= 2
        if use_closes
            is_pivot_high := close[1] > close[2] and close[1] > close[0]
            is_pivot_low := close[1] < close[2] and close[1] < close[0]
        else
            is_pivot_high := high[1] > high[2] and high[1] > high[0]
            is_pivot_low := low[1] < low[2] and low[1] < low[0]

    float pivot_high_price = is_pivot_high ? (use_closes ? close[1] : high[1]) : na
    float pivot_low_price = is_pivot_low ? (use_closes ? close[1] : low[1]) : na

    [pivot_high_price, pivot_low_price]

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

// Inputs
i_use_closes = input.bool(false, "Use Closes", tooltip="Use close prices instead of high/low for pivot detection")
i_show_high = input.bool(true, "Show Pivot Highs", tooltip="Display bearish pivot markers")
i_show_low = input.bool(true, "Show Pivot Lows", tooltip="Display bullish pivot markers")
i_color_high = input.color(color.red, "Pivot High Color")
i_color_low = input.color(color.green, "Pivot Low Color")

// Calculation
[pivot_high, pivot_low] = ttmscalper(i_use_closes)

// Plot pivot markers
plotshape(i_show_high and not na(pivot_high) ? pivot_high : na, "Pivot High", style=shape.triangledown, location=location.absolute, color=i_color_high, size=size.small, offset=-1)
plotshape(i_show_low and not na(pivot_low) ? pivot_low : na, "Pivot Low", style=shape.triangleup, location=location.absolute, color=i_color_low, size=size.small, offset=-1)

Overview

TTM Scalper Alert treats the prior bar as a pivot high when its high exceeds both neighboring highs, and as a pivot low when its low is below both neighboring lows. An optional setting uses closes instead of highs and lows. Small triangles, red for highs and green for lows, are drawn one bar back. Users can hide either side and change colors. Until the live bar closes, that comparison can still change, so the prior pivot marker can appear or disappear. It does not place trades or stops.

Details

Published by

mihakralj on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Support & resistance, Scalping

Markets

Any symbol

Timeframes

M1-M5

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

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
Use Closesboolfalsei_use_closes
Show Pivot Highsbooltruei_show_high
Show Pivot Lowsbooltruei_show_low
Pivot High Colorcolorcolor.redi_color_high
Pivot Low Colorcolorcolor.greeni_color_low
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

Hedge Scalp

by nikita-doronin
30 stars

The Hedge Scalp indicator calculates an Exponential Moving Average (EMA) and generates four long grid levels and one hedged short grid level at user-defined percentage distances below the EMA. It models grid entry execution and average entry take-profit levels

Indicator v5 Moving averagesSupport & resistance
Updated 2 years ago · Custom licence GitHub repository of Hedge Scalp

Scalping Level PRO

by stupenkov
14 stars

Scalping Level PRO identifies key local and global horizontal support and resistance levels across cryptocurrency price charts. It draws level lines based on customizable time periods, calculates Normalized Average True Range (NATR) for volatility assessment,

Indicator v5 Support & resistanceVolatility & bands
Updated 3 years ago · None stated GitHub repository of Scalping Level PRO

SPY 0DTE Scalper - 1m

by chris-c-thomas
14 stars

This overlay indicator marks CALLS and PUTS labels on the price chart when a strict boolean gate of price structure, momentum, volatility, breadth, and candle confirmation all pass. It plots an EMA ribbon with cloud fill, session-anchored VWAP and standard-dev

Indicator v6 ScalpingMoving averages
Updated 6 months ago · MIT GitHub repository of SPY 0DTE Scalper - 1m

Apex Protocol v3.3

by alboogycOdR
6 stars

Apex Protocol v3.3 is a Smart Money Concepts trading indicator that plots order blocks, fair value gaps, BOS and MSS markers, auto Fibonacci levels, area of interest zones and external internal structures on the price chart. It supports multiple killzone sessi

Indicator v5 SMC / ICT / price actionScalping Repaints
Updated 7 months ago · None stated GitHub repository of Apex Protocol v3.3

Scalping PullBack Tool R1.1

by Ahmed-GoCode
5 stars

This indicator plots a Price Action Channel (PAC) based on high, low, and close moving averages alongside fast, medium, and slow trend EMAs directly on the price chart. It detects regular and Bill Williams fractals to track market structure and identifies pull

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Scalping PullBack Tool R1.1
4 stars

This TradingView indicator provides scalping money management tools by displaying a customizable panel on the chart. It shows risk management details such as deposit size, maximum risk per trade as a percentage, and commission adjustments. The indicator plots

Indicator v5 ScalpingScreeners & dashboards
Updated 3 years ago · MIT GitHub repository of Scalping Money Management

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