Strategy · Pine Script v6 · Own pane

SA-TEST 03

by durdenbtc

This strategy calculates a 14-period RSI of close and plots it in a separate pane with horizontal lines at 30 and 70.

View on GitHub

Repaints

GitHub stars5on the repository
Pine versionv6current
Lines of code40
Settings0inputs
LicenceMIT
Last update5 months ago17 May 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

40 lines of Pine Script v6 from docs/examples/[SA-TEST 03] RSI Reversal.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

[SA-TEST 03] RSI Reversal.pine
//@version=6
strategy(
     title                            = "[SA-TEST 03]",
     overlay                          = false,
     initial_capital                  = 10000,
     default_qty_type                 = strategy.percent_of_equity,
     default_qty_value                = 100,
     pyramiding                       = 0,
     commission_type                  = strategy.commission.percent,
     commission_value                 = 0.01,
     slippage                         = 0,
     margin_long                      = 0,
     margin_short                     = 0,
     calc_on_order_fills              = true,
     calc_on_every_tick               = true,
     process_orders_on_close          = true,
     fill_orders_on_standard_ohlc     = true)

// Classic RSI reversal:
//   long  when RSI crosses BACK ABOVE oversold (i.e., recovering from a dip)
//   exit  when RSI crosses BACK BELOW overbought (i.e., reversing from a top)
length      = 14
oversold    = 30
overbought  = 70

rsi = ta.rsi(close, length)

longCondition  = ta.crossover(rsi, oversold)
exitCondition  = ta.crossunder(rsi, overbought)

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

if exitCondition
    strategy.close("Long")

// Optional: plot the RSI with threshold lines
plot(rsi, "RSI", color.aqua)
hline(oversold,   "Oversold",   color.green)
hline(overbought, "Overbought", color.red)

Overview

SA-TEST 03 opens a long when RSI crosses above the oversold level and closes that long when RSI crosses below the overbought level. There are no short entries and no stop loss. Size defaults to 100 percent of equity, with a 0.01 percent commission and zero slippage. Length and thresholds are fixed in the code, not inputs. Signals can change on the live bar.

Details

Published by

durdenbtc on GitHub

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)
  • The strategy enters trades without a stop loss

Topics

investingpinescriptpython

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 strategy combines Larry Williams' Vix Fix synthetic volatility indicator with Bollinger Bands. It calculates standard and inverted Williams Vix Fix metrics, displaying them as histogram columns with standard deviation bands in a separate pane. Long entrie

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Williams Vix Fix Strategy [Alorse]

2xTP, SL to Entry

by hasnocool
106 stars

This strategy executes mean-reversion trades based on Bollinger Bands and the Stochastic Oscillator. Long orders trigger when price dips below the lower band alongside a bullish Stochastic crossover, with an optional oversold threshold. Short orders execute on

Strategy v5 Mean reversionOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 2xTP, SL to Entry

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy fades Bollinger Band extremes using the close. It enters short when price crosses above the upper band and the 14-period RSI is above 70, and enters long when price crosses below the lower band and RSI is below 30. It closes half of an open short

Strategy v4 Volatility & bandsOscillators & momentum
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy

This strategy calculates the WaveTrend oscillator alongside Stochastic RSI to identify reversal setups at overbought and oversold extremes. It enters long positions when the WaveTrend oscillator crosses upward below configured oversold levels, and enters short

Strategy v6 Oscillators & momentumMean reversion Repaints
Updated 3 days ago · MIT GitHub repository of WaveTrend v4 [WavesUnchained] Strategy

Williams %R Reversal - Eterna MCP

by EternaHybridExchange
9 stars

This strategy tracks the Williams %R oscillator to trade mean-reversion bounces from overbought and oversold extremes. It opens long or short positions when a reversal signal occurs alongside confirming price direction, while generating JSON-formatted alert pa

Strategy v5 Oscillators & momentumMean reversion
Updated 7 months ago · MIT GitHub repository of Williams %R Reversal - Eterna MCP

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