Indicator · Pine Script v5 · On the chart

Speed of Tape [ATAS Style]

by pranay123-stack· code credited to Speed of Tape - ATAS Style

A price-chart overlay that estimates how fast trading is happening and paints candles when that speed is unusually high.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code89
Settings12inputs
LicenceNone statedfile: MPL-2.0
Last update5 weeks ago24 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

89 lines of Pine Script v5 from Tradingview Trading Strategy/ATAS_SpeedOfTape.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

ATAS_SpeedOfTape.pine
// This Pine Script™ source code is subject to the terms of the Mozilla Public License 2.0
// https://mozilla.org/MPL/2.0/
// © Speed of Tape - ATAS Style
// Measures transaction speed (trades per time unit) and colors candles when speed exceeds threshold

//@version=5
indicator("Speed of Tape [ATAS Style]", shorttitle="SOT", overlay=true)

// === INPUTS ===
string GRP1 = "Speed Calculation"
calcType = input.string("Tick Count", "Speed Type", options=["Tick Count", "Volume", "Delta"], group=GRP1, tooltip="Tick Count = Number of trades (ATAS default)")
periodSeconds = input.int(5, "Period (seconds)", minval=1, maxval=60, group=GRP1, tooltip="Time interval for speed calculation")

string GRP2 = "Filter Settings"
useAutoFilter = input.bool(true, "Auto Filter", group=GRP2, tooltip="Automatically calculate threshold (recommended)")
autoFilterPeriod = input.int(20, "Auto Filter Period", minval=5, maxval=100, group=GRP2, tooltip="Bars for auto threshold calculation")
manualThreshold = input.float(1.5, "Manual Threshold", minval=0.5, step=0.1, group=GRP2, tooltip="Used when Auto Filter is OFF")

string GRP3 = "Colors"
normalColor = input.color(color.new(color.gray, 100), "Normal (transparent)", group=GRP3)
maxSpeedColor = input.color(color.yellow, "Max Speed Color (Yellow)", group=GRP3)
paintBars = input.bool(true, "Paint Bars", group=GRP3, tooltip="Color candles when speed exceeds threshold")

string GRP4 = "Display"
showHistogram = input.bool(false, "Show Speed Histogram", group=GRP4)
showSMA = input.bool(false, "Show SMA Line", group=GRP4)
smaPeriod = input.int(10, "SMA Period", minval=1, group=GRP4)
showTable = input.bool(true, "Show Info Panel", group=GRP4)

// === SPEED OF TAPE CALCULATION ===
// ATAS Formula: Speed = number of transactions / time (seconds)
// Since TradingView doesn't have tick count, we approximate using:
// - Volume as proxy for transaction count
// - Timeframe to estimate seconds per bar

// Get timeframe in minutes
tfMultiplier = timeframe.multiplier
tfSeconds = timeframe.isseconds ? tfMultiplier : timeframe.isminutes ? tfMultiplier * 60 : timeframe.isdaily ? tfMultiplier * 86400 : 60

// Calculate speed based on selected type
float rawSpeed = switch calcType
    "Tick Count" => volume / tfSeconds * periodSeconds  // Approximate tick count using volume
    "Volume" => volume / tfSeconds * periodSeconds
    "Delta" => math.abs(close - open) / tfSeconds * periodSeconds
    => volume / tfSeconds * periodSeconds

// === AUTO FILTER (ATAS Style) ===
avgSpeed = ta.sma(rawSpeed, autoFilterPeriod)
stdSpeed = ta.stdev(rawSpeed, autoFilterPeriod)

// Auto threshold: mean + 1 standard deviation (captures unusual speed)
autoThreshold = avgSpeed + stdSpeed

// Use auto or manual threshold
threshold = useAutoFilter ? autoThreshold : avgSpeed * manualThreshold

// Determine if current bar has high speed
isHighSpeed = rawSpeed > threshold

// === PAINT BARS (ATAS STYLE) ===
barcolor(paintBars and isHighSpeed ? maxSpeedColor : na)

// === OPTIONAL HISTOGRAM ===
plot(showHistogram ? rawSpeed : na, "Speed", color=isHighSpeed ? maxSpeedColor : color.gray, style=plot.style_histogram)
plot(showHistogram and showSMA ? ta.sma(rawSpeed, smaPeriod) : na, "SMA", color=color.white, linewidth=2)
plot(showHistogram ? threshold : na, "Threshold", color=color.red, linewidth=1, style=plot.style_stepline)

