Indicator · Pine Script v5 · Own pane

CSW Tick Internals

by g-moe· code credited to goodgains

This indicator calculates and plots the NYSE Cumulative Tick Index as colored candles in a separate pane, with green indicating upward tick trends and red downward trends.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code78
Settings1inputs
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

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

csw-tick-internals.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("CSW Tick Internals")

// @keywords: nyse-tick, cumulative-tick, tick-candles, overbought-zone, oversold-zone, market-internals, intraday-only, tick-trend, zero-line, extreme-readings, session-filter, plot-candles, horizontal-lines, zone-fill, ema-smoothing, tick-index, breadth, advance-decline, trend-direction, us-session

//--INSTRUCTIONS--//
instructions_tooltip = "• The CSW Tick Internals uses the NYSE Cumulative Tick to show traders the number of stocks that are 
 \nrising vs the number of stocks that are falling on the New York Stock Exchange. The CSW Tick Indicator allows traders to more 
 \neasily read the TICK Index chart. It does this by showing traders colored tick candles and overbought / oversold areas. 
 \nGreen candles mean that the current TICK trend is UP and Red candles mean that the current TICK trend is DOWN. 
 \nReadings that occur in the overbought or oversold areas mean that the market is showing great strength or great weakness. 
 \nTypically when we get into these zones we can see potential reversals; however, sometimes the strong readings are indicating
 \nthat a very strong trend is taking place and the trend could continue. That is why it is best to pair this indicator with other
 \ntools to enhance its usefulness. 
 \n\nThe CSW Tick Interals are meant to be used ONLY small intraday timeframes (1min - 5min) and ONLY on U.S. equities or U.S. equity options. 
 \nThe NYSE TICK index only runs during U.S. Market Hours; therefore, the CSW TICK Internals will only work from 0930-1600 EST"

instructions = input.bool(title='Show Instructions', defval=false, inline='1', tooltip = instructions_tooltip)
if barstate.islast and instructions
    var label instruction_label = na
    if not na(instruction_label[1])
        label.delete(instruction_label[1])
    instruction_label := label.new(bar_index + 5, close, instructions_tooltip, xloc = xloc.bar_index , yloc = yloc.price, color = color.black , style = label.style_label_left, textcolor = color.white, size = size.large, textalign = text.align_left) 
//--INSTRUCTIONS--//

period = 20
smooth = 5
lookback = 4

o = request.security("USI:TICK", "", open,barmerge.gaps_off, barmerge.lookahead_on)
h = request.security("USI:TICK", "", high,barmerge.gaps_off, barmerge.lookahead_on)
l = request.security("USI:TICK", "", low,barmerge.gaps_off, barmerge.lookahead_on)
c = request.security("USI:TICK", "", close,barmerge.gaps_off, barmerge.lookahead_on)

var htick = 0.00
var ltick = 0.00
htick := nz(h,htick[1])
ltick := nz(l,ltick[1])

var avgh = 0.00
var avgl = 0.00
avgh := ta.sma(htick,period)
avgl := ta.sma(ltick,period)

var avg_h_fix = 0.00
avg_h_fix := math.max(300,ta.ema(htick - avgh[1],period))
var avg_l_fix = 0.00
avg_l_fix := math.min(-300,ta.ema(ltick - avgl[1],period))

amean = na(close) ? na : (avg_h_fix + avg_l_fix) / 2
trendmean = (htick > avg_h_fix or ltick < avg_l_fix) ? amean : 0

bull = htick > avg_h_fix ? htick - avg_h_fix  : 0
bear = ltick < avg_l_fix ? ltick - avg_l_fix  : 0

var ctick = 0.00
ctick := bar_index == 1 ? 0 : na(htick) or na(ltick) ? ctick[1] : ctick[1] + bull + bear + trendmean

ctickavg = ta.ema(ctick, smooth)
cumtick = na(close) ? na : ctickavg

us_session = time("",'0930-1600', "America/New_York")
tick_trend_coloring = not us_session ? 0 : cumtick > cumtick[lookback] ? 1 : -1

