This strategy plots support and resistance from the highest high and lowest low over a lookback window, and can overlay Bollinger Bands on the price chart.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
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
268 lines of Pine Script v5 from 策略/DCA、RSI 和趋势过滤器的支撑位和阻力位.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Support and Resistance with RSI and Trend Filter calculates RSI or MFI, optionally from Heikin Ashi prices, and exposes WaveTrend, Laguerre smoothing and divergence settings. Orders are restricted to a chosen direction, long, short, both or none, inside a backtest date window. Pyramiding allows many stacked positions, and the visible code sets no stop loss.
Support and resistance from lookback highs and lows
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Backtest Start Year
int
2023
testStartYear
Backtest Start Month
int
1
testStartMonth
Backtest Start Day
int
1
testStartDay
Backtest Stop Year
int
9999
testStopYear
Backtest Stop Month
int
12
testStopMonth
Backtest Stop Day
int
31
testStopDay
What trades should be taken :
string
LONG
tradeType
Use Heikin Ashi Candles
bool
false
uha
Oscillator Type
string
o_rsi
i_osc
useBB
bool
false
useBB
bblength
int
50
bblength
Multiplier for BB Upper Band
float
1.5
bbupmult
Show all 40 settings
Setting
Type
Default
Variable
Multiplier for BB Lower Band
float
1.5
bblowmult
Lookback Bars
int
50
lookbackBars
RSI Length
int
14
rsiLength
Overbought Threshold
int
62
overboughtThreshold
Oversold Threshold
int
38
oversoldThreshold
Use wave trend?
bool
true
useWT
Channel Length
int
12
n1
Average Length
int
20
n2
Over Bought Level 1
int
60
obLevel1
Over Bought Level 2
int
53
obLevel2
Over Sold Level 1
int
-60
osLevel1
Over Sold Level 2
int
-53
osLevel2
Source
source
hlcc4
ap
Apply Laguerre Smoothing
bool
true
useLag
Laguerre Gamma
float
0.03
gamma
Use divergences?
bool
false
useDivergences
RSI Period
int
14
len
RSI Source
source
close
src
Pivot Lookback Right
int
5
lbR
Pivot Lookback Left
int
5
lbL
Max of Lookback Range
int
60
rangeUpper
Min of Lookback Range
int
5
rangeLower
Use trend filter?
bool
true
useTrendFilter
Trend filter timeframe
string
240
trendtimeframe
use G Trend as trend indicator
bool
true
useGtrend
ATR Period
int
99
length
ATR Multiplier
float
1
mult
Take Wicks into Account ?
bool
false
wicks
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.
Liquidity Sweep Scalper v2 is a scalping strategy that detects liquidity sweeps using Supertrend trend filters, Bollinger Bands for volatility, Williams Fractals for pivots, and MACD momentum. It enters on rejection candle breaks after sweeps and exits via sto
This Pine Script v5 strategy generates buy and sell signals for XAUUSD on the price chart. It combines Stochastic Oscillator, RSI, EMA crossovers and Fibonacci retracements with M15 overbought/oversold triggers and rejection wick filters to identify entries. C
This strategy trades S50 TFEX USDTHB contracts on the price chart. It detects swing highs and swing lows with pivot points to generate long entries on swing highs and short entries on swing lows. The ATR indicator calculates dynamic stop-loss distances while t
This strategy overlays a trend moving average and Supertrend bands directly on the price chart while calculating Stochastic RSI values internally. Long positions trigger when price exceeds the moving average, Supertrend signals bullish momentum, and the StochR
This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry
This strategy uses multiple VWAP anchors and a custom Lull indicator to generate buy and sell signals on the Nasdaq price chart. It plots the VWAP trend line and three VWAP anchors with customizable colors and mitigation methods. The Lull indicator produces si