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
312 lines of Pine Script v5 from Tradingview/orb-twisted-m-v2.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
ORB_twisted_m tracks the high and low of a customizable opening session and enters long or short positions when price breaks above or below the range. Position sizing defaults to three units, taking partial profits at user-defined range extension levels and trailing the remaining position via a simple moving average. Main settings control session times, target extension multipliers, trailing parameters, and daily trade limits. The strategy closes all positions at the end of the trading day.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
ORB Session (EST)
session
0930-0945
_orb_session
Trade Session (EST)
session
0945-1400
_trade_session
Extension 1 of Opening Range
float
0.50
_tp_amount1
Extension 2 of Opening Range
float
1.00
_tp_amount2
TP3 / Trail Line
int
3
_tp3_length
Trail Exit Type
string
On Close
_tp3_type
Close All Trades at 4pm (EST)
bool
true
_close_at_time
Only 1 Long & 1 Short Per Day
bool
true
_only_one_side
Color Candles
bool
false
_color_candles
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 overlay strategy tracks the high and low of a user-defined London session and plots the previous session levels as support and resistance. It flags a break beyond a level when price closes past an ATR buffer, then waits a set number of bars for a retest w
This strategy identifies an Opening Range based on user-defined Eastern Time session parameters and waits for a breakout. Rather than chasing the initial move, it enters positions when price pulls back to retest the Opening Range boundary with volume and EMA t
This strategy detects Opening Range Breakouts on indices during the New York trading session. It captures the high and low of the initial 30-minute bar from 9:30 to 10:00 AM ET. Signals trigger on price crossing above the range high when combined with an EMA 2
This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos
This script monitors opening gap conditions and breakout behavior relative to the first candle's range across up to twenty configurable stock tickers. It detects whether following bars remain inside the opening range before breaking out, displaying the status
This strategy trades SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.