// === INFO TABLE ===
var table tbl = table.new(position.top_right, 2, 5, bgcolor=color.new(color.black, 85), border_width=1)

if showTable and barstate.islast
    statusText = isHighSpeed ? "HIGH SPEED" : "NORMAL"
    statusCol = isHighSpeed ? maxSpeedColor : color.white
    filterText = useAutoFilter ? "AUTO" : "MANUAL"

    table.cell(tbl, 0, 0, "Speed of Tape", text_color=color.white, text_size=size.small, bgcolor=color.new(color.teal, 60))
    table.cell(tbl, 1, 0, "", bgcolor=color.new(color.teal, 60))
    table.cell(tbl, 0, 1, "Speed", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 1, str.tostring(rawSpeed, "#.##"), text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 0, 2, "Threshold", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 2, str.tostring(threshold, "#.##"), text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 0, 3, "Status", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 3, statusText, text_color=statusCol, text_size=size.tiny)
    table.cell(tbl, 0, 4, "Filter", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 4, filterText, text_color=color.white, text_size=size.tiny)

// === ALERTS ===
alertcondition(isHighSpeed and not isHighSpeed[1], "High Speed Detected", "Speed of Tape: High transaction speed!")
alertcondition(not isHighSpeed and isHighSpeed[1], "Speed Normalized", "Speed of Tape: Speed returning to normal")

Overview

Because TradingView has no tick count, it approximates speed from volume or from the bar body, scaled by the timeframe and a chosen period in seconds. The threshold is the recent average plus one standard deviation, or a manual multiple of the average. An optional histogram, moving average and info panel are available. The measure is an approximation of the original idea.

Details

Published by

pranay123-stack on GitHub

Code credit

Speed of Tape - ATAS Style, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Volume

Markets

Any symbol

Timeframes

M1-M5, M15-H1

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

algo-trading-strategy

Settings

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

SettingTypeDefaultVariable
Speed TypestringTick CountcalcType
Period (seconds)int5periodSeconds
Auto FilterbooltrueuseAutoFilter
Auto Filter Periodint20autoFilterPeriod
Manual Thresholdfloat1.5manualThreshold
Normal (transparent)colorcolor.new(color.gray, 100)normalColor
Max Speed Color (Yellow)colorcolor.yellowmaxSpeedColor
Paint BarsbooltruepaintBars
Show Speed HistogramboolfalseshowHistogram
Show SMA LineboolfalseshowSMA
SMA Periodint10smaPeriod
Show Info PanelbooltrueshowTable
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

Calculates an Elastic Volume Weighted Moving Average (EVWMA), incorporating trading volume to dynamically adjust moving average responsiveness over a specified lookback length. It plots directly on the price chart as a single moving average line. Optional colo

Indicator v4 Moving averagesVolume
Updated 11 days ago · GPL-3.0 GitHub repository of Elastic Volume Weighted Moving Average

This overlay indicator screens a pasted list of up to forty symbols and draws a table on the price chart. It classifies bullish or bearish setups from the percent change between the current candle and the candle 250 bars back, then shows RSI with a simple movi

Indicator v5 Oscillators & momentumVolume
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup

This overlay indicator draws a fixed-range volume profile on the price chart, splitting traded activity into up and down volume at each price level. It also plots a sentiment profile, a developing point of control, and value-area high and low around a configur

Indicator v5 VolumeSupport & resistance
Updated 2 months ago · MIT GitHub repository of Volume Profile and Indicator by DGT

META-tracker

by Allen1212
303 stars

This indicator overlays historical ARK Invest buy and sell events for META on the price chart. It places green labels below bars for purchases and red labels above bars for sales, with a same-day count of how many selected ARK ETFs traded the stock. The ETF in

Indicator v4 Volume
Updated 2 years ago · None stated GitHub repository of META-tracker
219 stars

An educational Pine Script v4 indicator demonstrating how to plot volume histograms on the main price chart using unscaled axes. The code includes examples and commented templates for creating vertical line markers at specific dates or time zones, such as mark

Indicator v4 Sessions & timeVolume
Updated 5 years ago · None stated GitHub repository of 教學-畫垂直線1

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