Strategy · Pine Script v6 · On the chart

Zenith RCI WPR

by pineforge-4pass· code credited to PineForge

This strategy combines the Rank Correlation Index (RCI) and Williams %R to identify momentum confirmation for long positions.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code36
Settings7inputs
LicenceApache-2.0
Last update7 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

36 lines of Pine Script v6 from validation/ta-zenith-rci-wpr-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: Zenith RCI WPR
// Rank correlation and Williams percent range jointly confirm momentum.
strategy("PineForge — Zenith RCI WPR", 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)

rciLength = input.int(17, "RCI Length", minval=3, group="Momentum")
wprLength = input.int(22, "Williams %R Length", minval=3, group="Momentum")
rciEntryLevel = input.float(18.0, "RCI Entry Level", minval=-80, maxval=80, step=1, group="Momentum")
wprEntryLevel = input.float(-58.0, "Williams %R Entry Level", minval=-95, maxval=-5, step=1, group="Momentum")
rciExitLevel = input.float(-14.0, "RCI Exit Level", minval=-80, maxval=80, step=1, group="Momentum")
atrLength = input.int(14, "ATR Length", minval=2, group="Risk")
maximumAtrLoss = input.float(2.0, "Maximum ATR Loss", minval=0.5, step=0.1, group="Risk")

rciValue = ta.rci(close, rciLength)
williamsValue = ta.wpr(wprLength)
atrValue = ta.atr(atrLength)

enterLong = ta.crossover(rciValue, rciEntryLevel) and williamsValue > wprEntryLevel
momentumEnded = rciValue < rciExitLevel or williamsValue < -82
riskExceeded = strategy.position_size > 0 and close < strategy.position_avg_price - atrValue * maximumAtrLoss

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

plot(rciValue, "RCI", color=color.blue, display=display.data_window)
plot(williamsValue, "Williams %R", color=color.purple, display=display.data_window)

Overview

Zenith RCI WPR enters a trade when RCI crosses above a specified entry threshold while Williams %R remains above its configured level. Exits occur when momentum fades—signaled by RCI or Williams %R dropping below defined levels—or when price drops below the entry price by an ATR-based risk multiplier. Indicators plot in the data window while strategy signals display directly on the price chart.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge, as written in the script's header

Draws

On the price chart

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
RCI Lengthint17rciLength
Williams %R Lengthint22wprLength
RCI Entry Levelfloat18.0rciEntryLevel
Williams %R Entry Levelfloat-58.0wprEntryLevel
RCI Exit Levelfloat-14.0rciExitLevel
ATR Lengthint14atrLength
Maximum ATR Lossfloat2.0maximumAtrLoss
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

330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy
285 stars

Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy

MACD Strategy

by TradersPost
228 stars

This overlay strategy is built around MACD inputs for a fast average, a slow average, and a signal line. Comments say the script keeps MACD values available and can draw a histogram and zero line in a separate pane, with an optional overlay on price. Settings

Strategy v6 Oscillators & momentumMoving averages
Updated 3 months ago · None stated GitHub repository of MACD Strategy

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA Strategy

More Oscillators & momentum scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers