A long strategy that plots five moving averages (25, 50, 100, 150 and 300 by default, SMA or EMA) and looks for a bullish candle that opens below and closes above at least a set number of them.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
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
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
The breakout must come on volume above a ratio of its recent average and with a large enough body, then a retest within a short window is checked. A score threshold gates entries, and exits use a selectable average. Markers, retest levels and scores can be shown. There is no stop loss.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
MA Type
string
SMA
ma_type
MA Period 1
int
25
ma_period_1
MA Period 2
int
50
ma_period_2
MA Period 3
int
100
ma_period_3
MA Period 4
int
150
ma_period_4
MA Period 5
int
300
ma_period_5
Min Cross Count
int
3
min_cross_count
Volume Lookback
int
20
volume_lookback
Min Volume Ratio
float
1.2
volume_min_ratio
Body Lookback
int
20
body_lookback
Breakout Lookback
int
15
breakout_lookback
Retest Window
int
5
retest_window
Show all 22 settings
Setting
Type
Default
Variable
Retest Body Ratio
float
0.5
retest_body_ratio
Enable Backtest
bool
true
enable_backtest
Min Score Threshold
float
0.8
min_score_threshold
Backtest Start Date
time
timestamp("2017-01-01 00:00")
start_date
Backtest End Date
time
timestamp("2099-01-01 00:00")
end_date
Exit MA
string
MA 1
exit_ma_option
Show MAs
bool
true
show_mas
Show Breakout Markers
bool
true
show_breakout_markers
Show Retest Levels
bool
true
show_retest_levels
Show Score
bool
true
show_score
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 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
This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w
This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
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 SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.