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
93 lines of Pine Script v5 from 5 Minute Scalping Strategy.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.
5 Minute Scalp calculates a MACD histogram from a 1-minute timeframe, applies Bollinger Bands to the histogram, and tracks two RSI oscillators of different lengths. Orders execute based on RSI thresholds, using fixed 0.5% take-profit and 0.3% stop-loss percentages for exits. Inputs allow customizing moving averages, MACD smoothing, Bollinger Band deviations, and risk targets. Using lower-timeframe security calls may cause differences between historical and live calculations.
Triple EMA overlays on the price chart
1-minute MACD histogram security request
Bollinger Bands calculated on MACD histogram
Dual-period RSI indicators for long and short setups
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast Length
int
12
fast_length
Slow Length
int
26
slow_length
Source
source
close
src
Signal Smoothing
int
9
signal_length
Oscillator MA Type
string
EMA
sma_source
Signal Line MA Type
string
EMA
sma_signal
MACD Line
color
#2962FF
col_macd
Signal Line
color
#FF6D00
col_signal
Above Grow
color
#26A69A
col_grow_above
Fall
color
#B2DFDB
col_fall_above
Below Grow
color
#FFCDD2
col_grow_below
Fall
color
#FF5252
col_fall_below
Show all 31 settings
Setting
Type
Default
Variable
Length
int
9
len1
Source
source
close
src1
Offset
int
0
offset1
Length
int
50
len2
Source
source
close
src2
Offset
int
0
offset2
Length
int
200
len3
Source
source
close
src3
Offset
int
0
offset3
LengthBB Long
int
94
lengthBBLong
LengthBB Short
int
83
lengthBBShort
StdDev
float
2.0
multBB
Offset
int
0
offsetBB
Rsi Length Long
int
11
rsilengthlong
Rsi Length Short
int
29
rsilengthshort
Take Profit %
float
0.5
TP
Stop Loss %
float
0.3
SL
MacdTick Low
int
-10
longhight
MacdTick High
int
35
shorthight
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.
This strategy plots MACD line, signal line, Bollinger Bands, and RSI on the price chart. It signals long entries on MACD crossover above signal with RSI below 50 and price below BB basis, plus optional DMI filter. Short entries are available but disabled by de
This strategy is designed for 1-minute S&P 500 futures trading using multi-timeframe data and Fibonacci-weighted standard deviation bands around volume-weighted moving averages. It requests data from multiple higher timeframes without lookahead to prevent repa
This educational strategy demonstrates moving average crossovers filtered by RSI momentum, incorporating ATR-based risk management. It calculates a 10-period SMA, a 30-period SMA, a 14-period RSI, and a 14-period ATR. Long entries trigger when the fast SMA cro
This strategy combines exponential moving averages (EMA 9, 21, 50), RSI, MACD, and Supertrend indicators to enter long positions. It triggers trades using six dynamic setups based on momentum breakouts, EMA crossovers, and pullbacks. Position sizing is compute
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 trades EUR/USD on the price chart using a fast and slow exponential moving average crossover filtered by RSI. It enters long when the fast EMA crosses above the slow EMA while RSI is above 50 and below the overbought level, and enters short on th