Indicator · Pine Script v6 · On the chart

Range

by equitymarkets

Range calculates relative price ranges across four user-specified currency pairs by comparing high and low values against close prices from a secondary timeframe.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code43
Settings5inputs
LicenceMIT
Last update1 year ago15 May 2025

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

43 lines of Pine Script v6 from EA/range.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

range.pine
//@version=6
//strategy("Range", overlay=true, fill_orders_on_standard_ohlc = true)
indicator("Range", overlay = true)

pair1 = input.string("USDJPY")
pair2 = input.string("EURUSD")
pair3 = input.string("GBPUSD")
pair4 = input.string("USDCHF")

//not currently used
period = input.string("240")

float highPrice1 = request.security(pair1, timeframe.period, high)
float lowPrice1 = request.security(pair1, timeframe.period, low)
float pairRange1 = (highPrice1 - lowPrice1)/request.security(pair1,period,close)*100
float highPrice2 = request.security(pair2, timeframe.period, high)
float lowPrice2 = request.security(pair2, timeframe.period, low)
float pairRange2 = (highPrice2 - lowPrice2)/request.security(pair2,period,close)*100
float highPrice3 = request.security(pair3, timeframe.period, high)
float lowPrice3 = request.security(pair3, timeframe.period, low)
float pairRange3 = (highPrice3 - lowPrice3)/request.security(pair3,period,close)*100
float highPrice4 = request.security(pair4, timeframe.period, high)
float lowPrice4 = request.security(pair4, timeframe.period, low)
float pairRange4 = (highPrice4 - lowPrice4)/request.security(pair4,period,close)*100

float meanRange = (pairRange1 + pairRange2 + pairRange3 + pairRange4)/4

var table spreadDisplay = table.new(position.top_right, 1, 1)

table.set_bgcolor(spreadDisplay, color.white)

// float highPrice = request.security(pair1, period, high)
// float lowPrice = request.security(pair1, period, low)
float highPrice = request.security(syminfo.tickerid, timeframe.period, high)
float lowPrice = request.security(syminfo.tickerid, timeframe.period, low)

float pairRange = highPrice - lowPrice

if barstate.islast
    if pairRange > meanRange
        table.cell(spreadDisplay, 0, 0, str.tostring("volatile"))
    else
        table.cell(spreadDisplay, 0, 0, str.tostring("not volatile"))

Overview

Range computes the average range across these pairs to establish a baseline volatility benchmark. The current chart symbol's high-low range is compared against this mean benchmark, displaying a volatile or not volatile status label in a top-right table on the final bar. Inputs allow customization of the four evaluated symbols and evaluation period.

Details

Published by

equitymarkets on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Volatility & bands, Screeners & dashboards

Markets

Forex

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.

Settings

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

SettingTypeDefaultVariable
pair1stringUSDJPYpair1
pair2stringEURUSDpair2
pair3stringGBPUSDpair3
pair4stringUSDCHFpair4
periodstring240period
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

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup
330 stars

This multi-symbol indicator evaluates a combined trading condition across up to 40 user-defined symbols. It processes MACD bullish crossovers, RSI thresholds, Bollinger Band boundaries, and DMI/ADX trend filters using security calls. When buy or sell criteria

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of Multi MACD + BB + RSI [Alorse]

Pricing Table

by namuan
318 stars

This indicator calculates theoretical options contract values and in-the-money probabilities using historical realized volatility across multiple standard deviations. It displays these metrics in a table overlay directly on the price chart. Users can adjust th

Indicator v4 Volatility & bandsScreeners & dashboards
Updated 2 months ago · MIT GitHub repository of Pricing Table
218 stars

This indicator maps market structure and supply and demand zones on the price chart. It marks validated and optional unvalidated swing highs and lows using a pivot length and extra confirmation bars. Consolidation and impulse moves are measured against ATR to

Indicator v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Market Structure + Supply/Demand
200 stars

Storm Gauge calculates annualized realized volatility and compares it against a historical percentile lookback window to classify market volatility regimes into calm, normal, or storm conditions. Based on a target volatility input, it calculates dynamic positi

Indicator v5 Volatility & bandsScreeners & dashboards
Updated 3 months ago · MIT GitHub repository of Storm Gauge — Vol Regime + Position Size

8zz反指標v2

by hansai-art
121 stars

The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab

Indicator v6 Moving averagesOscillators & momentum
Updated 3 months ago · None stated GitHub repository of 8zz反指標v2

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