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
Trades are filtered using an exponential moving average trend condition and designated session hours. Entries trigger upon breakouts from active boxes, while position sizing is calculated using risk per trade with target exits derived from a fixed risk-to-reward ratio. It also features automatic Friday closing and trade cooldown periods. All boxes, trades, and optional EMA lines are rendered directly on the price chart.
ATR-based box breakout detection
Standard deviation volatility squeeze filter
EMA trend directional filter
Configurable trading sessions and Friday close protection
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Lookback Period
int
15
lookback
Box Width (ATR)
float
2.5
atr_mult
Slope Tolerance
float
0.2
slope_thresh
Cooldown (Bars)
int
5
cooldown_bars
Max Box Duration (Bars)
int
45
max_box_life
Use EMA Filter
bool
true
use_ema
EMA Length
int
150
ema_len
Show EMA Line on Chart
bool
true
show_ema
Trading Session
session
0600-2300
trading_session
Force Close on Friday Night?
bool
true
force_close_day
Force Close Hour (Friday)
int
22
force_close_hour
Force Close Minute
int
00
force_close_min
Show all 28 settings
Setting
Type
Default
Variable
Skip Winter Holidays
bool
false
holiday_filter
Risk % Per Trade
float
0.8
risk_per_trade
Risk : Reward Ratio
float
1.9
reward_ratio
Detect Squeeze
bool
true
use_gold
Show Standard Boxes
bool
true
show_gray
StdDev Length
int
20
std_len
Squeeze Threshold
float
0.6
squeeze_th
Text Size
string
Normal
txt_size_input
Squeeze Box Color
color
#FFD700
c_squeeze
Standard Box Color
color
color.gray
c_std
Active Trade Color
color
color.blue
c_active
Win Color
color
color.green
c_win
Loss Color
color
color.red
c_loss
Box Transparency
int
80
bg_transp
Marker Width
int
5
marker_width
Connector Width
int
2
conn_width
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 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 places buy-stop and sell-stop orders around the opening-session high and low, offset by a user-defined pip gap, and only allows those orders during a separate trading session. It exits with a fixed or ATR-based stop loss and a matching take-profi
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 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 enters long when price closes above the prior Donchian high and short when it closes below the prior Donchian low, only while flat and inside a Taipei-hour window. It exits on a MACD histogram reversal or through an ATR stop and a percentage take
This strategy evaluates breakout and trend opportunities on the price chart using a weighted composite score of volume, trend, and candlestick structure. It tracks volume spikes, fast and slow EMAs, higher-timeframe EMA trend alignment, opening ranges, and ses