Market Open Highlights (9:30 AM ET)This indicator zeroes in on the 9:30 AM Eastern Time market opens for NAS100 and US30, highlighting all market opens with a bold yet subtle yellow background. Tailored for precision backtesting, it uses TradingView’s timezone capabilities to pinpoint the exact 9:30 AM candle, skipping weekends to focus solely on U.S. equity market opens.
What It Does:
The script tracks the bar indices of all market opens at 9:30 AM ET, applying a semi-transparent yellow highlight to those candles. It’s a clean, efficient way to mark key session starts for analyzing price action or testing strategies.
How to Use It:
1. Apply the script to a chart of NAS100 (e.g., FX:NAS100) or US30 (e.g., FX:US30) in TradingView on any timeframe.
2. Set your chart timezone to "America/New_York" (Settings > Timezone/Sessions).
3. Scroll back through trading days to see the yellow highlights on the 9:30 AM candles.
4. While it functions across all timeframes, it’s optimized for 5-minute and 1-minute charts, where the 9:30 AM candle aligns precisely with the U.S. market open for detailed analysis.
5. Use it to study price behavior or refine strategies around this critical daily event.
Penunjuk dan strategi
Support & Resistance LevelsSupport & Resistance Levels (MTF) is an indicator that highlights key support and resistance zones using data from higher timeframes. It helps traders spot strong price levels and align entries with the broader market trend.
AlphaFlow: Oscillator Panelv2AlphaFlow: Oscillator Panel v2 – CryptoFace-Inspired Multi-Oscillator with Smart Signal Labels
This script is a tribute to the legendary CryptoFace and inspired by the visual power of Market Cipher. AlphaFlow expands on that concept with customization options, real-time confluence detection, and intelligent wave labeling for entries and exits.
Designed for discretionary trading, AlphaFlow offers a fully modular oscillator panel built from WaveTrend, RSI, VWAP-MACD, BBWP, Hybrid Money Flow, and HTF OBV Bias.
🎨 Visual Customization (Style Tab)
You can style this indicator to match your preferred look:
💠 Set WT fill area to blue @ 32% to get that Market Cipher vibe
💰 Set Hybrid Money Flow to Area style @ 80% opacity for clearer flow visualization
🔵 Change crosses to circles on WaveTrend turns for a cleaner chart
Everything is visible, togglable, and stylable via the Style tab.
🛠️ Inputs Panel (How to Tune It)
The Inputs tab gives you full control over:
WaveTrend lengths and OB/OS levels
RSI thresholds
BBWP squeeze lookbacks
MFI & CMF money flow weighting
Higher Timeframe (HTF) setting
✅ Suggestion: Try these timeframe combos for high-confidence MTF setups:
LTF (chart) HTF suggestion
1m or 3m 15m – 30m
5m 1h
15m 4h
1h 1D
4h 1D / 1W
🧠 v2 Features – Signal Labels: A / T / 👀
These new chart labels give you clear signals within structure:
🅰️ A = Anchor
A possible bottom/top forming, deep oversold/overbought WT1 pivot.
🟢 T = Trigger
Momentum confirmation after Anchor — your potential entry zone.
👀 Snake Eyes
Two Anchors forming within proximity — high-probability reversal signal.
These fire in real-time, based on wave structure — not repainting.
⚡ Multi-Timeframe Confluence Table
A real-time panel shows aligned conditions across:
WT1 crossovers (LTF & HTF)
RSI > 50 on both frames
VWAP MACD strength
OBV HTF bias (rising/falling)
When all are aligned ➜ “⚡ Fire Confirmed” shows up in the panel = high probability setup
🔐 License & Originality
Open Source | Pine Script™ v5
No repainting | No lookahead bias
Built from scratch to echo the visual experience of CryptoFace's Market Cipher, while using public indicators and original logic
This script is for educational, discretionary, and strategic use only — no auto buy/sell logic.
What Makes This Script Unique
AlphaFlow is not just a mashup of indicators — it’s a purpose-built multi-oscillator framework designed around real-world discretionary flow trading.
While inspired by Market Cipher’s visual principles, AlphaFlow introduces:
✅ Wave sequence signal labeling (Anchor / Trigger / Snake Eyes) to visually track pivot-confirmation momentum patterns in real time — this is not available in Market Cipher or standard indicators
✅ A Hybrid Money Flow Engine combining MFI + CMF into a single normalized flow stream
✅ Real-time Multi-Timeframe Confluence Matrix, showing alignment across WT, RSI, VWAP-MACD, and OBV HTF bias
✅ Full visual customization and minimalist styling options (color-coded WT fills, hybrid flow areas, and cleaner circles)
In addition to data — AlphaFlow gives you structure.
You don’t just see what’s happening — you understand the sequence behind the move.
Nifty 1m EMA Pullback Scalper Signals
### **Master the Market with the Sniper Scalping Strategy for Nifty (1-Minute Timeframe)**
Unlock the power of precision trading with this expertly crafted **Sniper Scalping Strategy**, designed specifically for the Nifty index on a lightning-fast 1-minute timeframe. Perfect for traders who thrive on quick decisions and small, consistent profits, this strategy combines multiple indicators to deliver razor-sharp entries and exits—ideal for India’s dynamic market.
#### **Why This Strategy Stands Out**
- **Pinpoint Accuracy**: Harness the synergy of the **5 EMA and 10 EMA crossover** to lock onto the short-term trend, while the **Stochastic Oscillator (14,3,3)** times your entries and exits with surgical precision.
- **Fast and Effective**: Tailored for the 1-minute chart, this strategy capitalizes on Nifty’s volatility, targeting **10-point profits** with a tight **5-point stop-loss**—keeping your risk low and rewards high.
- **Trend + Momentum**: Blend trend-following (EMAs) with momentum signals (Stochastic) for a robust, multi-dimensional approach that cuts through market noise.
#### **How It Works**
- **Buy Signal**: Enter long when the 5 EMA crosses above the 10 EMA and the Stochastic rises above 20—catching the uptrend at its sweet spot.
- **Sell Signal**: Go short when the 5 EMA dips below the 10 EMA and the Stochastic falls below 80—riding the downtrend with confidence.
- **Exit Like a Pro**: Take profits at 10 points or when the Stochastic hits overbought/oversold extremes, ensuring you’re in and out before the market shifts.
#### **Perfect for Nifty Scalpers**
Built for the fast-paced world of Nifty trading, this strategy shines during high-volatility sessions like the market open or global overlaps. Whether you’re a beginner honing your skills or a seasoned trader seeking consistency, the Sniper Scalping Strategy offers a clear, actionable framework to scalp profits with discipline and precision.
#### **Get Started**
Test it in a demo account, refine it to your style, and watch your scalping game soar. Trade smart, stay focused, and let the Sniper Scalping Strategy turn Nifty’s 1-minute moves into your edge!
TP/SL Percentage & RR Visual Tool📈 TP/SL Percentage & RR Visual Tool with UT Bot & EMA Suite
This all-in-one visual trading tool combines powerful precision with clean, dynamic overlays designed to help traders make smarter decisions in real time.
✅ Features:
TP/SL Lines + Zones
Visualize up to 3 Take Profit targets and your Stop Loss level on the chart. Zones are shaded for quick risk/reward perception.
Customizable Risk/Reward
Adjust TP/SL percentages and see real-time percentage distance from price, plus live R:R ratio.
Floating Table Display
A sleek, movable table shows:
Entry & Current Price
TP & SL values
% distance to TP
R:R Ratio
Current Session + Next Session time
Session Awareness
Automatically detects and displays whether you're in the Asian, London, or New York session. Highlights upcoming session transitions.
UT Bot Alerts Integration
Get clear Buy/Sell signals using trailing stop logic powered by ATR and optional Heikin Ashi candles.
Built-in EMAs (20, 50, 100, 200)
Customize and plot key moving averages directly on the chart with color-coded lines.
🔧 Customization Options:
TP/SL levels
Line style, color & thickness
EMA lengths
Table placement
Session timing logic
UT Bot sensitivity (ATR & key multiplier)
💡 Ideal For:
Scalping & intraday trading
Swing traders who use clear entry/exit zones
Anyone who wants clean R:R visuals and precision-based decisions
Intraday Macro & Flow Indicator# IntraMacroFlow Indicator
## Introduction
IntraMacroFlow is a volume and delta-based indicator that identifies significant price movements within trading sessions. It generates signals when volume spikes coincide with quality price movement, filtered by RSI to avoid overbought/oversold conditions.
> **Note:** This indicator provides multiple signals and should be combined with additional analysis methods such as support/resistance, trend direction, and price action patterns.
## Inputs
### Volume Settings
* **Volume Lookback Period** (14) - Number of bars for volume moving average calculation
* **Volume Threshold Multiplier** (1.5) - Required volume increase over average to generate signals
* **Delta Threshold** (0.3) - Required close-to-open movement relative to bar range (higher = stronger movement)
### Session Configuration
* **Use Dynamic Session Detection** (true) - Automatically determine session times
* **Highlight Market Open Period** (true) - Highlight first third of trading session
* **Highlight Mid-Session Period** (true) - Highlight middle portion of trading session
* **Detect Signals Throughout Whole Session** (true) - Find signals in entire session
* **Session Time** ("0930-1600") - Trading hours in HHMM-HHMM format
* **Session Type** ("Regular") - Select Regular, Extended, or Custom session
### Manual Session Settings
Used when dynamic detection is disabled:
* **Manual Session Open Hour** (9)
* **Manual Session Open Minute** (30)
* **Manual Session Open Duration** (60)
* **Manual Mid-Session Start Hour** (12)
* **Manual Mid-Session End Hour** (14)
## How It Works
The indicator analyzes each bar using three primary conditions:
1. **Volume Condition**: Current volume > Average volume × Threshold
2. **Delta Condition**: |Close-Open|/Range > Delta threshold
3. **Time Condition**: Bar falls within configured session times
When all conditions are met:
* Bullish signals appear when close > open and RSI < 70
* Bearish signals appear when close < open and RSI > 30
## Display Elements
### Shapes and Colors
* Green triangles below bars - Bullish signals
* Red triangles above bars - Bearish signals
* Blue background - Market open period
* Purple background - Mid-session period
* Bar coloring - Green (bullish), Red (bearish), or unchanged
### Information Panel
A dynamic label shows:
* Current volume relative to average (Vol)
* Delta value for current bar (Delta)
* RSI value (RSI)
* Session status (Active/Closed)
## Calculation Method
```
// Volume Condition
volumeMA = ta.sma(volume, lookbackPeriod)
volumeCondition = volume > volumeMA * volumeThreshold
// Delta Calculation (price movement quality)
priceRange = high - low
delta = math.abs(close - open) / priceRange
deltaCondition = delta > deltaThreshold
// Direction and RSI Filter
bullishBias = close > open and entrySignal and not (rsi > 70)
bearishBias = close < open and entrySignal and not (rsi < 30)
```
## Usage Recommendations
### Suitable Markets
* Equities during regular trading hours
* Futures markets
* Forex during active sessions
* Cryptocurrencies with defined volume patterns
### Recommended Timeframes
* 1-minute to 1-hour (optimal: 5 or 15-minute)
### Parameter Adjustments
* For fewer but stronger signals: increase Volume Threshold (2.0+) and Delta Threshold (0.4-0.6)
* For more signals: decrease Volume Threshold (1.2-1.5) and Delta Threshold (0.2-0.3)
### Usage Tips
* Combine with trend analysis for higher-probability entries
* Focus on signals occurring at session boundaries and mid-session
* Use opposite signals as potential exit points
* Configure alerts to receive notifications when signals occur
## Additional Notes
* RSI parameters are fixed at 14 periods with 70/30 thresholds
* The indicator handles overnight sessions correctly
* Fully compatible with TradingView alerts
* Customizable visual elements
## Release Notes
Initial release: This is a template indicator that should be customized to suit your specific trading strategies and preferences.
Omid's BPAWhat does this indicator provide me with?
Candle count
Exponential Moving Average (EMA)
Breakout from structure
Gaps between candles
Display of order blocks (not effective for price action)
Opening gap of the day
Key daily, weekly, and monthly levels
Inside bars and outside bars
این اندیکاتور چه امکاناتی را در اختیار من قرار میدهد؟
شمارش کندلها
میانگین متحرک نمایی (EMA)
تشخیص بریکاوت از ساختار
شناسایی گپها بین کندلها
نمایش اردربلاکها (بدون کارایی برای پرایس اکشن)
گپ ابتدای روز
نمایش سطوح کلیدی روزانه، هفتگی و ماهانه
شناسایی کندلهای اینساید بار و اوتساید بار
MA Crossover Buy/Sell Signals//@version=5
indicator("MA Crossover Buy/Sell Signals", overlay=true)
// Input for moving average lengths
fastLength = input.int(9, title="Fast MA Length", minval=1)
slowLength = input.int(21, title="Slow MA Length", minval=1)
// Calculate moving averages
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
// Define buy and sell conditions
buySignal = ta.crossover(fastMA, slowMA)
sellSignal = ta.crossunder(fastMA, slowMA)
// Plot moving averages on the chart
plot(fastMA, color=color.blue, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
// Plot buy and sell signals
plotshape(buySignal, title="Buy", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sell", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
Key-level-3.1 ob bb msb fvg
//@version=5
indicator("Key-level-3.1 ob bb msb fvg","key level 3" ,overlay = true, max_lines_count = 66, max_labels_count = 66)
// -----------------------------------------------------------------------------
// edited by berkusa
// -----------------------------------------------------------------------------
showprice= input.bool(true, title = "fiyatlari goster veya gosterme ")
///level func
f_create_level(_type, _start_condition, _active_condition, _global_level_array, _color, _line_width, _line_ext, _line_style, _label_size, _title, _iter, _is_enabled) =>
var float _price = na
var int _start_time = na
var float _hh = na
var float _ll = na
var line _price_line = line.new(x1 = na, y1 = na, x2 = na, y2 = na, xloc = xloc.bar_time, color = _color, width = _line_width, style = _line_style)
var label _price_label = label.new(x = na, y = na, xloc = xloc.bar_time, style = label.style_label_left, color = #00000000, size = _label_size, textcolor = _color)
_end_time = int(time + _line_ext * ta.change(time))
if _type == "open"
if _start_condition
_price := open
_start_time := time
else if _type == "high"
if _start_condition
_price := high
_start_time := time
else if _active_condition
_price := math.max(_price, high)
else if _type == "low"
if _start_condition
_price := low
_start_time := time
else if _active_condition
_price := math.min(_price, low)
else if _type == "eq"
if _start_condition
_hh := high
_ll := low
_price := math.avg(_hh, _ll)
_start_time := time
else if _active_condition
_hh := math.max(_hh, high)
_ll := math.min(_ll, low)
_price := math.avg(_hh, _ll)
float _price_val = _iter == 0 ? _price : ta.valuewhen(_start_condition, _price , _iter - 1)
int _start_time_val = _iter == 0 ? _start_time : ta.valuewhen(_start_condition, _start_time , _iter - 1)
_found_existing = array.indexof(_global_level_array, _price_val) > -1
if _is_enabled
if _found_existing
line.set_xy1(_price_line, x = na, y = na)
line.set_xy2(_price_line, x = na, y = na)
label.set_xy(_price_label, x = na, y = na)
else
array.push(_global_level_array, _price_val)
line.set_xy1(_price_line, x = _start_time_val, y = _price_val)
line.set_xy2(_price_line, x = _end_time, y = _price_val)
label.set_xy(_price_label, x = _end_time, y = _price_val)
label.set_text(_price_label , text = showprice? _title + " : " + str.tostring(_price_val): _title )
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// }
// Necessary Variables {
// -----------------------------------------------------------------------------
// Global arrays used to detect duplicate levels.
// Duplication is detected implicitly by execution order and whether the level has already been placed in the global array.
float global_open_array = array.new_float()
float global_high_array = array.new_float()
float global_low_array = array.new_float()
float global_eq_array = array.new_float()
new_H4 = ta.change(time("240")) != 0
new_day = ta.change(time("D")) != 0
new_week = ta.change(time("W")) != 0
new_month = ta.change(time("M")) != 0
new_quarter = ta.change(time("3M")) != 0
new_year = ta.change(time("12M")) != 0
is_monday = dayofweek == dayofweek.monday
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// }
// Global settings {
// -----------------------------------------------------------------------------
//inp_open_line_style = input.string("Solid", options = , title = "Open Line Style", group = "Global Settings")
//inp_high_line_style = input.string("Dashed", options = , title = "High Line Style", group = "Global Settings")
//inp_low_line_style = input.string("Dashed", options = , title = "Low Line Style", group = "Global Settings")
//inp_eq_line_style = input.string("Dotted", options = , title = "EQ Line Style", group = "Global Settings")
inp_open_line_style = "Solid"// input.string("Solid", options = , title = "Open Line Style", group = "Global Settings")
inp_high_line_style = "Dashed"// input.string("Dashed", options = , title = "High Line Style", group = "Global Settings")
inp_low_line_style = "Dashed"// input.string("Dashed", options = , title = "Low Line Style", group = "Global Settings")
inp_eq_line_style = "Dotted"// input.string("Dotted", options = , title = "EQ Line Style", group = "Global Settings")
inp_text_size = input.string("Small", options = , title = "Text Size", group = "Global Settings")
inp_ext = input.int(30, title = "Line Extension", group = "Global Settings")
text_size = inp_text_size == "Small" ? size.small : inp_text_size == "Normal" ? size.normal : size.large
open_line_style = inp_open_line_style == "Solid" ? line.style_solid : inp_open_line_style == "Dotted" ? line.style_dotted : line.style_dashed
high_line_style = inp_high_line_style == "Solid" ? line.style_solid : inp_high_line_style == "Dotted" ? line.style_dotted : line.style_dashed
low_line_style = inp_low_line_style == "Solid" ? line.style_solid : inp_low_line_style == "Dotted" ? line.style_dotted : line.style_dashed
eq_line_style = inp_eq_line_style == "Solid" ? line.style_solid : inp_eq_line_style == "Dotted" ? line.style_dotted : line.style_dashed
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// }
// H4 and Prev H4
// -----------------------------------------------------------------------------
h4 = input.bool(true, title = "H4", group = "H4 Levels", inline = "1")
inp_show_H4_open = input.bool(true, title = "OPEN", group = "H4 Levels", inline = "1")
inp_show_H4_high = input.bool(false, title = "HIGH", group = "H4 Levels", inline = "1")
inp_show_H4_low = input.bool(false, title = "LOW", group = "H4 Levels", inline = "1")
inp_show_H4_eq = input.bool(false, title = "EQ", group = "H4 Levels", inline = "1")
inp_H4_col = input.color(color.teal, title = "color", group = "H4 Levels", inline = "2")
inp_H4_line_width =1// input.int(1, title = "Line width", minval = 1, group = "H4 Levels", inline = "2")
H4_ok = timeframe.isintraday and timeframe.multiplier < 240
f_create_level("open", new_H4, not new_H4, global_open_array, inp_H4_col, inp_H4_line_width, inp_ext, open_line_style, text_size, "H4-O", 0, inp_show_H4_open and H4_ok and h4 )
f_create_level("high", new_H4, not new_H4, global_high_array, inp_H4_col, inp_H4_line_width, inp_ext, high_line_style, text_size, "H4-H", 0, inp_show_H4_high and H4_ok and h4 )
f_create_level("low", new_H4, not new_H4, global_low_array, inp_H4_col, inp_H4_line_width, inp_ext, low_line_style, text_size, "H4-L", 0, inp_show_H4_low and H4_ok and h4 )
f_create_level("eq", new_H4, not new_H4, global_eq_array, inp_H4_col, inp_H4_line_width, inp_ext, eq_line_style, text_size, "H4-EQ", 0, inp_show_H4_eq and H4_ok and h4 )
prev_H4 = input.bool(true, title = "P-H4", group = "Prev H4 Levels", inline = "1")
inp_show_prev_H4_open = input.bool(true, title = "OPEN", group = "Prev H4 Levels", inline = "1")
inp_show_prev_H4_high = input.bool(false, title = "HIGH", group = "Prev H4 Levels", inline = "1")
inp_show_prev_H4_low = input.bool(false, title = "LOW", group = "Prev H4 Levels", inline = "1")
inp_show_prev_H4_eq = input.bool(false, title = "EQ", group = "Prev H4 Levels", inline = "1")
inp_prev_H4_col = input.color(color.olive, title = "color", group = "Prev H4 Levels", inline = "2")
inp_prev_H4_line_width =1// input.int(1, title = "Line width", minval = 1, group = "Prev H4 Levels", inline = "2")
f_create_level("open", new_H4, not new_H4, global_open_array, inp_prev_H4_col, inp_prev_H4_line_width, inp_ext, open_line_style, text_size, "P-H4-O", 1, inp_show_prev_H4_open and H4_ok and prev_H4)
f_create_level("high", new_H4, not new_H4, global_high_array, inp_prev_H4_col, inp_prev_H4_line_width, inp_ext, high_line_style, text_size, "P-H4-H", 1, inp_show_prev_H4_high and H4_ok and prev_H4)
f_create_level("low", new_H4, not new_H4, global_low_array, inp_prev_H4_col, inp_prev_H4_line_width, inp_ext, low_line_style, text_size, "P-H4-L", 1, inp_show_prev_H4_low and H4_ok and prev_H4)
f_create_level("eq", new_H4, not new_H4, global_eq_array, inp_prev_H4_col, inp_prev_H4_line_width, inp_ext, eq_line_style, text_size, "P-H4-EQ", 1, inp_show_prev_H4_eq and H4_ok and prev_H4)
// -----------------------------------------------------------------------------
// Daily and Prev Daily
// -----------------------------------------------------------------------------
daily = input.bool(true, title = "D", group = "Daily Levels", inline = "1")
inp_show_daily_open = input.bool(true, title = "OPEN", group = "Daily Levels", inline = "1")
inp_show_daily_high = input.bool(true, title = "HIGH", group = "Daily Levels", inline = "1")
inp_show_daily_low = input.bool(true, title = "LOW", group = "Daily Levels", inline = "1")
inp_show_daily_eq = input.bool(true, title = "EQ", group = "Daily Levels", inline = "1")
inp_daily_col = input.color(color.silver, title = "color", group = "Daily Levels", inline = "2")
inp_daily_line_width =1// input.int(1, title = "Line width", minval = 1, group = "Daily Levels", inline = "2")
daily_ok = timeframe.isintraday
f_create_level("open", new_day, not new_day, global_open_array, inp_daily_col, inp_daily_line_width, inp_ext, open_line_style, text_size, "DO", 0, inp_show_daily_open and daily_ok and daily)
f_create_level("high", new_day, not new_day, global_high_array, inp_daily_col, inp_daily_line_width, inp_ext, high_line_style, text_size, "DH", 0, inp_show_daily_high and daily_ok and daily)
f_create_level("low", new_day, not new_day, global_low_array, inp_daily_col, inp_daily_line_width, inp_ext, low_line_style, text_size, "DL", 0, inp_show_daily_low and daily_ok and daily)
f_create_level("eq", new_day, not new_day, global_eq_array, inp_daily_col, inp_daily_line_width, inp_ext, eq_line_style, text_size, "D-EQ", 0, inp_show_daily_eq and daily_ok and daily)
prev_daily = input.bool(true, title = "PD", group = "Prev Daily Levels", inline = "1")
inp_show_prev_daily_open = input.bool(true, title = "OPEN", group = "Prev Daily Levels", inline = "1")
inp_show_prev_daily_high = input.bool(true, title = "HIGH", group = "Prev Daily Levels", inline = "1")
inp_show_prev_daily_low = input.bool(true, title = "LOW", group = "Prev Daily Levels", inline = "1")
inp_show_prev_daily_eq = input.bool(false, title = "EQ", group = "Prev Daily Levels", inline = "1")
inp_prev_daily_col = input.color(color.gray, title = "color", group = "Prev Daily Levels", inline = "2")
inp_prev_daily_line_width = 1//input.int(1, title = "Line width", minval = 1, group = "Prev Daily Levels", inline = "2")
dd = input.int(1, title = "dayback", minval = 1,maxval=7, group = "Prev Daily Levels", inline = "2")
if dd >= 1
f_create_level("open", new_day, not new_day, global_open_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, open_line_style, text_size, "P-DO", 1, inp_show_prev_daily_open and daily_ok and prev_daily )
f_create_level("high", new_day, not new_day, global_high_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, high_line_style, text_size, "P-DH", 1 , inp_show_prev_daily_high and daily_ok and prev_daily )
f_create_level("low", new_day, not new_day, global_low_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, low_line_style, text_size, "P-DL", 1, inp_show_prev_daily_low and daily_ok and prev_daily )
f_create_level("eq", new_day, not new_day, global_eq_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, eq_line_style, text_size, "P-D-EQ", 1, inp_show_prev_daily_eq and daily_ok and prev_daily )
if dd >= 2
f_create_level("open", new_day, not new_day, global_open_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, open_line_style, text_size, "P-DO-2", 2, inp_show_prev_daily_open and daily_ok and prev_daily )
f_create_level("high", new_day, not new_day, global_high_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, high_line_style, text_size, "P-DH-2", 2 , inp_show_prev_daily_high and daily_ok and prev_daily )
f_create_level("low", new_day, not new_day, global_low_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, low_line_style, text_size, "P-DL-2", 2, inp_show_prev_daily_low and daily_ok and prev_daily )
f_create_level("eq", new_day, not new_day, global_eq_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, eq_line_style, text_size, "P-D-EQ-2", 2, inp_show_prev_daily_eq and daily_ok and prev_daily )
if dd >= 3
f_create_level("open", new_day, not new_day, global_open_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, open_line_style, text_size, "P-DO-3", dd, inp_show_prev_daily_open and daily_ok and prev_daily )
f_create_level("high", new_day, not new_day, global_high_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, high_line_style, text_size, "P-DH-3", dd , inp_show_prev_daily_high and daily_ok and prev_daily )
f_create_level("low", new_day, not new_day, global_low_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, low_line_style, text_size, "P-DL-3", dd, inp_show_prev_daily_low and daily_ok and prev_daily )
f_create_level("eq", new_day, not new_day, global_eq_array, inp_prev_daily_col, inp_prev_daily_line_width, inp_ext, eq_line_style, text_size, "P-D-EQ-3", dd, inp_show_prev_daily_eq and daily_ok and prev_daily )
// -----------------------------------------------------------------------------
// Weekly and Prev Weekly
// -----------------------------------------------------------------------------
weekly = input.bool(true, title = "W", group = "Weekly Levels", inline = "1")
inp_show_weekly_open = input.bool(true, title = "OPEN", group = "Weekly Levels", inline = "1")
inp_show_weekly_high = input.bool(true, title = "HIGH", group = "Weekly Levels", inline = "1")
inp_show_weekly_low = input.bool(true, title = "LOW", group = "Weekly Levels", inline = "1")
inp_show_weekly_eq = input.bool(false, title = "EQ", group = "Weekly Levels", inline = "1")
inp_weekly_col = input.color(color.aqua, title = "color", group = "Weekly Levels", inline = "2")
inp_weekly_line_width =1// input.int(1, title = "Line width", minval = 1, group = "Weekly Levels", inline = "2")
weekly_ok = timeframe.isintraday or timeframe.isdaily
f_create_level("open", new_week, not new_week, global_open_array, inp_weekly_col, inp_weekly_line_width, inp_ext, open_line_style, text_size, "WO", 0, inp_show_weekly_open and weekly_ok and weekly )
f_create_level("high", new_week, not new_week, global_high_array, inp_weekly_col, inp_weekly_line_width, inp_ext, high_line_style, text_size, "WH", 0, inp_show_weekly_high and weekly_ok and weekly )
f_create_level("low", new_week, not new_week, global_low_array, inp_weekly_col, inp_weekly_line_width, inp_ext, low_line_style, text_size, "WL", 0, inp_show_weekly_low and weekly_ok and weekly )
f_create_level("eq", new_week, not new_week, global_eq_array, inp_weekly_col, inp_weekly_line_width, inp_ext, eq_line_style, text_size, "W-EQ", 0, inp_show_weekly_eq and weekly_ok and weekly )
prev_weekly = input.bool(true, title = "PW", group = "Prev Weekly Levels", inline = "1")
inp_show_prev_weekly_open = input.bool(true, title = "OPEN", group = "Prev Weekly Levels", inline = "1")
inp_show_prev_weekly_high = input.bool(false, title = "HIGH", group = "Prev Weekly Levels", inline = "1")
inp_show_prev_weekly_low = input.bool(false, title = "LOW", group = "Prev Weekly Levels", inline = "1")
inp_show_prev_weekly_eq = input.bool(false, title = "EQ", group = "Prev Weekly Levels", inline = "1")
inp_prev_weekly_col = input.color(color.blue, title = "color", group = "Prev Weekly Levels", inline = "2")
inp_prev_weekly_line_width = 1//input.int(1, title = "Line width", minval = 1, group = "Prev Weekly Levels", inline = "2")
ww = input.int(1, title = "weekback", minval = 1,maxval=5, group = "Prev Weekly Levels", inline = "2")
f_create_level("open", new_week, not new_week, global_open_array, inp_prev_weekly_col, inp_prev_weekly_line_width, inp_ext, open_line_style, text_size, "P-WO", ww, inp_show_prev_weekly_open and weekly_ok and prev_weekly)
f_create_level("high", new_week, not new_week, global_high_array, inp_prev_weekly_col, inp_prev_weekly_line_width, inp_ext, high_line_style, text_size, "P-WH", ww, inp_show_prev_weekly_high and weekly_ok and prev_weekly)
f_create_level("low", new_week, not new_week, global_low_array, inp_prev_weekly_col, inp_prev_weekly_line_width, inp_ext, low_line_style, text_size, "P-WL", ww, inp_show_prev_weekly_low and weekly_ok and prev_weekly)
f_create_level("eq", new_week, not new_week, global_eq_array, inp_prev_weekly_col, inp_prev_weekly_line_width, inp_ext, eq_line_style, text_size, "P-W-EQ", ww, inp_show_prev_weekly_eq and weekly_ok and prev_weekly)
// Monday and Prev Monday
// -----------------------------------------------------------------------------
// Note : Monday range is a special case and is why the _active_condition is implemented in the function. We only want start on Monday, and ONLY update levels during monday.
monday_open = input.bool(false, title = "MonD", group = "Monday Levels", inline = "1")
inp_show_monday_open = input.bool(false, title = "OPEN", group = "Monday Levels", inline = "1")
inp_show_monday_high = input.bool(false, title = "HIGH", group = "Monday Levels", inline = "1")
inp_show_monday_low = input.bool(false, title = "LOW", group = "Monday Levels", inline = "1")
inp_show_monday_eq = input.bool(false, title = "EQ", group = "Monday Levels", inline = "1")
inp_monday_col = input.color(color.fuchsia, title = "color", group = "Monday Levels", inline = "2")
inp_monday_line_width = 1//input.int(1, title = "Line width", minval = 1, group = "Monday Levels", inline = "2")
monday_ok = timeframe.isintraday
f_create_level("open", new_week, is_monday, global_open_array, inp_monday_col, inp_monday_line_width, inp_ext, open_line_style, text_size, "M.Day-O", 0, inp_show_monday_open and monday_ok and monday_open)
f_create_level("high", new_week, is_monday, global_high_array, inp_monday_col, inp_monday_line_width, inp_ext, high_line_style, text_size, "M.Day-H", 0, inp_show_monday_high and monday_ok and monday_open)
f_create_level("low", new_week, is_monday, global_low_array, inp_monday_col, inp_monday_line_width, inp_ext, low_line_style, text_size, "M.Day-L", 0, inp_show_monday_low and monday_ok and monday_open)
f_create_level("eq", new_week, is_monday, global_eq_array, inp_monday_col, inp_monday_line_width, inp_ext, eq_line_style, text_size, "M.Day-EQ", 0, inp_show_monday_eq and monday_ok and monday_open)
prev_monday = input.bool(false, title = "p-mon", group = "Prev Monday Levels", inline = "1")
inp_show_prev_monday_open = input.bool(false, title = "OPEN", group = "Prev Monday Levels", inline = "1")
inp_show_prev_monday_high = input.bool(false, title = "HIGH", group = "Prev Monday Levels", inline = "1")
inp_show_prev_monday_low = input.bool(false, title = "LOW", group = "Prev Monday Levels", inline = "1")
inp_show_prev_monday_eq = input.bool(false, title = "EQ", group = "Prev Monday Levels", inline = "1")
inp_prev_monday_col = input.color(color.purple, title = "color", group = "Prev Monday Levels", inline = "2")
inp_prev_monday_line_width = 1//input.int(1, title = "Line width", minval = 1, group = "Prev Monday Levels", inline = "2")
f_create_level("open", new_week, is_monday, global_open_array, inp_prev_monday_col, inp_prev_monday_line_width, inp_ext, open_line_style, text_size, "P-M.Day-O", 1, inp_show_prev_monday_open and monday_ok and prev_monday and prev_monday)
f_create_level("high", new_week, is_monday, global_high_array, inp_prev_monday_col, inp_prev_monday_line_width, inp_ext, high_line_style, text_size, "P-M.Day-H", 1, inp_show_prev_monday_high and monday_ok and prev_monday and prev_monday)
f_create_level("low", new_week, is_monday, global_low_array, inp_prev_monday_col, inp_prev_monday_line_width, inp_ext, low_line_style, text_size, "P-M.Day-L", 1, inp_show_prev_monday_low and monday_ok and prev_monday and prev_monday)
f_create_level("eq", new_week, is_monday, global_eq_array, inp_prev_monday_col, inp_prev_monday_line_width, inp_ext, eq_line_style, text_size, "P-M.Day-EQ", 1, inp_show_prev_monday_eq and monday_ok and prev_monday and prev_monday)
// -----------------------------------------------------------------------------
// Monthly and Prev Monthly
// -----------------------------------------------------------------------------
monthly = input.bool(true, title = "M", group = "Monthly Levels", inline = "1")
inp_show_monthly_open = input.bool(true, title = "OPEN", group = "Monthly Levels", inline = "1")
inp_show_monthly_high = input.bool(true, title = "HIGH", group = "Monthly Levels", inline = "1")
inp_show_monthly_low = input.bool(true, title = "LOW", group = "Monthly Levels", inline = "1")
inp_show_monthly_eq = input.bool(false, title = "EQ", group = "Monthly Levels", inline = "1")
inp_monthly_col = input.color(color.lime, title = "color", group = "Monthly Levels", inline = "2")
inp_monthly_line_width = 1//input.int(1, title = "Line width", minval = 1 ,group = "Monthly Levels", inline = "2")
monthly_ok = timeframe.isintraday or timeframe.isdaily
f_create_level("open", new_month, not new_month, global_open_array, inp_monthly_col, inp_monthly_line_width, inp_ext, open_line_style, text_size, "MO", 0, inp_show_monthly_open and monthly_ok and monthly )
f_create_level("high", new_month, not new_month, global_high_array, inp_monthly_col, inp_monthly_line_width, inp_ext, high_line_style, text_size, "MH", 0, inp_show_monthly_high and monthly_ok and monthly )
f_create_level("low", new_month, not new_month, global_low_array, inp_monthly_col, inp_monthly_line_width, inp_ext, low_line_style, text_size, "ML", 0, inp_show_monthly_low and monthly_ok and monthly )
f_create_level("eq", new_month, not new_month, global_eq_array, inp_monthly_col, inp_monthly_line_width, inp_ext, eq_line_style, text_size, "M-EQ", 0, inp_show_monthly_eq and monthly_ok and monthly )
prev_monthly = input.bool(true, title = "PM", group = "Prev Monthly Levels", inline = "1")
inp_show_prev_monthly_open = input.bool(true, title = "OPEN", group = "Prev Monthly Levels", inline = "1")
inp_show_prev_monthly_high = input.bool(false, title = "HIGH", group = "Prev Monthly Levels", inline = "1")
inp_show_prev_monthly_low = input.bool(false, title = "LOW", group = "Prev Monthly Levels", inline = "1")
inp_show_prev_monthly_eq = input.bool(false, title = "EQ", group = "Prev Monthly Levels", inline = "1")
inp_prev_monthly_col = input.color(color.green, title = "color", group = "Prev Monthly Levels", inline = "2")
inp_prev_monthly_line_width =1// input.int(1, title = "Line width", minval = 1, group = "Prev Monthly Levels", inline = "2")
mm = input.int(1, title = "monthback", minval = 1,maxval=13, group = "Prev Monthly Levels", inline = "2")
f_create_level("open", new_month, not new_month, global_open_array, inp_prev_monthly_col, inp_prev_monthly_line_width, inp_ext, open_line_style, text_size, "P-MO", mm, inp_show_prev_monthly_open and monthly_ok and prev_monthly and prev_monthly )
f_create_level("high", new_month, not new_month, global_high_array, inp_prev_monthly_col, inp_prev_monthly_line_width, inp_ext, high_line_style, text_size, "P-MH", mm, inp_show_prev_monthly_high and monthly_ok and prev_monthly and prev_monthly )
f_create_level("low", new_month, not new_month, global_low_array, inp_prev_monthly_col, inp_prev_monthly_line_width, inp_ext, low_line_style, text_size, "P-ML", mm, inp_show_prev_monthly_low and monthly_ok and prev_monthly and prev_monthly )
f_create_level("eq", new_month, not new_month, global_eq_array, inp_prev_monthly_col, inp_prev_monthly_line_width, inp_ext, eq_line_style, text_size, "P-M-EQ", mm, inp_show_prev_monthly_eq and monthly_ok and prev_monthly and prev_monthly )
// -----------------------------------------------------------------------------
// Quarterly and Prev Quarterly
// -----------------------------------------------------------------------------
quarterly = input.bool(false, title = "Q", group = "Quarterly Levels", inline = "1")
inp_show_quarterly_open = input.bool(false, title = "OPEN", group = "Quarterly Levels", inline = "1")
inp_show_quarterly_high = input.bool(false, title = "HIGH", group = "Quarterly Levels", inline = "1")
inp_show_quarterly_low = input.bool(false, title = "LOW", group = "Quarterly Levels", inline = "1")
inp_show_quarterly_eq = input.bool(false, title = "EQ", group = "Quarterly Levels", inline = "1")
inp_quarterly_col = input.color(color.orange, title = "color", group = "Quarterly Levels", inline = "2")
inp_quarterly_line_width = 1//input.int(1, title = "Line width", minval = 1, group = "Quarterly Levels", inline = "2")
quarterly_ok = timeframe.isintraday or timeframe.isdaily or timeframe.isweekly
f_create_level("open", new_quarter, not new_quarter, global_open_array, inp_quarterly_col, inp_quarterly_line_width, inp_ext, open_line_style, text_size, "3M-O", 0, inp_show_quarterly_open and quarterly_ok and quarterly)
f_create_level("high", new_quarter, not new_quarter, global_high_array, inp_quarterly_col, inp_quarterly_line_width, inp_ext, high_line_style, text_size, "3M-H", 0, inp_show_quarterly_high and quarterly_ok and quarterly)
f_create_level("low", new_quarter, not new_quarter, global_low_array, inp_quarterly_col, inp_quarterly_line_width, inp_ext, low_line_style, text_size, "3M-L", 0, inp_show_quarterly_low and quarterly_ok and quarterly)
f_create_level("eq", new_quarter, not new_quarter, global_eq_array, inp_quarterly_col, inp_quarterly_line_width, inp_ext, eq_line_style, text_size, "3M-EQ", 0, inp_show_quarterly_eq and quarterly_ok and quarterly)
prev_quarterly = input.bool(false, title = "PQ", group = "Prev Quarterly Levels", inline = "1")
inp_show_prev_quarterly_open = input.bool(false, title = "OPEN", group = "Prev Quarterly Levels", inline = "1")
inp_show_prev_quarterly_high = input.bool(false, title = "HIGH", group = "Prev Quarterly Levels", inline = "1")
inp_show_prev_quarterly_low = input.bool(false, title = "LOW", group = "Prev Quarterly Levels", inline = "1")
inp_show_prev_quarterly_eq = input.bool(false, title = "EQ", group = "Prev Quarterly Levels", inline = "1")
inp_prev_quarterly_col = input.color(color.yellow, title = "color", group = "Prev Quarterly Levels", inline = "2")
inp_prev_quarterly_line_width = 1//input.int(1, title = "Line width", minval = 1, group = "Prev Quarterly Levels", inline = "2")
qq = input.int(1, title = "Quarterback", minval = 1,maxval=12, group = "Prev Quarterly Levels", inline = "2")
f_create_level("open", new_quarter, not new_quarter, global_open_array, inp_prev_quarterly_col, inp_prev_quarterly_line_width, inp_ext, open_line_style, text_size, "P 3MOpen", mm, inp_show_prev_quarterly_open and quarterly_ok and prev_quarterly and qq)
f_create_level("high", new_quarter, not new_quarter, global_high_array, inp_prev_quarterly_col, inp_prev_quarterly_line_width, inp_ext, high_line_style, text_size, "Prev 3MHIGH", mm, inp_show_prev_quarterly_high and quarterly_ok and prev_quarterly and qq)
f_create_level("low", new_quarter, not new_quarter, global_low_array, inp_prev_quarterly_col, inp_prev_quarterly_line_width, inp_ext, low_line_style, text_size, "P-3MLOW", mm, inp_show_prev_quarterly_low and quarterly_ok and prev_quarterly and qq)
f_create_level("eq", new_quarter, not new_quarter, global_eq_array, inp_prev_quarterly_col, inp_prev_quarterly_line_width, inp_ext, eq_line_style, text_size, "P-3M-EQ", mm, inp_show_prev_quarterly_eq and quarterly_ok and prev_quarterly and qq)
// -----------------------------------------------------------------------------
// Yearly & Prev Yearly
// -----------------------------------------------------------------------------
yearly = input.bool(false, title = "Y", group = "Yearly Levels", inline = "1")
inp_show_yearly_open = input.bool(false, title = "OPEN", group = "Yearly Levels", inline = "1")
inp_show_yearly_high = input.bool(false, title = "HIGH", group = "Yearly Levels", inline = "1")
inp_show_yearly_low = input.bool(false, title = "LOW", group = "Yearly Levels", inline = "1")
inp_show_yearly_eq = input.bool(false, title = "EQ", group = "Yearly Levels", inline = "1")
inp_yearly_col = input.color(color.red, title = "color", group = "Yearly Levels", inline = "2")
inp_yearly_line_width = input.int(1, title = "Line width", minval = 1, group = "Yearly Levels", inline = "2")
yearly_ok = timeframe.isintraday or timeframe.isdaily or timeframe.isweekly or (timeframe.ismonthly and timeframe.multiplier < 12)
f_create_level("open", new_year, not new_year, global_open_array, inp_yearly_col, inp_yearly_line_width, inp_ext, open_line_style, text_size, "YO", 0, inp_show_yearly_open and yearly_ok)
f_create_level("high", new_year, not new_year, global_high_array, inp_yearly_col, inp_yearly_line_width, inp_ext, high_line_style, text_size, "Yearly HIGH", 0, inp_show_yearly_high and yearly_ok)
f_create_level("low", new_year, not new_year, global_low_array, inp_yearly_col, inp_yearly_line_width, inp_ext, low_line_style, text_size, "Yearly LOW", 0, inp_show_yearly_low and yearly_ok)
f_create_level("eq", new_year, not new_year, global_eq_array, inp_yearly_col, inp_yearly_line_width, inp_ext, eq_line_style, text_size, "Yearly EQ", 0, inp_show_yearly_eq and yearly_ok)
prev_yearly = input.bool(false, title = "PY", group = "Prev Yearly Levels", inline = "1")
inp_show_prev_yearly_open = input.bool(false, title = "OPEN", group = "Prev Yearly Levels", inline = "1")
inp_show_prev_yearly_high = input.bool(false, title = "HIGH", group = "Prev Yearly Levels", inline = "1")
inp_show_prev_yearly_low = input.bool(false, title = "LOW", group = "Prev Yearly Levels", inline = "1")
inp_show_prev_yearly_eq = input.bool(false, title = "EQ", group = "Prev Yearly Levels", inline = "1")
inp_prev_yearly_col = input.color(color.maroon, title = "color", group = "Prev Yearly Levels", inline = "2")
inp_prev_yearly_line_width = input.int(1, title = "Line width", minval = 1, group = "Prev Yearly Levels", inline = "2")
yy = input.int(1, title = "yearback", minval = 1, maxval=2, group = "Prev Yearly Levels", inline = "2")
f_create_level("open", new_year, not new_year, global_open_array, inp_prev_yearly_col, inp_prev_yearly_line_width, inp_ext, open_line_style, text_size, "P-YO", yy, inp_show_prev_yearly_open and yearly_ok and prev_yearly)
f_create_level("high", new_year, not new_year, global_high_array, inp_prev_yearly_col, inp_prev_yearly_line_width, inp_ext, high_line_style, text_size, "Prev Yearly HIGH", yy, inp_show_prev_yearly_high and yearly_ok and prev_yearly)
f_create_level("low", new_year, not new_year, global_low_array, inp_prev_yearly_col, inp_prev_yearly_line_width, inp_ext, low_line_style, text_size, "Prev Yearly LOW", yy, inp_show_prev_yearly_low and yearly_ok and prev_yearly)
f_create_level("eq", new_year, not new_year, global_eq_array, inp_prev_yearly_col, inp_prev_yearly_line_width, inp_ext, eq_line_style, text_size, "Prev Yearly EQ", yy, inp_show_prev_yearly_eq and yearly_ok and prev_yearly)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//imbalance finder
color gray0 = color.new(color.gray, 0)
color yellow0 = color.new(#FFF700, 0)
bool showgreydiamond = input(defval=false, title='İmbalance back test helper' ,group='=== Information ===')
bool showib = input(defval=false, title='İmbalance bar' ,group='=== Information ===')
Imbcol = input.color(yellow0, 'Imbalance Color', inline="1" ,group='=== Information ===')
Dimcol = input.color(gray0, 'Imbalance back test diamond color', inline="1" ,group='=== Information ===')
TopImbalance = low <= open and high >= close
TopImbalancesize = low - high
if TopImbalance and showib and TopImbalancesize > 0
BOX1 = box.new(left=bar_index , top=low , right=bar_index , bottom=high )
box.set_bgcolor(BOX1, na)
box.set_border_color(BOX1, Imbcol )
//plot(TopImbalance and TopImbalancesize > 0 ? low : na , color=Imbcol)
//plot(TopImbalance and TopImbalancesize > 0 ? high : na , color=Imbcol)
BottomImbalance = high >= open and low <= close
BottomImbalancesize = low - high
if BottomImbalance and showib and BottomImbalancesize > 0
BOX2 = box.new(left=bar_index , top=low , right=bar_index , bottom=high )
box.set_bgcolor(BOX2, na )
box.set_border_color(BOX2, Imbcol )
//plot(BottomImbalance and BottomImbalancesize > 0 ? low : na , color=Imbcol)
//plot(BottomImbalance and BottomImbalancesize > 0 ? high : na , color=Imbcol)
DownImbalance = TopImbalance and TopImbalancesize > 0
plotshape(DownImbalance and showgreydiamond, style=shape.diamond, location=location.abovebar, color=Dimcol, size=size.tiny)
UpImbalance = BottomImbalance and BottomImbalancesize > 0
plotshape(UpImbalance and showgreydiamond, style=shape.diamond, location=location.belowbar, color=Dimcol, size=size.tiny)
alertcondition(DownImbalance , title='Down Imbalance', message='Down Imbalance')
alertcondition(UpImbalance , title='Up Imbalance', message='Up Imbalance')
alertcondition(DownImbalance or UpImbalance , title='Imbalance Present ', message='Imbalance Present')
// MBS
//indicator(title='Order Blocks', overlay=true)
bool msb_a_sv = input.bool (true, title='Alert MSB')
bool msb_sv = input.bool (true, title='Plot MSB lines')
color mbs_color1 = input.color(#00e1ff, title='MSB Color Bullish')
color mbs_color2 = input.color(#ff00bf, title='MSB Color Bearish')
bool box_sv = input.bool (false, title='Plot Orderblocks')
color u_s = input.color (color.rgb(255, 0, 0, 90), title='Untested Supply Color')
color t_s = input.color (color.rgb(192, 192, 192, 93), title='Tested Supply Color')
color u_d = input.color (color.rgb(0, 255, 0, 90), title='Untested Demand Color')
color t_d = input.color (color.rgb(192, 192, 192, 93), title='Tested Demand Color')
bool m_sv = input.bool (false, title='Plot Breakerblocks')
color u_b = input.color (color.new(color.blue, 90), title='Untested Breaker Color')
color t_b = input.color (color.rgb(192, 192, 192, 90), title='Tested Breaker Color')
bool ob_a_sv = input.bool (false, title='Alert Orderblock test')
bool bb_a_sv = input.bool (false, title='Alert Breakerblock test')
bool r_a_sv = input.bool (false, title='Alert New Range')
bool rt_a_sv = input.bool (false, title='Alert Range test')
var float pvh1_price = array.new_float (30, na) // high
var int pvh1_time = array.new_int (30, na)
var float pvl1_price = array.new_float (30, na) // low
var int pvl1_time = array.new_int (30, na)
var float pvh2_price = array.new_float (10, na) // higher high
var int pvh2_time = array.new_int (10, na)
var float pvl2_price = array.new_float (10, na) // lower low
var int pvl2_time = array.new_int (10, na)
var float htcmrll_price = na // high that created most recent ll
var int htcmrll_time = na
var float ltcmrhh_price = na // low that created most recent hh
var int ltcmrhh_time = na
var box long_boxes = array.new_box() // orderblocks
var box short_boxes = array.new_box()
var box m_long_boxes = array.new_box() // breakerblocks
var box m_short_boxes = array.new_box()
var line bull_bos_lines = array.new_line() // MSB lines
var line bear_bos_lines = array.new_line()
var line range_h_lines = array.new_line() // Range lines
var line range_25_lines = array.new_line()
var line range_m_lines = array.new_line()
var line range_75_lines = array.new_line()
var line range_l_lines = array.new_line()
var label la_ph2 = array.new_label() // 2nd order pivots
var label la_pl2 = array.new_label()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
var int temp_time = na
var float last_range_h = na
var float last_range_l = na
var line range_m = na
var line range_25 = na
var line range_75 = na
var float box_top = na
var float box_bottom = na
var int h_a_time = 0
var int l_a_time = 0
var int mh_a_time = 0
var int ml_a_time = 0
var int rh_a_time = 0
var int rl_a_time = 0
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
bool new_ph_2nd = false
bool new_pl_2nd = false
string alert = na
if barstate.isconfirmed
if pvh
array.pop(pvh1_price)
array.pop(pvh1_time)
array.unshift(pvh1_price, pv1_high)
array.unshift(pvh1_time, pv1_time)
if array.size(pvh1_price) > 2
temp_pv_0 := array.get(pvh1_price, 0)
temp_pv_1 := array.get(pvh1_price, 1)
temp_pv_2 := array.get(pvh1_price, 2)
if temp_pv_0 < temp_pv_1 and temp_pv_1 > temp_pv_2
array.pop(pvh2_price)
array.pop(pvh2_time)
array.unshift(pvh2_price, temp_pv_1)
array.unshift(pvh2_time, array.get(pvh1_time, 1))
new_ph_2nd := true
if temp_pv_1 > array.get(pvh2_price, 1)
for i = 0 to array.size(pvl2_time) - 1 by 1
temp_ltcmrhh_time = array.get(pvl2_time, i)
if temp_ltcmrhh_time < array.get(pvh2_time, 0)
ltcmrhh_price := array.get(pvl2_price, i)
ltcmrhh_time := temp_ltcmrhh_time
break
if temp_pv_0 < ltcmrhh_price
if msb_sv
array.push(bear_bos_lines, line.new(x1=ltcmrhh_time, y1=ltcmrhh_price, x2=bar_index, y2=ltcmrhh_price, color=mbs_color2, width=2))
box_top := array.get(pvh2_price, 0)
box_bottom := math.max(low , low )
array.push(short_boxes, box.new(left=array.get(pvh2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_s : na , border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bearish MSB @ ' + str.tostring(ltcmrhh_price) + ' ' + 'New Supply Zone : '+ str.tostring(box_top) + ' - ' + str.tostring(box_bottom) + ' '
ltcmrhh_price := na
if pvl
array.pop(pvl1_price)
array.pop(pvl1_time)
array.unshift(pvl1_price, pv1_low)
array.unshift(pvl1_time, pv1_time)
if array.size(pvl1_price) > 2
temp_pv_0 := array.get(pvl1_price, 0)
temp_pv_1 := array.get(pvl1_price, 1)
temp_pv_2 := array.get(pvl1_price, 2)
if temp_pv_0 > temp_pv_1 and temp_pv_1 < temp_pv_2
array.pop(pvl2_price)
array.pop(pvl2_time)
array.unshift(pvl2_price, temp_pv_1)
array.unshift(pvl2_time, array.get(pvl1_time, 1))
new_pl_2nd := true
if temp_pv_1 < array.get(pvl2_price, 1)
for i = 0 to array.size(pvh2_time) - 1 by 1
temp_htcmrll_time = array.get(pvh2_time, i)
if temp_htcmrll_time < array.get(pvl2_time, 0)
htcmrll_price := array.get(pvh2_price, i)
htcmrll_time := temp_htcmrll_time
break
if temp_pv_0 > htcmrll_price
if msb_sv
array.push(bull_bos_lines, line.new(x1=htcmrll_time, y1=htcmrll_price, x2=bar_index, y2=htcmrll_price, color=mbs_color1, width=2))
box_top := math.min(high , high )
box_bottom := array.get(pvl2_price, 0)
array.push(long_boxes, box.new(left=array.get(pvl2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_d : na, border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bullish MSB @ ' + str.tostring(htcmrll_price) + ' ' + 'New Demand Zone : '+ str.tostring(box_bottom) + ' - ' + str.tostring(box_top) + ' '
htcmrll_price := na
if array.size(short_boxes) > 0
for i = array.size(short_boxes) - 1 to 0 by 1
tbox = array.get(short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
if box_sv
box.set_bgcolor(tbox, t_s)
if ob_a_sv and close < bottom
if array.get(pvh1_time, 0) != h_a_time
h_a_time := array.get(pvh1_time, 0)
alert := alert + 'Supply Zone Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
if m_sv
box.set_bgcolor(tbox, u_b)
array.push(m_long_boxes, tbox)
else
box.delete(tbox)
array.remove(short_boxes, i)
if msb_sv
line.delete(array.get(bear_bos_lines, i))
array.remove(bear_bos_lines, i)
if array.size(long_boxes) > 0
for i = array.size(long_boxes) - 1 to 0 by 1
lbox = array.get(long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
if box_sv
box.set_bgcolor(lbox, t_d)
if ob_a_sv and close > top
if array.get(pvl1_time, 0) != l_a_time
l_a_time := array.get(pvl1_time, 0)
alert := alert + 'Demand Zone Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
if m_sv
box.set_bgcolor(lbox, u_b)
array.push(m_short_boxes, lbox)
else
box.delete(lbox)
array.remove(long_boxes, i)
if msb_sv
line.delete(array.get(bull_bos_lines, i))
array.remove(bull_bos_lines, i)
if array.size(m_short_boxes) > 0
for i = array.size(m_short_boxes) - 1 to 0 by 1
tbox = array.get(m_short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
box.set_bgcolor(tbox, t_b)
if bb_a_sv and close < bottom
if array.get(pvh1_time, 0) != mh_a_time
mh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Breakerblock Test Up @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
box.delete(tbox)
array.remove(m_short_boxes, i)
if array.size(m_long_boxes) > 0
for i = array.size(m_long_boxes) - 1 to 0 by 1
lbox = array.get(m_long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
box.set_bgcolor(lbox, t_b)
if bb_a_sv and close > top
if array.get(pvl1_time, 0) != ml_a_time
ml_a_time := array.get(pvl1_time, 0)
alert := alert + 'Breakerblock Test Down @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
box.delete(lbox)
array.remove(m_long_boxes, i)
alert := not na(alert) ? (alert + 'Current price = ' + str.tostring(close) + ' ') : na
exec = not na(alert) ? true : false
if exec==true
alert(alert, alert.freq_once_per_bar_close)
Double RSI OscillatorThe Double RSI Oscillator
Hello Gs,
I came back from the dead and tried to see what a little tweak to RSI could do, and I think it is quite interesting and might be worth checking out.
Warning:
This indicator has lots of false signals unfortunatly
How does the DRSI Oscillator work?
Very simple, the DRSI oscillator at the very base is just 2 RSIs that should smooth each other out, making a smoother trend signal generation for trend analysis. One RSI is set to have lower values, by considering the lowest point of the price, and one RSI is set to have higher values using pretty much the same thing. The trend changes from positive to negative if RSI with higher values crosses negative treshhold, and from negative to positive if RSI with lower value crosses positive treshhold. On top of this I added some additional settings to smooth or speed it further, if these were a good idea, I guess only time will tell :D.
Settings
Here is a guide of what setting changes what and how it might be suitable for you:
RSI Optimism length: length of the RSI with higher values (higher values will be better for longer term, lower for medium term)
RSI Pesimism length: length of the RSI with lower values (higher values will be better for longer term, lower for medium term)
Positive treshhold: The value RSI pesimism needs to pass in order to change trends (in case of using RSI avg. the value the average needs to pass), making this higher can give you faster signals, but expect more false ones
Negative treshholds: The value RSI optimism needs to pass in order to change trends (in case of using RSI avg. the value the average needs to pass), lowering this can give you faster signals, but expect more false ones
Smoothing type: Select the type of smoothing (or none) to smooth your signals as you want, this one you need to play around with.
Smoothing length: The length of your smoothing method (if none is selected it wont change anything)
Use RSI average instead: self-explanatory, go figure
Above/Below Mean Trend: Changes the way trend logic works
Why consider using this indicator?
The DRSI Oscillator is a tool that has huge flexibility (due to tons of settings that base RSI doesnt, like trend treshholds), and is smoother allowing traders and investors to get high quality or high speed signals, allowing great entries and exits
zigzag all timeThe indicator is applicable across all timeframes, meaning it can be used for short-term (e.g., minutes, hours) or long-term (e.g., days, weeks, months) trading strategies. This ensures that the analysis is versatile and adaptable to different trading styles.
Accumulation-Distribution CandlesThis structural visualization tool maps each candle through the lens of Effort vs. Result, blending Volume, Range, and closing bias into a normalized pressure score. Candle bodies are dynamically color-coded using a five-tier system—from heavy accumulation to heavy distribution—revealing where energy is building, dispersing, or neutral. This helps to visually isolate Markup, Markdown, Re-accumulation, and Distribution at a glance.
The indicator calculates a strength score by multiplying price result (close minus open) by effort (volume or price range), smoothing this raw value using a Fibonacci-based EMA. (34 for standard, 55 for crypto; the higher crypto value acknowledges that 24/7 trading offers more hours per week or month than trad markets.) The result is standardized against its rolling deviation and clamped to a range. This score determines the visual tier:
• 💙 Dark Blue = heavy Accumulation (strong upward result on strong effort)
• 🩵 Pale Blue = mild Accumulation
• 🌚 Gray = neutral (low conviction or balance)
• 💛 Pale Yellow = mild Distribution
• 🧡 Deep Yellow = heavy Distribution (strong downward result on strong effort)
The tool is optimized for the 1D chart, where Wyckoff phases are most clearly expressed. However, it adapts well to lower timeframes when used selectively. Traders may hide the body coloring and enable only zone highlighting to preserve other candle overlays such as SUPeR TReND 2.718, which offers directional clarity and trend duration. This combination is especially useful on intraday charts (15m–1H) where microstructure matters but visual clutter must be avoided.
When used alongside other Volume overlays (such as the OBVX Conviction Bias) or Volatility indicators (such as the Asymmetric Turbulence Ribbon (ATR)), this indicator adds confluence to directional setups by contextualizing pressure with Volatility. For example: compression zones marked by ATR may align with persistent pale blue candles—indicating quiet Accumulation before expansion.
Optional Overlays:
Normally ON -
• 📌 Pin Bars , filtered by volume, to isolate wick-dominant reversals from key zones
• 💪🏻 Strong-Body Candles — fuchsia candles w/ high body-to-range ratio reflect conviction
• 🧯 Wick Absorption Candles — red candles w/ long wicks and low closing strength indicate failed pushes or absorbed breakouts
• 🟦/🟧 Zone Highlighting for candles above a defined Accumulation/Distribution threshold
Normally OFF -
• 🔺 Fractals (5-bar) to map swing pivots by underlying pressure tier (normally OFF)
• 🟥/🟩 Engulfing patterns, filtered by directional conviction (normally OFF)
The Pin Bar strategy benefits most from the zone logic—when a bullish pin bar appears in an Accumulation zone (esp. pale or dark blue), and Volume exceeds its rolling average, it may mark a spring or failed breakdown. Conversely, bearish pins in Distribution zones can mark rejection or resistance.
This is not a signal engine—it’s a narrative filter designed to slot cleanly into a multi-layered workflow of visual structure and informed execution. Use it to identify bias and phase. Then deploy trade triggers from tools like SUPeR TReND 2.718, or the liquidity flows shown the The Silver Lining or the AltSeasonality - MTF indicators, for example. The candle colors tell you who’s in control—the other tools tell you when to act.
Autofib Extensions | DTDHello trader comuunity!
I'm introducing another script that is part of my main day-trading strategy. We all know regardless of what strategy we use, we need to know what levels offer the least amount of risk to our trade entry and a great tool to anticipate how far a move might go or what level a move may retrace to are the Fibonacci Retracement and Extensions. This indicator combines both together, but with a twist.
The main elements of the script are:
1. Multiple Session High and Lows | Developing my first script led me to understand that measuring key times during each session provides understanding of the market's continuity. I have provided 3 "sessions' a user can define according to CST time where the script saves the high and low of that session window to produce the retracement and extensions from those plots. Currently, the levels are always plotted from low to high (with the 0 mark being the high) and negative values provided so the levels are consistent. You can toggle each session on or off.
2. Coloring Key Retracements / Extensions | I use a dark background for my charts so the default colors help me distinguish from other another indicator I use. Feel free to adjust the colors to your preference. I consider 3 different colors because of their significance. Retracements that you want to see continue fall back into the .50 to .618 level (this I consider the "Golden Zone"). While basic Elliott Wave Theory states a wave is completed near the 1.618 level (this I consider "Major Extensions"). Everything isn't noise, but minor levels in a larger sequence.
______________
Script Limitations
All of my scripts are made with the help of ChatGPT so there are going to be limitations. One current one that I have made progress on, but not fully is when you are viewing a timeframe where the candle doesn't start when a session window starts. On smaller timeframes like the 7-minute this is not an issue. However, on the hourly, if your session window starts at the half hour which the 3rd session default window does, the lines will not produce. I will hopefully have this rectified in the near future. I will open the script since none of this work is original in nature and I would love to see how others can create a better product. Also, this is mainly a futures trading tool. If you are using this on stocks you will find it not as useful if the session window is too wide since the script waits until the session window closes to calculate the extension values.
Cheers,
DTD
siaThis script is a combination of several TradingView Pine Script indicators, each designed to provide different types of analysis and visualization for trading strategies. Here's a breakdown of each part:
1. Trendlines with Breaks
Purpose: Identifies trendlines and their breaks.
Key Features:
Detects swing highs and lows.
Calculates trendlines based on ATR, Stdev, or Linreg.
Plots upper and lower trendlines.
Highlights breakouts with shapes and alerts.
2. CM_Ultimate_MA_MTF_V2
Purpose: Plots a multi-timeframe moving average with optional second moving average.
Key Features:
Supports various moving average types (SMA, EMA, WMA, etc.).
Highlights price crossings with the moving averages.
Allows color changes based on direction.
Optional second moving average for additional analysis.
3. HalfTrend
Purpose: Identifies trends and plots trend channels.
Key Features:
Uses ATR for channel deviation.
Plots trend lines and channels.
Highlights trend changes with arrows.
Provides alerts for buy and sell signals.
4. Ichimoku
Purpose: Plots Ichimoku Cloud components and additional lines.
Key Features:
Plots Tenkan-Sen, Kijun-Sen, Chikou Span, and Ichimoku Cloud.
Highlights crosses between Tenkan-Sen and Kijun-Sen.
Includes additional lines like Quality Line and Direction Line.
Provides alerts for cross signals.
How to Use
Trendlines with Breaks: Useful for identifying potential breakout points in the market.
CM_Ultimate_MA_MTF_V2: Helps in understanding the trend across different timeframes.
HalfTrend: Provides a clear visualization of trend channels and potential reversal points.
Ichimoku: Offers a comprehensive view of market trends and potential support/resistance levels.
Integration
These indicators can be used together to create a robust trading strategy. For example, you can use the trendlines to identify breakouts, confirm the trend with the multi-timeframe moving average, and use Ichimoku for additional confirmation.
Customization
Each indicator has several input parameters that can be customized to fit your trading style and preferences.
ICEBERG ENTRYThis TradingView indicator is designed to detect hidden block orders or iceberg orders on the NIFTY50 chart using a combination of volume spikes and minimal price movement. It works across all timeframes and in both live and historical (closed) markets.
Session Coloring Bar with ICT Macro [dani]The Session Coloring Bar is customizable Pine Script indicator designed to visually enhance your charts by applying unique colors to specific trading sessions or timeframes. This tool allows traders to easily identify and differentiate between macro sessions (e.g., 24-hour cycles) and custom-defined sessions (e.g., Session A, Session B), making it ideal for analyzing market activity during specific periods.
In the context of trading, the term "ICT Macro" , as discussed by Michael J. Huddleston (ICT), refers to specific timeframes or "windows" where market behavior often follows predictable patterns. Traders typically focus on the last 10 minutes of an hour and the first 10 minutes of the next hour (e.g., 0150-0210 , 0050-0110 , or 0950-1010 ) to identify key price movements, liquidity shifts, or market inefficiencies.
This script highlights these macro timeframes, enabling traders to visually analyze price action during these critical periods. Use this tool to support your strategy, but always combine it with your own analysis and risk management.
With this indicator, you can:
Highlight Macro Sessions : Automatically color bars based on predefined 24-hour macro sessions.
Customize Session Settings : Define up to three custom sessions (A & B) with individual start/end times, visibility toggles, and unique bar colors.
Timeframe Filtering : Hide session coloring above a specified timeframe to avoid clutter on higher timeframes.
Personal Notes : Add comments to each session for better organization and quick reference.
Dynamic Color Logic : Bars are colored based on their direction (up, down, or neutral) within the active session.
How to Use:
Enable/Disable Sessions :
Use the Show Coloring toggle to enable or disable session coloring for Macro, Session A, Session B, or Session C.
Set Session Times :
Define the start and end times for each session in the format HHMM-HHMM (e.g., 1600-0930 for an overnight session).
Choose Colors :
Assign unique colors for upward (Bar Up) and downward (Bar Down) bars within each session.
Adjust Timeframe Visibility :
Use the Hide above this TF input to specify the maximum timeframe where session coloring will be visible.
Add Notes :
Use the Comment field to add personal notes or labels for each session.
Example Use Cases:
Overnight Sessions :
Highlight overnight trading hours (e.g., 1600-0930) to analyze price action during low liquidity periods.
Asian/European/US Sessions : Define separate sessions for major trading regions to track regional market behavior.
Macro Analysis : Use the predefined 24-hour macro sessions to study hourly price movements across a full trading day.
Disclaimer:
The Session Coloring Bar is not a trading signal generator and does not predict market direction or provide buy/sell signals. Instead, it is a visualization tool designed to help you identify and analyze specific trading sessions or timeframes on your chart. By highlighting key sessions and their corresponding price movements, this indicator enables you to focus on periods of interest and make more informed trading decisions.
Thank you for choosing this indicator! I hope it becomes a valuable part of your trading toolkit. Remember, trading is a journey, and having the right tools can make all the difference. Whether you're a seasoned trader or just starting out, this indicator is designed to help you stay organized and focused on what matters most—price action. Happy trading, and may your charts be ever in your favor! 😊
MOPS Indicator - Master of ProfitsWhat this Script Does
1. Quick Buy (QB)
Conditions:
MACD crossover
RSI < 50
Trend is up (EMA50 > EMA200)
➡️ Places a label below the bar:
"QB Entry: xxx SL: xxx | TP: xxx | R:R"
2. Quick Sell (QS)
Conditions:
MACD crossunder
RSI > 50
Trend is down (EMA50 < EMA200)
➡️ Label appears above the bar.
3. Close Quick Buy (QBC)
When the previous candle had QB and now a MACD crossunder happens.
➡️ Label "QBC" above bar to close long.
4. Close Quick Sell (QSC)
Previous candle had QS and now MACD crossover.
➡️ Label "QSC" below bar to close short.
5. Bull Buy (BullB)
When price crosses above middle Bollinger Band + MACD cross + price between BB Middle & Upper + MACD above zero.
➡️ Entry label below bar.
6. Bear Sell (BearS)
Opposite logic to BullB, label above bar.
7. Close BullB / Close BearS
Opposite exit signals using price movement and MACD.
8. Swing Buy / Swing Sell
When price breaks Fibonacci retracement levels with trend confirmation.
BTC/USDC 50x Futures Strategy with Multi-TPScript in the workings for btc/usdt 50x leverage trading at 1% portfolio margin. Please do not use to save your money
Timeframe Open Lines v1.0See the current Open price with a horizontal line for two different timeframes.
TRIX Strategy)trix strategy with rsi
this is a winning strategy if used with good setting can get 140 pesent roi per year
this is true i have done that with this strategy jast play with the setting to get the best result