OPEN-SOURCE SCRIPT

ORB + SMA + EMA + BUY/SELL by yuvaraj

107
ORB (Opening Range Breakout)

Meaning:
ORB stands for Opening Range Breakout.
It is a trading strategy where you watch the price movement for the first few minutes after the market opens (for example, 9:15 – 9:30 AM in India).
You mark the high and low during this period.

If price goes above the high, it signals a possible buy (long trade).

If price goes below the low, it signals a possible sell (short trade).

Why traders use it:

First few minutes decide the market direction.

Helps catch early momentum trades.

Very popular for intraday traders (Nifty, BankNifty, Crude Oil, etc.).

Example:

Market opens at 9:15.

First 5 minutes: High = 100, Low = 95.

If price moves above 100 → Buy.

If price moves below 95 → Sell.

📌 SMA (Simple Moving Average)

Meaning:
SMA stands for Simple Moving Average.
It is the average closing price of a stock over a certain number of candles.

Example:

SMA 9 → Average price of last 9 candles.

SMA 50 → Average price of last 50 candles.

Why traders use it:

Shows trend direction.

SMA going up → Uptrend, SMA going down → Downtrend.

You can use multiple SMAs (for example SMA 9 and SMA 50):

If SMA 9 crosses above SMA 50 → Buy signal.

If SMA 9 crosses below SMA 50 → Sell signal.

🔑 Key Difference:
Feature ORB SMA
Type Strategy (price breakout) Indicator (average price)
Use Entry trigger for trades Identifies trend direction
Works Best Intraday (first minutes) Any timeframe (intraday or swing)
Plots ORB High/Low lines for the first few minutes

Plots SMA 9/50/180 & EMA 20

Plots trailing stopline + Buy/Sell arrows

Optional bar color / background color toggle

Alert conditions for Buy/Sell
ORB high/low lines

SMA 9/50/180 + EMA 20

Buy/Sell arrows + trailing stopline

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.