Indicator · Pine Script v5 · On the chart

Quantitative Stock Confluence Finder

by DouglasVolcato

The Quantitative Stock Confluence Finder is a Pine Script v5 indicator that plots technical elements directly on the price chart to help identify potential confluence zones in stocks.

View on GitHub

Repaints

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code105
Settings22inputs
LicenceNone statedfile: MPL-2.0
Last update2 years ago16 Dec 2023

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

105 lines of Pine Script v5 from quantitative_stock_confluence_finder.pinescript, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

quantitative_stock_confluence_finder.pinescript
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Author: Douglas_Volcato
//Some lines are commented due to TradingView line quantity limit

//@version=5
indicator("Quantitative stock confluence finder", overlay=true)

intraday_analysis = input(false, 'Use day openning price as source')
source_price_input = input.float(4920.00, 'Source price')

sma_length = input(25, title="Simple moving average length")
sma_band_distance = input(10, title="Moving average bands distance")
sma_band_line_width = input(1, title="Moving average bands line width")
sma_band_line_color = input(color.white, title="Moving average bands line color")

distance_from_source_price_band = input(16, title="Distance from source price bands")
source_price_band_width = input(7, title="Source price bands width")
source_price_band_line_color = input(color.yellow, title="Source price bands line color")
source_price_band_line_width = input(1, title="Source price bands line width")
source_price_band_above_bg_color = input(color.red, title="Source price bands above background color")
source_price_band_below_bg_color = input(color.green, title="Source price bands below background color")
source_price_band_transp = input(90, title="Source price bands backgroung transparency")

slow_stochastic_length = input(20, title = 'Slow stochastic length')
slow_stochastic_above = input(80, title = 'Slow stochastic signal above')
slow_stochastic_below = input(20, title = 'Slow stochastic signal below')
slow_stochastic_upper_color = input(color.green, title = 'Slow stochastic signal upper arrow color')
slow_stochastic_lower_color = input(color.red, title = 'Slow stochastic signal lower arrow color')

percentage_distance = input.float(0.5, title="Percentage Distance (%)", minval=0.1, maxval=10, step=0.1)
percentage_line_width = input(2, title="Percentage line width")
percentage_above_color = input(color.red, title="Percentage line color")
percentage_below_color = input(color.green, title="Percentage line color")

[do,dh,dl] = request.security(syminfo.tickerid, "D", [open,high,low], lookahead=barmerge.lookahead_on)
source_price = intraday_analysis ? source_price_input : do

//sma bands
sma_value = ta.sma(close, sma_length)
plot(sma_value, color=color.aqua, linewidth=sma_band_line_width)
plot(sma_value + (sma_band_distance * 1), color=sma_band_line_color, linewidth=sma_band_line_width)
plot(sma_value + (sma_band_distance * 2), color=sma_band_line_color, linewidth=sma_band_line_width)
// plot(sma_value + (sma_band_distance * 3), color=sma_band_line_color, linewidth=sma_band_line_width)
// plot(sma_value + (sma_band_distance * 4), color=sma_band_line_color, linewidth=sma_band_line_width)
plot(sma_value - (sma_band_distance * 1), color=sma_band_line_color, linewidth=sma_band_line_width)
plot(sma_value - (sma_band_distance * 2), color=sma_band_line_color, linewidth=sma_band_line_width)
// plot(sma_value - (sma_band_distance * 3), color=sma_band_line_color, linewidth=sma_band_line_width)
// plot(sma_value - (sma_band_distance * 4), color=sma_band_line_color, linewidth=sma_band_line_width)