plotcandle(tick_trend_coloring == 1 ? o : na , tick_trend_coloring == 1 ? h : na , tick_trend_coloring == 1 ? l : na , tick_trend_coloring == 1 ? c : na , title='Bull Trend', color = color.new(#26a69a,0), wickcolor=color.new(#26a69a,0), bordercolor = color.new(#26a69a,30))
plotcandle(tick_trend_coloring == -1 ? o : na , tick_trend_coloring == -1 ? h : na , tick_trend_coloring == -1 ? l : na , tick_trend_coloring == -1 ? c : na , title='Bear Trend', color = color.new(#d32f2f,0), wickcolor=color.new(#d32f2f,0), bordercolor = color.new(#d32f2f,30))

zero = hline(0, "Zero Line", color = color.new(color.white,70), linestyle =  hline.style_dotted)
strong_bull = hline(800, "Strong Bull Reading", color = color.new(color.white,70), linestyle =  hline.style_dashed)
extreme_strong_bull = hline(1000, "Xtreme Bull Reading", color = color.new(color.white,70), linestyle =  hline.style_dashed)
strong_bear = hline(-800, "Strong Bear Reading", color = color.new(color.white,70), linestyle =  hline.style_dashed)
extreme_strong_bear = hline(-1000, "Xtreme Bear Reading", color = color.new(color.white,70), linestyle =  hline.style_dashed)

fill(strong_bull,extreme_strong_bull, color = color.new(#d32f2f,90), title = "Overbought Area")
fill(strong_bear,extreme_strong_bear, color = color.new(#26a69a,90), title = "Oversold Area")

Overview

Overbought and oversold zones are marked using smoothed averages of high and low tick values. The script draws horizontal lines and zone fills for extremes. Main settings control instruction display and parameters like period, smoothing, and lookback. It filters to US session hours only and is designed for intraday use on US equities. The plot is limited to NYSE TICK data and may require pairing with other tools for trading decisions.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

Draws

Separate pane below the chart

Markets

Stocks

Timeframes

M15-H1, M1-M5

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.

Settings

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

SettingTypeDefaultVariable
Show Instructionsboolfalseinstructions
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

1 stars

Overlay indicator for XAUUSD gold that draws predicted support and resistance levels at 08:00 and 19:00 SGT on the price chart along with buy and sell take-profit levels spaced by ATR multiples. It generates RSI reversal signals as triangles when the indicator

Indicator v5 Support & resistanceOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Predicted Signals + RSI trigger

CCI DC

by be-thomas
65 stars

This indicator plots the Commodity Channel Index in a separate pane and surrounds it with a Donchian channel whose lookback length changes with volatility. It measures volatility as a ratio of short and long ATR values, then ranks that ratio and shortens or le

Indicator v5 Oscillators & momentumVolatility & bands
Updated 6 days ago · GPL-3.0 GitHub repository of CCI DC

Market Pressure Scale plots two oscillator curves in a separate pane. Setup pressure combines ATR and Bollinger compression, support and resistance proximity, and drying volume. Impulse pressure combines range expansion, volume, and candle body size. A range-c

Indicator v6 Oscillators & momentumVolatility & bands
Updated 3 days ago · MIT GitHub repository of Market Pressure Scale [WavesUnchained]

QFA Pro Elite Refined

by JasonTeixeira
9 stars

This indicator plots a smoothed fear index in a separate pane. It measures how far the current low sits below the highest close over a lookback, scales that reading by an ATR percentile, and smooths it with a zero-lag EMA. A volatility regime raises or lowers

Indicator v6 Oscillators & momentumVolatility & bands
Updated 2 weeks ago · Custom licence GitHub repository of QFA Pro Elite Refined
7 stars

Range Oscillator (Zeiierman) plots a range-based oscillator in a separate pane. It qualifies a range box from a minimum number of bars and sizes that box vertically with an ATR width multiplier. A heatmap splits the recent high-low span into horizontal levels

Indicator v6 Oscillators & momentumVolatility & bands
Updated 3 months ago · None stated GitHub repository of Range Oscillator (Zeiierman)

MACD Breakout

by jerryinyang
5 stars

This indicator plots a higher-timeframe MACD breakout setup on the price chart and combines it with linear regression channels. It marks support and resistance zones from MACD histogram sensitivity, then filters them with the MACD zero line, a linear regressio

Indicator v4 Oscillators & momentumBreakout
Updated 2 years ago · None stated GitHub repository of MACD Breakout

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