Strategy · Pine Script v6 · On the chart

Easy Trendline - XAUUSD 30m

by Steinwealth

This strategy plots dynamic pivot-based support and resistance trendlines on the price chart and trades breakouts beyond those lines.

View on GitHub

GitHub stars7on the repository
Pine versionv6current
Lines of code407
Settings25inputs
LicenceNone stated
Last update12 months ago1 Nov 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

By default it allows longs only when EMA 50 is above EMA 200 and an RSI-SMA momentum filter is met, with an ATR entry buffer. Exits use an initial ATR stop, breakeven and trailing stops, plus optional RSI-and-price confirmation and opposite trendline breaks. Swing lookback, slope method, and long or short permission are the main settings. It is built for XAUUSD on the 30-minute chart and can pyramid up to four entries.

Details

Published by

Steinwealth on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Breakout, Support & resistance, Oscillators & momentum

Markets

Gold

Timeframes

M15-H1

Risk Notes

  • The strategy can add several entries in the same direction

Settings

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

SettingTypeDefaultVariable
Swing Detection Lookbackint6length
Slope Multiplierfloat1.0mult
Slope CalculationstringAtrcalcMethod
EMA Trend Filter (50 > 200)booltrueuseTrend
Allow Long TradesbooltrueallowLongs
Allow Short TradesboolfalseallowShorts
RSI-SMA Momentum FilterbooltrueuseRSISMA
RSI-SMA Baseline (Longs)int48rsiSMABaseline
Entry Buffer (ATR ×)float0.10bufATRx
RSI + Price Confirmation ExitsbooltrueuseRSI
RSI Lengthint14rsiLen
Long Exit: RSI <int40rsiExitLong
Show all 25 settings
SettingTypeDefaultVariable
RSI Confirmation Barsint3rsiConfirmBars
Price Confirmation EMAint20emaConfirm
Min Profit for RSI Exit (ATR ×)float0.5minProfitRSI
Opposite Break ExitsbooltrueuseOppBreak
Min Profit for Opp Break (ATR ×)float0.8oppBreakMinProfit
ATR Period (Daily)int5atrDailyLen
Initial Stop Loss (ATR ×)float1.5slATR
Trailing Stop (ATR ×)float2.0trailATR
Breakeven Trigger (ATR ×)float0.7beTriggerATR
Breakeven Offset (ATR ×)float0.3beOffsetATR
Upper Trendline Colorcolorcolor.tealupCss
Lower Trendline Colorcolorcolor.reddnCss
Show Extended LinesbooltrueshowExt
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

This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr

Strategy v6 BreakoutTrend
Updated today · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout
257 stars

This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar
106 stars

Calculates multi-period logarithmic regression trend channels and deviation bands across up to twenty selectable lookback lengths directly on the price chart. It evaluates channel slopes and Pearson's correlation coefficient to detect market trends and generat

Strategy v5 TrendSupport & resistance Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced Trend Detection Strategy
53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized Strategy

This strategy trades 1-minute futures contracts on Binance. It plots pivot high and low resistance and support levels on the price chart, along with an EMA and a custom Cto indicator. Long and short entries trigger on EMA and Cto crossovers combined with price

Strategy v5 TrendMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Binancash Futures Strategy 1M Candles

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