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 indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
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
ATR Based Stoploss Takeprofit [Muhammad] calculates ATR and tracks the highest one-bar ATR over a lookback, then flags a surge when that high rises. Distances come from either the current ATR or the average of stored surge highs, scaled by separate profit and loss multipliers. Long and short targets sit above and below the average, with stops on the opposite side. A table position setting is available. It does not place trades.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
ATR Lookback Period
int
30
atrLookbackPeriod
ATR Length
int
14
atrLength
ATR Profit Multiplier
float
4.0
atrProfitMultiplier
ATR Loss Multiplier
float
1.0
atrLossMultiplier
MA Length
int
8
maLength
Stop Loss Take Profit Type
string
ATR Surge Average
stopLossTakeProfitType
Table Position
string
Bottom right
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 indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc
This indicator overlays trend-following Supertrend bands on the price chart using Average True Range calculations. It plots trailing stop lines, highlights active trend directions, and prints buy or sell shape labels when price closes across band thresholds. I
The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p
This indicator estimates gamma exposure levels and intraday context for index instruments like SPY and ES. It calculates VWAP with standard deviation bands as a gamma flip proxy, highlighting market regimes through background colors. It plots prior day high, l
The Median indicator calculates the median of a selected source series such as the high-low average over a user-defined length and plots it as a red line on the price chart. It draws an EMA of the median as a blue line and fills the space between them, changin
This indicator calculates a base moving average (EMA, SMA, WMA, or HMA) and projects multiple symmetrical envelope bands around it directly on the price chart. Users can adjust the length, source, moving average type, and initial envelope multiplier. Additiona