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
201 lines of Pine Script v5 from PineScript/Stg_TD_RSI_SMI.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
TD RSI Strategy allows long, short, or both directions and sizes orders from a percentage of equity. Inputs set RSI and MACD lengths, SMI smoothing, breakout thresholds, a stop loss, and four take-profit levels with partial quantities. It draws on the price chart. The provided code ends before the entry and exit conditions, so those rules are not fully visible.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Strategy Direction
string
long
Strategy Direction
Equity Usage Percentage
float
0.9
equityUsage
RSI Length
int
14
rsiLength
RSI Source
source
hlc3
rsiSource
MA Length
int
14
rsiMALength
Boll StdDev
float
2.0
rsiBollMult
Show Breakout
bool
true
showBreakout
Breakout Value Low
float
1.0
rsiDivBreakLow
Breakout Value High
float
1.3
rsiDivBreakHigh
RSI Raw Breakout Value
int
25
rsiRawBreak
Fast Length
int
12
macdFastLength
Slow Length
int
26
macdSlowLength
Show all 24 settings
Setting
Type
Default
Variable
Signal Length
int
9
macdSignalLength
%K Length
int
10
smiLengthK
%D Length
int
3
smiLengthD
EMA Length
int
8
smiLengthEMA
qty_percent1
int
25
q1
qty_percent2
int
25
q2
qty_percent3
int
25
q3
Stop Loss
float
0.02
stoploss
Take profit1
float
3
tp1
Take profit2
float
5
tp2
Take profit3
float
7
tp3
Take profit4
float
10
tp4
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.
The ESH2023 5M strategy is a Pine Script v5 indicator for E-mini S&P 500 futures trading on the 5-minute chart. It calculates a Stochastic oscillator from Ichimoku cloud high/low averages using inputs for K period, D period, and smoothing. The script signals l
Calculates a momentum squeeze using Bollinger Bands and Keltner Channels alongside a trend-filtering moving average. It generates long and short entries based on squeeze momentum bar conditions and an optional pre-squeeze dot count filter. Exits can trigger on
This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open
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
This strategy trades longs and shorts on the price chart. Long entries require a close above the prior Donchian high, a close above a long-term SMA, and RSI above a threshold, with size set as a percentage of equity. Long exits use a stop at the prior Donchian
This strategy tracks an opening session time range to establish directional bias and triggers pullback trades using Stochastic RSI. Once price breaks out of the initial range, it establishes a directional bias and enters when the Stochastic RSI crosses over in