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
138 lines of Pine Script v5 from Tradingview/microquant-trend-strat-ts.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
MicroQuant Trend Strat +TS enters long positions when the trend direction turns bullish and short positions when it turns bearish, filtered by an intraday trading session window. Position exits are controlled through customizable fixed take-profit and stop-loss levels, an ATR percentage trailing stop, and a monetary breakeven threshold. The indicator plots trailing steplines directly on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Price
source
close
price
Length
int
21
length
ATR Length
int
21
atrPeriod
Factor
float
4.0
factor
Trading Session
bool
true
use_sess
i_sess
session
0700-1700
i_sess
TP
bool
true
use_tp
tp_amount
float
20.00
tp_amount
SL
bool
true
use_sl
sl_amount
float
10.00
sl_amount
Trail Stop ATR %
bool
true
use_ts
ts_amount
float
300.00
ts_amount
Show all 14 settings
Setting
Type
Default
Variable
Breakeven Stop starts at $
bool
true
use_be
start_be
float
500
start_be
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 overlays Supertrend on the price chart and trades only inside a set session and backtest date range. It enters long when Supertrend turns up, or after a chosen candle delay while the trend is up, and enters short on the opposite conditions. It cl
This strategy identifies volatility breakout opportunities by constructing dynamic ATR-based price boxes and detecting volatility squeezes. Trades are filtered using an exponential moving average trend condition and designated session hours. Entries trigger up
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 overlay strategy combines EMA trend following with simple Smart Money Concepts filters. It reads H4 and H1 bias, then looks for a liquidity sweep plus a displacement candle in that direction, gated by ADX, ATR, and volume. Entries are allowed only in Lond
This strategy draws two moving averages on the price chart and uses their bias to open long or short trades. It 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 c
This strategy calculates the cross-market ratio between gold and EURUSD alongside an ATR volatility percentage and a higher-timeframe daily SMA trend filter. It executes session-tailored entries across the Asian, London, and New York sessions using RSI, ADX, a