This is a synchronised build of a basket strategy that places a stop entry just beyond the close of a confirmed signal candle, for 10 lots, inside a trading session.
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
Take profit and stop orders are armed together with the entry so same-bar touches execute correctly. Half the basket books at a one-point target, the rest runs until a MACD reversal, and refill entries have their own stop loss that closes all positions. Higher timeframe filters use confirmed bars. Up to six entries can stack.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Allow Long
bool
true
allowLong
Allow Short
bool
true
allowShort
Total Basket Lots
float
10
totalQty
Partial / Refill Lots
float
5
partialQty
+1 Point Target (price units)
float
1.0
targetPoints
Entry Buffer % (close +/-)
float
0.02
entryBufferPct
Refill SL Buffer % (from signal candle Low/High)
float
0.02
slBufferPct
Trading Session
session
0905-2230
tradeSession
Show Entry / SL / Target Lines
bool
true
showTradeLines
Show Execution Markers
bool
true
showExecMarkers
Show Exit Reason Labels
bool
true
showExitReasonLabels
Line Extend Bars
int
80
lineExtendBars
Show all 40 settings
Setting
Type
Default
Variable
Label Left Offset Bars
int
5
labelOffsetBars
Label Vertical Spacing Ticks
int
16
labelSpaceTicks
Entry Line Color
color
color.new(color.blue, 0)
entryLineColor
Target Line Color
color
color.new(color.green, 0)
targetLineColor
SL Line Color
color
color.new(color.red, 0)
slLineColor
Show Latest Position Panel
bool
true
showPosPanel
Dark Panel Theme
bool
true
panelDark
ST ATR Length
int
2
st_atr_len
ST Factor
float
1.0
st_factor
EMA Fast Length
int
3
ema_fast_len
EMA Slow Length
int
13
ema_slow_len
MACD Fast Length
int
12
macd_fast_len
MACD Slow Length
int
13
macd_slow_len
MACD Signal Smoothing
int
12
macd_signal_len
RSI Length
int
14
rsi_len
ADX Length
int
14
adxLen
ADX Smoothing
int
14
adxSmoothing
ADX Rising Above Level
float
15.0
adxLevel
VWAP Slope Lookback
int
10
vwapSlopeLookback
VWAP Flat ATR Length
int
14
vwapAtrLen
VWAP Flat ATR Multiplier
float
0.15
vwapFlatMult
Volume EMA Length
int
20
volEmaLen
BB SMA / Mid Length
int
10
bbLen
BB Multiplier
float
2.0
bbMult
BB Band Slope Lookback
int
3
bbSlopeLookback
15m SMA Length for BB Bias
int
10
bb15SmaLen
Neutral Candle Body <= % of Range
float
50.0
neutralBodyPct
Show Neutral Candle Dot
bool
true
showNeutralDot
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.
Andean Scalping is a Pine Script v5 strategy template designed for backtesting trading signals. It features session and date-range filtering, directional trade toggles for long and short entries, and optional trend filtering tools including higher-timeframe EM
This overlay strategy targets one-minute ATOM scalps. It tracks pivot highs and lows as resistance and support, compares a three-period EMA with a multi-stage smoothed close, and flags long or short when price crosses that curve in the matching direction. Dail
This intraday strategy implements session-based trading rules tailored for gold on short timeframes. It tracks the Asian session price range, VWAP, 20-period EMA, and previous day high and low levels to identify liquidity sweeps during London and New York trad
This strategy overlays trade setups directly on the price chart using fast, slow, and trend EMAs alongside RSI, ATR, ADX, and volume moving averages. It generates long and short signals through trend-pullback or mean-reversion logic, filtered across multiple t
This strategy identifies trend continuation and accumulation setups on 5-minute charts. It enters long or short positions based on an aligned moving average stack, rising or falling price grinds within a lookback period, and a maximum bar size threshold to avo
This strategy identifies long and short positions using a dual moving average crossover on the price chart. The fast and slow simple moving averages generate crossover signals that trigger market entries. The script caps the number of intraday filled orders to