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
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 low and no take profit. Short settings combine a fast EMA, a slow SMA, and an RSI threshold, with percentage take profit, stop loss, and a trailing stop. After a set number of consecutive short losses, new shorts wait through a cooldown. Pyramiding is disabled.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
【多】倉位%(占權益)
float
50
longPosPct
【空】倉位%(占權益)
float
100
shortPosPct
【多】唐奇安通道週期
int
25
donchianLength
【多】長期SMA濾網週期
int
118
longTermSmaLen
【多】RSI 週期
int
26
rsiLenLong
【多】RSI 閾值
float
71.06
rsiThLong
【空】EMA 敏感週期
int
14
emaFastLength
【空】SMA 穩定週期
int
80
smaSlowLength
【空】RSI 週期
int
80
rsiLenShort
【空】RSI 進場門檻
int
52
rsiShortThresh
【空】止盈 (%)
float
7.38
shortTPPct
【空】止損 (%)
float
4.93
shortSLPct
Show all 16 settings
Setting
Type
Default
Variable
【空】移動停損觸發 (%)
float
8
trailTriggerPct
【空】移動停損距離 (%)
float
4
trailOffsetPct
【空】連續虧損次數上限
int
1
maxConsecLosses
【空】冷靜期長度 (K棒)
int
12
cooldownBars
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.
2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the
This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can
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 strategy generates trading signals based on a selectable momentum engine, supporting MACD, RSI, Stochastic, or Rate of Change. Entries trigger on signal crosses, zero-line crosses, or threshold crosses, with an optional moving average trend filter. Risk m
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