Strategy · Pine Script v6 · On the chart

Conduit OBV AccDist

by pineforge-4pass· code credited to PineForge

A long-only strategy that requires two volume flow measures to agree: On Balance Volume and Accumulation/Distribution, each compared with its own EMA.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code39
Settings5inputs
LicenceApache-2.0
Last update6 days ago23 Oct 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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

39 lines of Pine Script v6 from validation/ta-conduit-obv-accdist-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
//@version=6
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 PineForge
// PineForge Owned Strategy: Conduit OBV AccDist
// Two independently accumulated volume flows must confirm the same direction.
strategy("PineForge — Conduit OBV AccDist", overlay=true,
     initial_capital=100000,
     default_qty_type=strategy.fixed, default_qty_value=2,
     pyramiding=0, commission_type=strategy.commission.percent,
     commission_value=0.05, slippage=1,
     margin_long=100, margin_short=100,
     process_orders_on_close=false, calc_on_order_fills=false)

obvSignalLength = input.int(29, "OBV Signal Length", minval=3, group="Volume Flow")
accDistSignalLength = input.int(37, "AccDist Signal Length", minval=3, group="Volume Flow")
priceFilterLength = input.int(52, "Price Filter Length", minval=5, group="Trend")
atrLength = input.int(16, "ATR Length", minval=2, group="Risk")
maximumAtrLoss = input.float(2.4, "Maximum ATR Loss", minval=0.5, step=0.1, group="Risk")

obvValue = ta.obv
accDistValue = ta.accdist
obvSignal = ta.ema(obvValue, obvSignalLength)
accDistSignal = ta.ema(accDistValue, accDistSignalLength)
priceFilter = ta.ema(close, priceFilterLength)
atrValue = ta.atr(atrLength)

flowAgreement = obvValue > obvSignal and accDistValue > accDistSignal
enterLong = flowAgreement and not flowAgreement[1] and close > priceFilter
flowEnded = not flowAgreement or close < priceFilter
riskExceeded = strategy.position_size > 0 and close < strategy.position_avg_price - atrValue * maximumAtrLoss

if strategy.position_size == 0 and enterLong
    strategy.entry("Conduit Long", strategy.long)
else if strategy.position_size > 0 and (flowEnded or riskExceeded)
    strategy.close("Conduit Long", comment=riskExceeded ? "ATR risk" : "Flow ended")

plot(priceFilter, "Price Filter", color=color.orange)
plot(obvValue - obvSignal, "OBV Distance", color=color.blue, display=display.data_window)
plot(accDistValue - accDistSignal, "AccDist Distance", color=color.green, display=display.data_window)

Overview

Conduit OBV AccDist enters long when both are above their signals for the first time and price is above a longer EMA filter. It exits when agreement ends, price drops below the filter, or price falls a set multiple of ATR below entry. The price filter line is drawn on the chart.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge, as written in the script's header

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Volume, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Settings

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

SettingTypeDefaultVariable
OBV Signal Lengthint29obvSignalLength
AccDist Signal Lengthint37accDistSignalLength
Price Filter Lengthint52priceFilterLength
ATR Lengthint16atrLength
Maximum ATR Lossfloat2.4maximumAtrLoss
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

218 stars

This strategy enters long when a faster moving average crosses above a slower one and short when it crosses below, unless long-only mode is on. An optional volume filter requires volume above a 20-bar average times a multiplier. Exits use a percentage stop los

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of MA Cross Strategy Template
106 stars

This Pine Script strategy identifies potential Buy Today, Sell Tomorrow (BTST) opportunities based on price action and volume patterns. It calculates a 20-period simple moving average of volume and checks for three consecutive bullish candles with higher highs

Strategy v4 TrendVolume
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Higher High Price & Vol
23 stars

This strategy evaluates breakout and trend opportunities on the price chart using a weighted composite score of volume, trend, and candlestick structure. It tracks volume spikes, fast and slow EMAs, higher-timeframe EMA trend alignment, opening ranges, and ses

Strategy v6 TrendVolume Repaints
Updated 3 weeks ago · Custom licence GitHub repository of TradingAlpha Point-Clip Strategy

This strategy enters long or short when eight conditions align over the last two bars. It requires EMA 10 and EMA 55 alignment on the one-hour, four-hour and daily charts, a positive ADX slope, matching monitor direction, and price relative to a 400-bar point

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard ABCBitcoin TradingLatino B002
12 stars

This strategy plots on the price chart and looks for three-candle fair value gaps and inverse gaps on Bitcoin. It enters long when a wide enough bullish gap appears in an uptrend with RSI above 30 and volume above its average, and short on the opposite bearish

Strategy v6 SMC / ICT / price actionTrend Repaints
Updated 4 months ago · None stated GitHub repository of BTC 4h FVG/iFVG Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers