Strategy · Pine Script v5 · On the chart

Pivot Trend RMA

by Snappni

This strategy calculates a 10-period rolling moving average (RMA) alongside short-term pivot highs and pivot lows to identify trend alignment.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code20
Settings0inputs
LicenceMIT
Last update4 months ago6 Jun 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

20 lines of Pine Script v5 from apps/server/src/pine-corpus/pivot_trend_rma.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

pivot_trend_rma.pine
//@version=5
strategy("Pivot Trend RMA", overlay=true)

smooth = ta.rma(close, 10)
pivotHigh = ta.pivothigh(high, 3, 3)
pivotLow = ta.pivotlow(low, 3, 3)
trendUp = ta.rising(smooth, 3)
trendDown = ta.falling(smooth, 3)
crossAny = ta.cross(close, smooth)

plot(smooth)

longCondition = crossAny and trendUp and not na(pivotLow)
shortCondition = crossAny and trendDown and not na(pivotHigh)

if (longCondition)
    strategy.entry("Long", strategy.long)

if (shortCondition)
    strategy.entry("Short", strategy.short)

Overview

Pivot Trend RMA plots the RMA line directly on the price chart. Long entries trigger when price crosses the RMA while the RMA is rising and a pivot low is detected. Short entries trigger when price crosses the RMA while it is falling and a pivot high is confirmed. The strategy contains no stop loss, take profit, or specific exit rules.

Details

Published by

Snappni on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Trend, Moving averages, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss
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

Omar Edited WF

by Alorse
330 stars

Omar Edited WF is a trading strategy overlay built around Williams Fractals and multiple Exponential Moving Averages. It detects high and low fractal pivot points over configurable lookback periods alongside three adjustable EMA trendlines. Long entries are ma

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Omar Edited WF
257 stars

This strategy calculates dynamic support and resistance levels using pivot highs and lows alongside a custom smoothed trend filter and a 3-period EMA. It identifies entry opportunities when price breaks out relative to the trend filter and short-term EMA cross

Strategy v5 TrendSupport & resistance Repaints
Updated 6 weeks ago · None stated GitHub repository of 30s - ES 1m Strategy Candle Bar

This strategy overlays the price chart and looks for VWAP pullbacks. It goes long when a short SMA crosses above VWAP after RSI has been oversold within ten bars, and short on the opposite cross after RSI has been overbought. Optional Minervini-style moving-av

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced VWAP-Momentum Pullback Trend Qualifier
104 stars

This strategy combines three Exponential Moving Averages with Williams Fractals to execute trend-following or mean-reverting trades. It analyzes price structure using short, medium, and long-term EMAs along with fractal highs and lows. Entries trigger when fra

Strategy v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of 3MA and Fractals Strategy

This strategy executes trades based on pivot levels, an exponential moving average, and a multi-stage smoothing trend line. It identifies support and resistance points from pivot highs and lows, combining them with price relationship rules against a custom smo

Strategy v5 TrendMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Binancash - Candle Strategy Futures on Binance
13 stars

This strategy generates entry signals using pivot points and uses custom Curie moving average closing lines for exiting positions. It features risk management components including percentage-based stop loss, take profit, trailing stops, and break-even levels,

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of BitLa PivotPoints A002

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