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
Custom Strategy with DSMA combines breakout bands, RSI momentum levels, and long-term EMA trend filters to signal entries. Position sizing is calculated dynamically using ATR and a defined account risk percentage. The strategy uses fixed percentage stop-loss and take-profit targets while allowing up to three pyramid positions. Fast and slow DSMA lines are plotted directly on the main price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
每笔交易的风险比例 (%)
float
0.5
risk_per_trade
回溯周期
int
20
lookback
突破倍数
float
2.0
breakout_mult
止损百分比 (%)
float
1.5
stop_loss_percent
止盈百分比 (%)
float
3.0
take_profit_percent
最大开仓数量
int
3
max_positions
ATR 周期
int
14
atr_period
移动平均线长度
int
100
ma_len
RSI 周期
int
14
rsi_period
RSI 超买阈值
int
70
rsi_overbought
RSI 超卖阈值
int
30
rsi_oversold
时间趋势参数
timeframe
D
timeframe
Show all 14 settings
Setting
Type
Default
Variable
开始时间
time
timestamp("01 Dec 2022 03:00 +0000")
startTime
结束时间
time
timestamp("01 Jan 2028 23:59 +0000")
endTime
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.
Calculates a momentum squeeze using Bollinger Bands and Keltner Channels alongside a trend-filtering moving average. It generates long and short entries based on squeeze momentum bar conditions and an optional pre-squeeze dot count filter. Exits can trigger on
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 longs and shorts on the price chart. Long entries require a close above the prior Donchian high, a close above a long-term SMA, and RSI above a threshold, with size set as a percentage of equity. Long exits use a stop at the prior Donchian
Edge 59 is a price-chart strategy that combines an ADX directional filter, a weighted moving average, and a trend-follower channel. The channel uses an exponential moving average of close, optionally smoothed by linear regression, and a percentage of a fixed 2
AG Momentum Breakout is a strategy that identifies continuation signals after pullbacks in trending markets. It filters for uptrends using EMAs and detects recent pullbacks via RSI conditions before entering on RSI crossovers above 50 with ADX confirmation. Th
Christian Qullamaggie Strategy is a trend-following and breakout strategy overlay designed to identify high-momentum trading opportunities directly on the price chart. It evaluates market conditions using fast, mid, and slow EMAs, average true range (ATR), and