//distance from day opening lines
plot(source_price, title="Open", color=color.aqua,linewidth=source_price_band_line_width)
line1 = plot(source_price + (distance_from_source_price_band * 1), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
line2 = plot(source_price + (distance_from_source_price_band * 1) + source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
fill(line1, line2, color=color.new(source_price_band_above_bg_color, source_price_band_transp))
line3 = plot(source_price + (distance_from_source_price_band * 2), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
line4 = plot(source_price + (distance_from_source_price_band * 2) + source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
fill(line3, line4, color=color.new(source_price_band_above_bg_color, source_price_band_transp))
line5 = plot(source_price + (distance_from_source_price_band * 3), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
line6 = plot(source_price + (distance_from_source_price_band * 3) + source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
fill(line5, line6, color=color.new(source_price_band_above_bg_color, source_price_band_transp))
// line7 = plot(source_price + (distance_from_source_price_band * 4), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
// line8 = plot(source_price + (distance_from_source_price_band * 4) + source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
// fill(line7, line8, color=color.new(source_price_band_above_bg_color, source_price_band_transp))
line9 = plot(source_price - (distance_from_source_price_band * 1), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
line10 = plot(source_price - (distance_from_source_price_band * 1) - source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
fill(line9, line10, color=color.new(source_price_band_below_bg_color, source_price_band_transp))
line11 = plot(source_price - (distance_from_source_price_band * 2), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
line12 = plot(source_price - (distance_from_source_price_band * 2) - source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
fill(line11, line12, color=color.new(source_price_band_below_bg_color, source_price_band_transp))
line13 = plot(source_price - (distance_from_source_price_band * 3), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
line14 = plot(source_price - (distance_from_source_price_band * 3) - source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
fill(line13, line14, color=color.new(source_price_band_below_bg_color, source_price_band_transp))
// line15 = plot(source_price - (distance_from_source_price_band * 4), title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
// line16 = plot(source_price - (distance_from_source_price_band * 4) - source_price_band_width, title="Open", color=source_price_band_line_color,linewidth=source_price_band_line_width)
// fill(line15, line16, color=color.new(source_price_band_below_bg_color, source_price_band_transp))

//slow stochastic signal
last_candle_stoch_value = ta.stoch(close[1], high[1], low[1], slow_stochastic_length)
arrow_direction = 0
if (last_candle_stoch_value >= slow_stochastic_above) 
    arrow_direction := -1
else if (last_candle_stoch_value <= slow_stochastic_below) 
    arrow_direction := 1
else
    arrow_direction := 0
plotarrow(arrow_direction, colordown=slow_stochastic_lower_color,colorup=slow_stochastic_upper_color, offset=1,maxheight=17)

//percentage zones
percentage_distance_value = (percentage_distance * source_price) / 100
plot(source_price + percentage_distance_value, "1", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price + 2 * percentage_distance_value, "2", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price + 3 * percentage_distance_value, "3", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price + 4 * percentage_distance_value, "4", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price + 5 * percentage_distance_value, "4", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
// plot(source_price + 6 * percentage_distance_value, "4", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
// plot(source_price + 7 * percentage_distance_value, "4", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
// plot(source_price + 8 * percentage_distance_value, "4", color=percentage_above_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price - percentage_distance_value, "-1", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price - 2 * percentage_distance_value, "-2", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price - 3 * percentage_distance_value, "-3", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price - 4 * percentage_distance_value, "-4", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
plot(source_price - 5 * percentage_distance_value, "-4", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
// plot(source_price - 6 * percentage_distance_value, "-4", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
// plot(source_price - 7 * percentage_distance_value, "-4", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)
// plot(source_price - 8 * percentage_distance_value, "-4", color=percentage_below_color, linewidth=percentage_line_width, style = plot.style_circles)

Overview

Quantitative Stock Confluence Finder calculates and displays bands around a simple moving average with adjustable distance, plus bands offset from the daily opening price (which can be overridden for intraday analysis). It also plots a slow stochastic oscillator along with arrows signaling overbought and oversold conditions and overlays percentage distance zones. All plots use user-defined colors, widths, and thresholds. The script serves as a visualization aid without predefined entry or exit rules or position sizing.

Details

Published by

DouglasVolcato on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Moving averages, Oscillators & momentum, Support & resistance

Markets

Stocks

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)
  • Reads higher-timeframe data with lookahead on, so the history can show signals that were not there in real time

Topics

pinescriptpinescript-indicatorstradingtrading-algorithmstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
Use day openning price as sourceboolfalseintraday_analysis
Source pricefloat4920.00source_price_input
Simple moving average lengthint25sma_length
Moving average bands distanceint10sma_band_distance
Moving average bands line widthint1sma_band_line_width
Moving average bands line colorcolorcolor.whitesma_band_line_color
Distance from source price bandsint16distance_from_source_price_band
Source price bands widthint7source_price_band_width
Source price bands line colorcolorcolor.yellowsource_price_band_line_color
Source price bands line widthint1source_price_band_line_width
Source price bands above background colorcolorcolor.redsource_price_band_above_bg_color
Source price bands below background colorcolorcolor.greensource_price_band_below_bg_color
Show all 22 settings
SettingTypeDefaultVariable
Source price bands backgroung transparencyint90source_price_band_transp
Slow stochastic lengthint20slow_stochastic_length
Slow stochastic signal aboveint80slow_stochastic_above
Slow stochastic signal belowint20slow_stochastic_below
Slow stochastic signal upper arrow colorcolorcolor.greenslow_stochastic_upper_color
Slow stochastic signal lower arrow colorcolorcolor.redslow_stochastic_lower_color
Percentage Distance (%)float0.5percentage_distance
Percentage line widthint2percentage_line_width
Percentage line colorcolorcolor.redpercentage_above_color
Percentage line colorcolorcolor.greenpercentage_below_color
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

PivotHighLow

by Alorse
330 stars

This indicator calculates pivot high and pivot low points on the price chart based on configurable left and right bar counts. Confirmed pivot highs and lows are plotted with negative bar offsets directly on the price chart using line and cross styles. Addition

Indicator v4 Support & resistanceOscillators & momentum Repaints
Updated 2 months ago · None stated GitHub repository of PivotHighLow
23 stars

This indicator collection calculates and plots previous daily high and low price levels on the chart to identify potential supply and demand zones. It includes real-time intraday high and low calculations, RSI divergence detection across a customizable period

Indicator v4 Support & resistanceDivergence
Updated 3 years ago · None stated GitHub repository of Daily High and Low Strategy

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

BTE Acc AO SMIO

by f-cksociety
11 stars

This script provides an indicator-based backtesting engine framework that simulates trade entries, exits, and filtering directly on the price chart. It evaluates selected entry rules and multi-layered filters, including moving average trends, volume increases,

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of BTE Acc AO SMIO
5 stars

This indicator combines pivot-based support and resistance levels with multi-timeframe MACD crossovers and a higher-timeframe exponential moving average trend filter. It identifies support and resistance touches using pivot highs and lows within a user-defined

Indicator v4 Oscillators & momentumSupport & resistance Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of MACD + Support / Resistance

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