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
3Commas Bot places the stop beyond a swing high or low using an ATR risk multiple, then sets a limit exit from the reward-to-risk ratio. An optional ATR trail can start after part of the target is reached. Settings toggle each side, reversals, a session filter, and a maximum-drawdown halt that stops new entries. It does not add to an open position in the same direction.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Detect Long Trades
bool
true
longTrades
Detect Short Trades
bool
true
shortTrades
Use Limit exit
bool
true
useLimit
Use ATR Trailing Stop
bool
false
trailStop
Allow Reversal Trades
bool
false
FLIP
Set Max Total DrawDown
bool
false
setMaxDrawdown
Reward to Risk Ratio
float
1
RnR
Risk Adjustment
float
1
RiskM
Swing Lookback
int
5
swinglookback
Max Drawdown (%)
int
20
maxPercDd
ATR length
int
14
atrLen
ATR Trailing Stop Multiplier
float
1.0
trailStopSize
Show all 28 settings
Setting
Type
Default
Variable
ATR Trailing Stop Source
string
High/Low
trailSource
R:R To Trigger Exit
float
0.0
rrExit
MA Type #1
string
EMA
maType1
MA Type #2
string
EMA
maType2
MA Length #1
int
21
maLength1
MA Length #2
int
50
maLength2
maBull1
color
#64b5f6
maBull1
maBear1
color
#ef5350
maBear1
maBull2
color
#64b5f6
maBull2
maBear2
color
#ef5350
maBear2
Draw entry price
bool
false
drawEntry
Draw trail trigger price
bool
true
exitLvl
Use Time Session Filter
bool
false
useTimeFilter
Time Session To Ignore Trades
session
0000-0300
timeSession
Start Filter
time
timestamp("01 Jan 2000 00:00 GMT-7")
startTime
End Filter
time
timestamp("01 Jan 2099 00:00 GMT-7")
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.
This strategy trades directional momentum breakouts for crude oil on the price chart. It enters long or short positions when a fast exponential moving average crosses a slow exponential moving average, provided that current Average True Range exceeds its movin
This strategy executes long and short trades on the price chart by combining multi-timeframe smoothed Heikin-Ashi trends, higher-timeframe Hull Moving Average variations, and an ATR-based trailing stop. Users can adjust timeframes, smoothing lengths, Hull form
The IBKR Safe Forex Strategy is a Pine Script v6 strategy that trades forex pairs using crossovers of 10-period and 50-period EMAs, filtered by a 200-period EMA and restricted to London or New York session overlap. It enters long positions on fast EMA above sl
This Pine Script v6 strategy uses multi-timeframe analysis to identify intraday trends and generate trading signals. It requests higher-timeframe data for trend context via EMAs and Supertrend direction. On the local timeframe it plots EMA cross signals for lo
This strategy template provides a modular foundation for building TradingView v6 backtests. It uses a placeholder Exponential Moving Average crossover signal combined with customizable filters for higher-timeframe trend alignment, volatility regime thresholds,
This mean-reversion strategy plots Bollinger Bands and a long-term moving average directly on the price chart. It enters trades when price candles penetrate the outer Bollinger Bands beyond a user-defined body percentage, anticipating a price reversal. Entries