Strategy · Pine Script v6 · Own pane

PF TA isolate - accdist EMA(21) cross

by pineforge-4pass· code credited to PineForge contributors 2026

This Pine Script strategy calculates the accumulation/distribution line with ta.accdist and its 21-period EMA.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code24
Settings0inputs
LicenceApache-2.0
Last update5 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

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

strategy.pine
// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF TA-isolate probe — Accumulation/Distribution line vs its EMA(21) signal.
// Isolates ta.accdist (the no-arg A/D running-sum SERIES variable, built from
// the close-location-value * volume money-flow). A/D is a cumulative-over-all-bars
// accumulator like ta.obv, so it is sensitive to warmup/first-bar seeding and to
// the exact CLV formula ((2*close-low-high)/(high-low), 0 when high==low). Only a
// TV "List of trades" export can adjudicate the engine's accdist accumulator.
//@version=6
strategy("PF TA isolate - accdist EMA(21) cross", shorttitle="TAI_AD",
     overlay=false, initial_capital=1000000,
     commission_type=strategy.commission.percent, commission_value=0, slippage=0,
     default_qty_type=strategy.fixed, default_qty_value=1, pyramiding=1,
     process_orders_on_close=false)

ad  = ta.accdist
sig = ta.ema(ad, 21)

if ta.crossover(ad, sig)
    strategy.entry("L", strategy.long, comment="ad cross up")
if ta.crossunder(ad, sig)
    strategy.entry("S", strategy.short, comment="ad cross dn")

Overview

PF TA isolate - accdist EMA(21) cross plots these in a separate pane. The strategy issues long entries on ta.crossover of the accumulation/distribution line above its EMA and short entries on ta.crossunder. It applies fixed unit sizing per trade with pyramiding enabled and no stop loss or take profit by default. The script runs on any market and any timeframe.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge contributors 2026, as written in the script's header

Type

Strategy, Pine Script v6

Draws

Separate pane below the chart

Category

Volume, Moving averages, Oscillators & momentum, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy can add several entries in the same direction
  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

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

Altered OBV On MACD

by hasnocool
106 stars

This strategy calculates and plots 9, 21, 50, 90, and 200-period Simple Moving Averages on the main price chart. It constructs a modified On-Balance Volume (OBV) metric and calculates a MACD oscillator based on this custom volume series rather than price. Long

Strategy v5 Moving averagesVolume
Updated 2 years ago · GPL-3.0 GitHub repository of Altered OBV On MACD
12 stars

This strategy enters long when a fast EMA crosses above a slow EMA and RSI, ADX, and volume all clear their thresholds. It sizes the order from a percentage of equity and an ATR stop distance, then sets a partial profit target at a multiple of that risk. After

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of BTC 4H Institutional Trend

Combined Strategy

by Dropio12
7 stars

This strategy plots buy and sell markers on the price chart by combining a fast and slow ALMA crossover with a simple close-to-close momentum check. A long marker appears when the fast ALMA crosses above the slow ALMA and momentum is positive. A short marker a

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Combined Strategy

Antigravity Superstar

by eltonaguiar
4 stars

This strategy draws on the price chart and combines a triple EMA stack, a volume spike with a minimum price move, and a MACD line-signal crossover. It enters long or short only when at least the chosen number of those three signals agree, with an optional RSI

Strategy v6 TrendMoving averages
Updated today · None stated GitHub repository of Antigravity Superstar

Golden Strategy

by AliAhmadi-Software
3 stars

The Golden Strategy is a Pine Script v6 strategy that overlays EMA and SMA on the price chart to detect crossovers for trend direction. It adds MACD for momentum confirmation and RSI to identify overbought and oversold conditions. Volume average filters out lo

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Golden Strategy
2 stars

This strategy is written for Bitcoin and draws on the price chart. It combines moving averages, an SSL channel, ADX, RSI, stochastic, and a volume oscillator with high-volume thresholds to generate buy and sell signals. Users can limit testing to a date range

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TLC_STRATEGY_EMARSIADX for BTC

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