Strategy · Pine Script v6 · Own pane

PF TA isolate - NVI/PVI vs EMA255 cross

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

This strategy plots the Positive Volume Index and Negative Volume Index in a separate pane and compares each with its own exponential moving average of length 255.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code26
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

26 lines of Pine Script v6 from validation/ta-nvi-pvi-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 — Negative/Positive Volume Index (ta.nvi / ta.pvi).
// Isolates the two cumulative volume-conditioned built-in SERIES properties
// ta.nvi and ta.pvi. Both update only on bars where volume falls (NVI) or
// rises (PVI) vs the prior bar — a stateful path with no TradingView-parity
// coverage in the corpus. Long when PVI crosses over its EMA(255); short when
// NVI crosses under its EMA(255).
//@version=6
strategy("PF TA isolate - NVI/PVI vs EMA255 cross", shorttitle="TAI_NVIPVI",
     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)

pvi = ta.pvi
nvi = ta.nvi
pviEma = ta.ema(pvi, 255)
nviEma = ta.ema(nvi, 255)

if ta.crossover(pvi, pviEma)
    strategy.entry("L", strategy.long, comment="pvi cross up")
if ta.crossunder(nvi, nviEma)
    strategy.entry("S", strategy.short, comment="nvi cross dn")

Overview

PF TA isolate - NVI/PVI vs EMA255 cross opens a long when PVI crosses above its EMA and opens a short when NVI crosses below its EMA. Quantity is fixed at one unit, commission and slippage are zero, and orders are not processed on close. There are no input settings and no stop loss, take profit, or other exit rules.

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

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • 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

106 stars

This strategy calculates and plots aggregated Bitcoin volume collected across multiple exchanges, along with two volume moving averages in a separate pane. It enters long positions when price crosses above a fast EMA while remaining above a slow EMA, and enter

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Aggregate BTC Volume + EMA Strat

BTC Futures MACD

by iamrichardD
57 stars

This strategy plots a MACD oscillator in a separate pane and trades Bitcoin futures from zero-line and signal-line crosses. Optional early momentum signals, a volume filter, and a trend moving-average filter can confirm entries. It sizes positions as fixed con

Strategy v6 Oscillators & momentumMoving averages Repaints
Updated 1 year ago · Apache-2.0 GitHub repository of BTC Futures MACD
13 stars

This strategy plots an On-Balance Volume oscillator in a separate pane and applies a fast and a slow exponential moving average to it. It enters long or short when those averages cross, with a strategy type that can reverse, stay long only, or stay short only,

Strategy v5 VolumeMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard QN OBVOsc A002
3 stars

This strategy calculates a Volume-Weighted Moving Average Convergence Divergence (VWMA MACD) and its histogram average to generate trade signals in a separate pane. It enters long positions when the MACD histogram crosses above its simple moving average and sh

Strategy v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD VWMA Strategy
257 stars

This overlay strategy is built for ES futures on the one-minute chart. It plots a volume-weighted moving average of price opens and standard-deviation bands at Fibonacci ratios, plus a second longer volume-weighted average from a higher-timeframe open. Call an

Strategy v5 Volatility & bandsMoving averages
Updated 6 weeks ago · None stated GitHub repository of ES Futures 1M No Repaint

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