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
Fractal Sweep Strategy detects a sweep of a prior candle's extreme, a return and a CISD confirmation, then enters with a stop at the sweep extreme or CISD level and a take profit at a set R:R multiple. Shallow sweep and closed-back filters are on by default, with optional SMT divergence against ES, a session window in Eastern time and a date range. Size can be risk-based from a dollar amount and point value or a fixed contract count. Defaults assume micro Nasdaq futures costs.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Risk per Trade ($)
float
225.0
risk_per_trade_usd
Point Value ($/pt)
float
2.0
point_value
Risk-based Sizing
bool
true
use_risk_sizing
Fixed Contracts
int
1
fixed_contracts
Min Risk (pts)
float
3.0
min_risk
Max Risk (pts)
float
112.5
max_risk
CISD Lookback Bars
int
100
cisd_lookback
Stop-Loss At
string
Sweep Extreme
sl_mode
R:R Target
float
1.0
rr_ratio
Require Shallow Sweep (F3)
bool
true
use_shallow_sweep
Require Closed Back Inside (F4)
bool
true
use_closed_back
Require SMT Divergence
bool
false
use_smt
Show all 21 settings
Setting
Type
Default
Variable
SMT Symbol
string
ES1!
smt_symbol
Restrict to Session
bool
true
use_session
Session Start Hour (ET)
int
7
sess_start
Session End Hour (ET)
int
16
sess_end
Restrict to Date Range
bool
false
use_date_filter
Start Date
time
timestamp("2020-01-01T00:00:00")
date_start
End Date
time
timestamp("2030-01-01T00:00:00")
date_end
Show Entry Markers
bool
true
show_entries
Draw SL/TP Lines
bool
true
show_sl_tp
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 calculates the distance between the current price and the opposite end of a recent price gap. It trades against gap completion under the assumption that price will resume the prevailing trend after a partial gap fill. Take profit and stop loss va
This strategy identifies bullish and bearish order blocks using an average true range impulse filter and plots corresponding boxes on the price chart. It enters positions on price retests of the order block zones, optionally filtered by an exponential moving a
This strategy combines Opening Range Breakout (ORB) mechanics with Inner Circle Trader (ICT) concepts like Fair Value Gaps, Order Blocks, and liquidity grabs. It identifies session opening ranges and generates signals when price breaks out with supporting rela
This strategy tracks GBP/USD market structure by storing confirmed pivot highs and lows. It enters long when price crosses above the last pivot high while above a trend EMA, and short when price crosses below the last pivot low while below that EMA. Entries oc
This educational strategy demonstrates basic Smart Money Concepts using breakout logic. It calculates rolling highest highs and lowest lows over a fixed 20-bar lookback to represent liquidity levels and detect Break of Structure (BOS). It enters a long positio
This strategy operates directly on the price chart to generate trading signals across four switchable modules: trend following, mean reversion, momentum breakout, and smart money concepts. It triggers trade entries when a user-defined minimum number of modules