Strategy · Pine Script v5 · On the chart

ORB + Fib + MACD Strategy

by alboogycOdR

This strategy builds a timed opening range and tracks session high and low on the price chart.

View on GitHub

GitHub stars6on the repository
Pine versionv5runs as is
Lines of code241
Settings18inputs
LicenceNone stated
Last update7 months ago16 Mar 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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

ORB + Fib + MACD Strategy flags bullish and bearish breakouts of that range and uses Fibonacci levels for an entry zone, a default stop, and an optional take-profit extension. Take profit can instead use the session high or low, fixed points, a risk-reward ratio, or a range multiple; the stop can use Fibonacci, fixed points, or ATR. Fast and slow EMA lengths and MACD lengths are settings. The script snippet ends before the order logic, so full entry filters are not shown.

Details

Published by

alboogycOdR on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Breakout, Support & resistance, Oscillators & momentum, Sessions & time

Markets

Any symbol

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Opening Range Duration (minutes)int30input_openingRangeMinutes
Fibonacci Entry Zone Startfloat0.50input_fibEntryStart
Fibonacci Entry Zone Endfloat0.618input_fibEntryEnd
Stop Loss Fibonacci Levelfloat0.786input_stopLossFibLevel
Take Profit MethodstringSession High/Lowinput_tpMethod
TP Fixed Points (Pips)float100.0input_tpFixedPoints
TP Risk-Reward Ratio (e.g., 2 for 1:2)float2.0input_tpRiskRewardRatio
TP Opening Range Multiplierfloat1.0input_tpRangeMultiplier
TP Fibonacci Extension Levelfloat1.272input_tpFibExtensionLevel
Stop Loss MethodstringFibonacci Levelinput_slMethod
SL Fixed Points (Pips)float50.0input_slFixedPoints
SL ATR Multiplierfloat1.5input_slAtrMultiplier
Show all 18 settings
SettingTypeDefaultVariable
SL ATR Lengthint14input_slAtrLength
Fast EMA Lengthint9input_emaFastLength
Slow EMA Lengthint21input_emaSlowLength
MACD Fast Lengthint12input_macdFastLength
MACD Slow Lengthint26input_macdSlowLength
MACD Signal Smoothingint9input_macdSignalSmoothing
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.

Similar Pine Scripts

106 stars

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

Strategy v4 Screeners & dashboardsBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 1St Bar GAP+BkOut Screener v2 by RM
53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized Strategy

Turtle MACD Time-Zone Filter

by skywalker0803r
42 stars

This strategy enters long when price closes above the prior Donchian high and short when it closes below the prior Donchian low, only while flat and inside a Taipei-hour window. It exits on a MACD histogram reversal or through an ATR stop and a percentage take

Strategy v5 BreakoutOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Turtle MACD Time-Zone Filter

Morning Scalp

by benso87
24 stars

This strategy tracks an opening session time range to establish directional bias and triggers pullback trades using Stochastic RSI. Once price breaks out of the initial range, it establishes a directional bias and enters when the Stochastic RSI crosses over in

Strategy v5 Sessions & timeBreakout
Updated 4 years ago · MPL-2.0 GitHub repository of Morning Scalp
7 stars

This strategy plots dynamic pivot-based support and resistance trendlines on the price chart and trades breakouts beyond those lines. By default it allows longs only when EMA 50 is above EMA 200 and an RSI-SMA momentum filter is met, with an ATR entry buffer.

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Easy Trendline - XAUUSD 30m
7 stars

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

Strategy v5 Sessions & timeSupport & resistance
Updated 3 months ago · None stated GitHub repository of London SR Cleaner WR (TP 0.20)

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers