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
When price moves against the position, it executes Martingale safety orders using customizable volume multipliers and step percentages. Exits are governed by percentage-based take-profit targets and an optional percentage stop loss. Plotted directly on the price chart, the strategy displays dynamic scale-in levels alongside an onscreen status dashboard table. Stop loss is disabled by default, and pyramiding is enabled.
Signal triggers from MACD, MFI, RSI, or Stochastic RSI
Martingale scale-in mechanism with volume multiplier
Dynamic average-down order level plots on the chart
Onscreen performance and order status dashboard table
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Buy Signal Strategy
string
MACD
strategy
Signal Threshold Level
int
20
strategyLevelTrigger
Indicator Length
int
14
strategyLength
Stoploss On
bool
false
stoplossOn
Stoploss %
float
5
stoploss
Take Profit %
float
.5
takeProfit
Average Down %
float
.5
avgDown
Avg Down % Multiplier
float
1.2
percentScale
Volume Multiplier
float
1.5
multiplier
Max # Of Orders
int
12
maxOrders
Size Of Base Order
float
100
quantity
Info Table On/Off
bool
true
dataTableOn
Show all 14 settings
Setting
Type
Default
Variable
Turn Average Down Levels On/Off
bool
true
orderLevelsOn
Percentage Table Position
string
bright
tablePosition
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 RSI on the price chart and enters a long when RSI falls below the oversold level or a short when it rises above the overbought level, only while flat. It exits with a take profit and stop loss measured in pips from the current close. Inputs
This strategy calculates intraday volatility mean reversion using session VWAP standard deviation bands, RSI overbought and oversold levels, and candle wick exhaustion ratios. It enters trades when price reaches statistical extremes filtered by RSI and wick co
Alert BB + RSI [Alorse] is a multi-symbol mean-reversion strategy designed for cryptocurrency trading. It evaluates Bollinger Bands and the Relative Strength Index (RSI) across up to 20 user-defined ticker symbols simultaneously. The strategy enters long posit
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
This strategy draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,
This strategy combines Bollinger Bands with a short RSI to fade moves that leave the bands and then return. A long requires the prior bar below the lower band and oversold, then a close back inside the band while RSI is between 30 and 50. Shorts mirror that at