1Copy the scriptPress Copy script above, or the copy button on the code below.
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
218 lines of Pine Script v6 from tfex_s50_atr_stoploss.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
S50 TFEX Strategy With ATR and Stoploss detects swing highs and swing lows with pivot points to generate long entries on swing highs and short entries on swing lows. The ATR indicator calculates dynamic stop-loss distances while the risk-reward ratio sets take-profit levels. Position sizes scale automatically with account equity and a user-set risk percentage per trade. Swing high and low prices are plotted on the chart. Key inputs adjust ATR length, risk-reward ratio, stop-loss points and table display. It repaints signals on the live bar.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
leftBars
int
21
leftBars
rightBars
int
2
rightBars
Risk % per Trade
int
1
riskPercent
ATR Length
int
10
atrLength
Risk-Reward Ratio
int
5
riskRewardRatio
Stoploss Point
int
9
stopLossPoint
Return Precision
int
2
prec
Show Return Rate Table On/Off
bool
true
show_table
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.
Box Scalper v4 is a strategy that plots buy and sell signals on the price chart using ADX trend filters, QQE momentum oscillator, and BOX channels. It signals entries based on crossovers and zone conditions, with trailing stop loss and take profit targets. Par
Liquidity Sweep Scalper v2 is a scalping strategy that detects liquidity sweeps using Supertrend trend filters, Bollinger Bands for volatility, Williams Fractals for pivots, and MACD momentum. It enters on rejection candle breaks after sweeps and exits via sto
This Pine Script v5 strategy generates buy and sell signals for XAUUSD on the price chart. It combines Stochastic Oscillator, RSI, EMA crossovers and Fibonacci retracements with M15 overbought/oversold triggers and rejection wick filters to identify entries. C
This strategy overlays a trend moving average and Supertrend bands directly on the price chart while calculating Stochastic RSI values internally. Long positions trigger when price exceeds the moving average, Supertrend signals bullish momentum, and the StochR
This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry
This strategy uses multiple VWAP anchors and a custom Lull indicator to generate buy and sell signals on the Nasdaq price chart. It plots the VWAP trend line and three VWAP anchors with customizable colors and mitigation methods. The Lull indicator produces si