3 EMA Crossover (Text Color Customizable) - Fixed3 Ema crossover 9/15/21
it will generate buy and sell signal on crossover.
指标和策略
A simplified preview of the UIA Trend Engine. Shows core T/E/H/XUIA Lite – Trend Engine (Free Preview)
———————————————————————————————
This is the free preview edition of the UIA Lite Trend Engine.
It provides a clean, simplified introduction to UIA’s structure-based trend reading framework.
The goal is to help traders see the market through structural events rather than prediction or noise.
———————————
Core Structure Events
———————————
This preview displays four essential UIA structural markers:
• T — Trend Start
• E — Trend Extension
• H — Structural High / Low
• X — Trend Exit / Reversal
These labels offer a simple, intuitive way to understand when a trend begins, develops, forms key swing points, and exhausts.
———————————
What’s Included in the Preview
———————————
• Simplified trend logic using fixed moving averages
• Basic swing-based structure detection
• Clean and minimal visual labels
• Light sensitivity adjustment (Conservative / Normal / Aggressive)
• One-click “show all labels” toggle
This edition is intentionally lightweight.
Its purpose is to introduce the UIA methodology without revealing the full internal logic.
———————————
UIA Lite (Full Version)
———————————
The full UIA Lite Trend Engine includes:
• Advanced structure filtering
• Multi-layer pullback / body / shadow logic
• Smoother and more consistent trend detection
• Fine-tuned T/E/H/X placement
• Enhanced noise reduction
• More control parameters and customization
If you find value in this preview, the full version offers a much more refined trend-structure experience.
———————————
UIA Institute – Philosophy
———————————
UIA focuses on:
• Structure first
• Clarity over noise
• Systematic and repeatable market interpretation
No predictions.
No buy/sell signals.
Only structure, rhythm, and clean price behavior.
———————————
中文說明(補充)
———————————
UIA Lite(免費預覽版)展示了四大核心結構:
T(趨勢起點)、E(趨勢延伸)、H(結構高低點)、X(趨勢終止)。
透過最少的標記呈現最重要的趨勢骨架。
完整版 UIA Lite 提供更精細的濾波、更多參數、更平滑的結構表現,
是更完整的趨勢閱讀工具。
———————————
Thank you for trying the UIA Lite Trend Engine (Free Preview).
Stay tuned for upcoming releases from UIA Institute.
Abacus Community Williams %R + Bollinger %B📌 Indicator Description (Professional & Clear)
Williams %R + Bollinger %B Momentum Indicator (ThinkOrSwim Style)
This custom indicator combines Williams %R and Bollinger %B into a single, unified panel to provide a powerful momentum-and-positioning view of price action. Modeled after the ThinkOrSwim version used by professional traders, it displays:
✅ Williams %R (10-period) – Yellow Line
This oscillator measures the market's position relative to recent highs and lows.
It plots on a 0% to 100% scale, where:
80–100% → Overbought region
20–0% → Oversold region
50% → Momentum equilibrium
Williams %R helps identify exhaustion, trend strength, and potential reversal zones.
✅ Bollinger %B (20, 2.0) – Turquoise Histogram Bars
%B shows where price is trading relative to the Bollinger Bands:
Above 50% → Price is in the upper half of the band (bullish pressure)
Below 50% → Price is in the lower half (bearish pressure)
Near 100% → Price pushing upper band (possible breakout)
Near 0% → Price testing lower band (possible breakdown)
The histogram visually represents momentum shifts in real time, creating a clean profile of volatility and strength.
🎯 Why This Combination Works
Together, Williams %R and Bollinger %B reveal:
Momentum direction
Overbought/oversold conditions
Volatility compression & expansion
Trend continuation vs reversal zones
High-probability inflection points
Williams %R shows oscillation and exhaustion, while %B shows pressure inside volatility bands.
The combination helps identify whether momentum supports the current trend or is weakening.
🔍 Use Cases
Detect early trend reversals
Validate breakouts and breakdowns
Spot momentum failure in price extremes
Confirm pullbacks and continuation setups
Time entries and exits with higher precision
💡 Best For
Swing traders
Momentum traders
Trend-followers
Options traders (for timing premium decay or volatility expansion)
Day-Type Detector — Rejection / FNL / Outside / StopRun (Clean)Day-Type Detector — Rejection / FNL / Outside / Stop-Run (Clean Version)
This indicator identifies four high-impact candlestick day-types commonly used in professional price-action and auction-market trading: Rejection Days, Failed New Low (FNL) Days, Outside Days, and Stop-Run Days. These patterns often precede major directional moves, reversals, and absorption events, making them particularly valuable for swing traders, positional traders, and short-term discretionary traders.
The script is designed to work across all timeframes and is built around volatility-adjusted measurements using Average Daily Range (ADR) for accuracy and consistency.
What This Indicator Detects
1. Rejection Day (Bullish & Bearish)
A Rejection Day is a wide-range bar that rejects a previous extreme.
The indicator identifies rejection based on:
Range > ADR × threshold
Long lower wick (for bullish) or long upper wick (for bearish)
Close located in the strong zone of the day’s range
These conditions highlight areas where aggressive counter-orderflow entered the market.
2. Failed New Low (FNL) / Failed New High
An FNL day traps traders who attempted breakout selling or buying.
The indicator checks for:
A break beyond the previous session’s low or high
Immediate rejection back inside
Midpoint recapture conditions
ADR-normalized range requirements
These days often trigger powerful directional reversals.
3. Outside Day (Bullish & Bearish)
An Outside Day is a statistically significant expansion day that breaks both the previous high and low.
The script validates:
High > previous high and low < previous low
Range > ADR threshold
Close beyond prior session extreme to complete the rejection sequence
Outside Days often represent stop runs, shakeouts, or trend accelerations.
4. Stop-Run Day (Bullish & Bearish)
Stop-Run Days are aggressive volatility expansions and tend to be the largest ranges within short windows.
This detector identifies them using:
Range > ADR × multiplier
Close located near the extreme of the day (top for bullish, bottom for bearish)
Strong body relative to total range
Break above/below previous session extreme
These patterns indicate capitulation or forced liquidation and are often followed by continuation or sharp counter-rotation.
Key Features
✔ Historical Pattern Marking
All qualifying bars are marked on the chart using plotshape() in global scope, ensuring full historical visibility.
✔ Event Logging & Table Display
A table (top-right of the chart) displays the most recent pattern detections, including:
Timestamp
Pattern type
Bar index
This allows users to monitor and study past pattern occurrences without scanning the chart manually.
✔ ADR-Adjusted Detection
Volatility uncertainty is removed by anchoring all thresholds to ADR.
This ensures consistency across:
Different symbols
Different timeframes
Different market regimes
✔ Alerts Included
Alerts are preconfigured for:
Rejection Day Bull / Bear
FNL Bull / Bear
Outside Day Bull / Bear
Stop-Run Bull / Bear
This allows the user to receive real-time notifications when major day-type structures develop.
How to Use
Add the indicator to any timeframe chart.
Enable or disable:
Historical markers
History table
ADR diagnostics
Watch for shape markers or use alerts for real-time signals.
Use the history table to review recent occurrences.
Combine these day-types with:
Market structure levels
High/low volume nodes (LVNs)
Support/resistance zones
Trend context
These day-types are most effective when they occur near meaningful structural levels because they show where strong order-flow entered the market.
Best Practices
Use higher timeframes (1H–1D) for swing entries.
Confirm signals with market structure or volume profile.
Treat these day-types as context, not standalone signals.
Observe follow-through behavior in the next 1–3 bars after detection.
Credits
This script is based on concepts commonly seen in auction-market theory and professional price-action frameworks, such as Rejection Days, Failed New Lows, Outside Days, and Stop-Run behaviors.
All calculations and logic have been rebuilt from scratch to ensure clean, reliable, and optimized Pine Script v6 execution.
Highlight TimeHighlight Time shades the chart background during user‑defined hours. Choose start/end times and a time zone to visually mark key trading windows like the spread hour.
OBO-TOBO Head & Shoulders (H&S) Pattern HunterOBO-TOBO Head & Shoulders (H&S) Pattern Hunter
This indicator automatically detects Head and Shoulders (Bearish) and Inverse Head and Shoulders (Bullish) patterns using a smart ZigZag algorithm. Unlike standard indicators, it does not just mark the pivots; it draws the complete geometric "M" or "W" shape, including all legs from start to finish.
Key Features:
Full Geometry: Draws the complete pattern shape with proper legs, ensuring distinct visibility.
Smart Cleaning (Garbage Collector): Automatically deletes old or invalid patterns when a new one forms. Keeps your chart clean and prevents visual clutter.
Neckline Projection: Automatically draws the neckline projection to identify potential breakout levels.
Symmetry Check: Filters out invalid structures and only detects proportional patterns.
How to Use: You can adjust the "Sensitivity" (Length) setting in the menu to detect smaller or larger patterns according to your trading style.
Sessions and High/LowCan be used to mark highs and lows of any sessions you desire can do 4 sessions
Triple 9 Bias filter Triple 9 Bias – Precision Multi-Timeframe Directional Filter
Technical Overview
The Triple 9 Bias is a precision multi-timeframe directional filter built exclusively for 5-minute (and lower) trading.
It stacks three EMA-9 trend directions (4H + 1H + 15m) as Primary confluence and uses only the 4H RSI-14 as Secondary confirmation.
Integrity Check: Zero repaint · Zero lookahead · Works identically on any chart timeframe.
The Trading Rule (Simple)
Long Trades: Only trade longs when all three EMA-9s are UP + 4H RSI > 50
Short Trades: Only trade shorts when all three EMA-9s are DOWN + 4H RSI < 50
Otherwise — stand aside.
Display Components
A. Plotted Higher-Timeframe EMAs (No Repainting)
All values are pulled from closed higher-timeframe bars.
4H EMA 9 (Red step-line)
1H EMA 9 (Purple step-line)
15m EMA 9 (Orange step-line)
B. Locked Dashboard (Bottom-Right)
Clean table split into Primary and Secondary sections for instant bias reading.
Colour Logic:
🟢 Lime = UP / BUY
🔴 Red = DOWN / SELL
Background Logic:
Full Green: Only when all three EMA-9s are UP
Full Red: Only when all three EMA-9s are DOWN
Gray: Otherwise = no trade
Indicator Breakdown
3.1. Primary Confluence – EMA 9 Slope
4H EMA 9 direction (compared 10 bars back)
1H EMA 9 direction (compared 6 bars back)
15m EMA 9 direction (compared 6 bars back)
3.2. Secondary Confluence
4H RSI-14 vs 50 level (BUY if >50, SELL if <50)
High-Probability Signal: When Primary = all three “UP” and Secondary = “BUY” → highest-probability bullish bias (and vice-versa for bearish).
Decision zone This indicator helps me determine market direction.
It's simple to use: if the middle line of the square is below the price, we're looking for buys; otherwise, we're looking for sells.
Hours may vary.
7 Am, 9 am, 11 am, 11 pm, 1 pm
I4I Inside Vortex Strike RateThis indicator identifies what I call an "Inside Vortex": It's similar to a Doji but more strict in having to be inside a keltner and also have a lower ATR than a blended average.
The bar itself is not that special. But it indicates that a potential big move might come in the next 2 periods.
After the patter: It then looks at what I call the Market Maker High and Low: A % of a blended ATR. It then looks back 100-200 or more bars and calculates the overall strike % in history for the High and low after the pattern happens.
This allows us to know how often these levels are hit within the next 2 periods to find if we have any edge on spread, call or put prices or use them as targets.
So its:
Pattern:
Levels
Strike Rate.
Very unique and EXTREME useful. Especially for options traders.
Price Action - EMA ClusterAligned with Al Brooks' multi-timeframe analysis in his series, this plots three EMA20 lines on 5m charts: current (line), 15m (stepline), and 60m (stepline). Visible only on 5m timeframe for clarity. EMAs act as dynamic trend channels—price above signals bull bias, below bear. Test extremes: Pullbacks to EMA often offer second-leg entries in trends. Customize colors for better visualization of always-in direction.
Price Action Concepts [RUDYINDICATOR]/// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © RUDYBANK INDICATOR - formerly know as RUDY INDICATOR
//@version=5
indicator("Price Action Concepts ", shorttitle = "RUDYINDICATOR-V1
- Price Action RUDYINDICATOR ", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100)
//-----------------------------------------------------------------------------{
//Boolean set
//-----------------------------------------------------------------------------{
s_BOS = 0
s_CHoCH = 1
i_BOS = 2
i_CHoCH = 3
i_pp_CHoCH = 4
green_candle = 5
red_candle = 6
s_CHoCHP = 7
i_CHoCHP = 8
boolean =
array.from(
false
, false
, false
, false
, false
, false
, false
, false
, false
)
//-----------------------------------------------------------------------------{
// User inputs
//-----------------------------------------------------------------------------{
show_swing_ms = input.string ("All" , "Swing        " , inline = "1", group = "MARKET STRUCTURE" , options = )
show_internal_ms = input.string ("All" , "Internal     " , inline = "2", group = "MARKET STRUCTURE" , options = )
internal_r_lookback = input.int (5 , "" , inline = "2", group = "MARKET STRUCTURE" , minval = 2)
swing_r_lookback = input.int (50 , "" , inline = "1", group = "MARKET STRUCTURE" , minval = 2)
ms_mode = input.string ("Manual" , "Market Structure Mode" , inline = "a", group = "MARKET STRUCTURE" , tooltip = " Use selected lenght Use automatic lenght" ,options = )
show_mtf_str = input.bool (true , "MTF Scanner" , inline = "9", group = "MARKET STRUCTURE" , tooltip = "Display Multi-Timeframe Market Structure Trend Directions. Green = Bullish. Red = Bearish")
show_eql = input.bool (false , "Show EQH/EQL" , inline = "6", group = "MARKET STRUCTURE")
plotcandle_bool = input.bool (false , "Plotcandle" , inline = "3", group = "MARKET STRUCTURE" , tooltip = "Displays a cleaner colored candlestick chart in place of the default candles. (requires hiding the current ticker candles)")
barcolor_bool = input.bool (false , "Bar Color" , inline = "4", group = "MARKET STRUCTURE" , tooltip = "Color the candle bodies according to market strucutre trend")
i_ms_up_BOS = input.color (#089981 , "" , inline = "2", group = "MARKET STRUCTURE")
i_ms_dn_BOS = input.color (#f23645 , "" , inline = "2", group = "MARKET STRUCTURE")
s_ms_up_BOS = input.color (#089981 , "" , inline = "1", group = "MARKET STRUCTURE")
s_ms_dn_BOS = input.color (#f23645 , "" , inline = "1", group = "MARKET STRUCTURE")
lvl_daily = input.bool (false , "Day   " , inline = "1", group = "HIGHS & LOWS MTF")
lvl_weekly = input.bool (false , "Week " , inline = "2", group = "HIGHS & LOWS MTF")
lvl_monthly = input.bool (false , "Month" , inline = "3", group = "HIGHS & LOWS MTF")
lvl_yearly = input.bool (false , "Year  " , inline = "4", group = "HIGHS & LOWS MTF")
css_d = input.color (color.blue , "" , inline = "1", group = "HIGHS & LOWS MTF")
css_w = input.color (color.blue , "" , inline = "2", group = "HIGHS & LOWS MTF")
css_m = input.color (color.blue , "" , inline = "3", group = "HIGHS & LOWS MTF")
css_y = input.color (color.blue , "" , inline = "4", group = "HIGHS & LOWS MTF")
s_d = input.string ('⎯⎯⎯' , '' , inline = '1', group = 'HIGHS & LOWS MTF' , options = )
s_w = input.string ('⎯⎯⎯' , '' , inline = '2', group = 'HIGHS & LOWS MTF' , options = )
s_m = input.string ('⎯⎯⎯' , '' , inline = '3', group = 'HIGHS & LOWS MTF' , options = )
s_y = input.string ('⎯⎯⎯' , '' , inline = '4', group = 'HIGHS & LOWS MTF' , options = )
ob_show = input.bool (true , "Show Last    " , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volumetric order blocks on the chart Ammount of volumetric order blocks to show")
ob_num = input.int (5 , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Orderblocks number", minval = 1, maxval = 10)
ob_metrics_show = input.bool (true , "Internal Buy/Sell Activity" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volume metrics that have formed the orderblock")
css_metric_up = input.color (color.new(#089981, 50) , "         " , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
css_metric_dn = input.color (color.new(#f23645 , 50) , "" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
ob_swings = input.bool (false , "Swing Order Blocks" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display swing volumetric order blocks")
css_swing_up = input.color (color.new(color.gray , 90) , "                 " , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
css_swing_dn = input.color (color.new(color.silver, 90) , "" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
ob_filter = input.string ("None" , "Filtering             " , inline = "d", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Filter out volumetric order blocks by BOS/CHoCH/CHoCH+", options = )
ob_mitigation = input.string ("Absolute" , "Mitigation           " , inline = "4", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Trigger to remove volumetric order blocks", options = )
ob_pos = input.string ("Precise" , "Positioning          " , inline = "k", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Position of the Order Block Cover the whole candle Cover half candle Adjust to volatility Same as Accurate but more precise", options = )
use_grayscale = input.bool (false , "Grayscale" , inline = "6", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Use gray as basic order blocks color")
use_show_metric = input.bool (true , "Show Metrics" , inline = "7", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show volume associated with the orderblock and his relevance")
use_middle_line = input.bool (true , "Show Middle-Line" , inline = "8", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show mid-line order blocks")
use_overlap = input.bool (true , "Hide Overlap" , inline = "9", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Hide overlapping order blocks")
use_overlap_method = input.string ("Previous" , "Overlap Method    " , inline = "Z", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = " Preserve the most recent volumetric order blocks Preserve the previous volumetric order blocks", options = )
ob_bull_css = input.color (color.new(#089981 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
ob_bear_css = input.color (color.new(#f23645 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
show_acc_dist_zone = input.bool (false , "" , inline = "1", group = "Accumulation And Distribution")
zone_mode = input.string ("Fast" , "" , inline = "1", group = "Accumulation And Distribution" , tooltip = " Find small zone pattern formation Find bigger zone pattern formation" ,options = )
acc_css = input.color (color.new(#089981 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
dist_css = input.color (color.new(#f23645 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
show_lbl = input.bool (false , "Show swing point" , inline = "1", group = "High and Low" , tooltip = "Display swing point")
show_mtb = input.bool (false , "Show High/Low/Equilibrium" , inline = "2", group = "High and Low" , tooltip = "Display Strong/Weak High And Low and Equilibrium")
toplvl = input.color (color.red , "Premium Zone   " , inline = "3", group = "High and Low")
midlvl = input.color (color.gray , "Equilibrium Zone" , inline = "4", group = "High and Low")
btmlvl = input.color (#089981 , "Discount Zone    " , inline = "5", group = "High and Low")
fvg_enable = input.bool (false , "        " , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap")
what_fvg = input.string ("FVG" , "" , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap", options = )
fvg_num = input.int (5 , "Show Last  " , inline = "1a", group = "FAIR VALUE GAP" , tooltip = "Number of fvg to show")
fvg_upcss = input.color (color.new(#089981, 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_dncss = input.color (color.new(color.red , 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_extend = input.int (10 , "Extend FVG" , inline = "2", group = "FAIR VALUE GAP" , tooltip = "Extend the display of the FVG.")
fvg_src = input.string ("Close" , "Mitigation  " , inline = "3", group = "FAIR VALUE GAP" , tooltip = " Use the close of the body as trigger Use the extreme point of the body as trigger", options = )
fvg_tf = input.timeframe ("" , "Timeframe " , inline = "4", group = "FAIR VALUE GAP" , tooltip = "Timeframe of the fair value gap")
t = color.t (ob_bull_css)
invcol = color.new (color.white , 100)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - UDT }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
type bar
float o = open
float c = close
float h = high
float l = low
float v = volume
int n = bar_index
int t = time
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type FVG
box box
line ln
bool bull
float top
float btm
int left
int right
type ms
float p
int n
float l
type msDraw
int n
float p
color css
string txt
bool bull
type obC
float top
float btm
int left
float avg
float dV
float cV
int wM
int blVP
int brVP
int dir
float h
float l
int n
type obD
box ob
box eOB
box blB
box brB
line mL
type zone
chart.point points
float p
int c
int t
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type ehl
float pt
int t
float pb
int b
type pattern
string found = "None"
bool isfound = false
int period = 0
bool bull = false
type alerts
bool chochswing = false
bool chochplusswing = false
bool swingbos = false
bool chochplus = false
bool choch = false
bool bos = false
bool equal = false
bool ob = false
bool swingob = false
bool zone = false
bool fvg = false
bool obtouch = false
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - General Setup }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
bar b = bar.new()
var pattern p = pattern.new()
alerts blalert = alerts.new()
alerts bralert = alerts.new()
if p.isfound
p.period += 1
if p.period == 50
p.period := 0
p.found := "None"
p.isfound := false
p.bull := na
switch
b.c > b.o => boolean.set(green_candle, true)
b.c < b.o => boolean.set(red_candle , true)
f_zscore(src, lookback) =>
(src - ta.sma(src, lookback)) / ta.stdev(src, lookback)
var int iLen = internal_r_lookback
var int sLen = swing_r_lookback
vv = f_zscore(((close - close ) / close ) * 100,iLen)
if ms_mode == "Dynamic"
switch
vv >= 1.5 or vv <= -1.5 => iLen := 10
vv >= 1.6 or vv <= -1.6 => iLen := 9
vv >= 1.7 or vv <= -1.7 => iLen := 8
vv >= 1.8 or vv <= -1.8 => iLen := 7
vv >= 1.9 or vv <= -1.9 => iLen := 6
vv >= 2.0 or vv <= -2.0 => iLen := 5
=> iLen
var msline = array.new(0)
iH = ta.pivothigh(high, iLen, iLen)
sH = ta.pivothigh(high, sLen, sLen)
iL = ta.pivotlow (low , iLen, iLen)
sL = ta.pivotlow (low , sLen, sLen)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - ARRAYS }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
hl () =>
= request.security(syminfo.tickerid , 'D' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'W' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'M' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , '12M', hl() , lookahead = barmerge.lookahead_on)
lstyle(style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
mtfphl(h, l ,tf ,css, pdhl_style) =>
var line hl = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var line ll = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var label lbl = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}L', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
var label hlb = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}H', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
hy = ta.valuewhen(h != h , h , 1)
hx = ta.valuewhen(h == high , time , 1)
ly = ta.valuewhen(l != l , l , 1)
lx = ta.valuewhen(l == low , time , 1)
if barstate.islast
extension = time + (time - time ) * 50
line.set_xy1(hl , hx , hy)
line.set_xy2(hl , extension , hy)
label.set_xy(hlb, extension , hy)
line.set_xy1(ll , lx , ly)
line.set_xy2(ll , extension , ly)
label.set_xy(lbl, extension , ly)
if lvl_daily
mtfphl(pdh , pdl , 'D' , css_d, s_d)
if lvl_weekly
mtfphl(pwh , pwl , 'W' , css_w, s_w)
if lvl_monthly
mtfphl(pmh , pml, 'M' , css_m, s_m)
if lvl_yearly
mtfphl(pyh , pyl , '12M', css_y, s_y)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Market Structure }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method darkcss(color css, float factor, bool bull) =>
blue = color.b(css) * (1 - factor)
red = color.r(css) * (1 - factor)
green = color.g(css) * (1 - factor)
color.rgb(red, green, blue, 0)
method f_line(msDraw d, size, style) =>
var line id = na
var label lbl = na
id := line.new(
d.n
, d.p
, b.n
, d.p
, color = d.css
, width = 1
, style = style
)
if msline.size() >= 250
line.delete(msline.shift())
msline.push(id)
lbl := label.new(
int(math.avg(d.n, b.n))
, d.p
, d.txt
, color = invcol
, textcolor = d.css
, style = d.bull ? label.style_label_down : label.style_label_up
, size = size
, text_font_family = font.family_monospace
)
structure(bool mtf) =>
msDraw drw = na
bool isdrw = false
bool isdrwS = false
var color css = na
var color icss = na
var int itrend = 0
var int trend = 0
bool bull_ob = false
bool bear_ob = false
bool s_bull_ob = false
bool s_bear_ob = false
n = bar_index
var ms up = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms dn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sup = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sdn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
switch show_swing_ms
"All" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, true )
"CHoCH" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, false )
"CHoCH+" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, true )
"BOS" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
"None" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
=> na
switch show_internal_ms
"All" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, true )
"CHoCH" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, false)
"CHoCH+" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, true )
"BOS" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
"None" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
=> na
switch
iH =>
up.p.unshift(b.h )
up.l.unshift(b.h )
up.n.unshift(n )
iL =>
dn.p.unshift(b.l )
dn.l.unshift(b.l )
dn.n.unshift(n )
sL =>
sdn.p.unshift(b.l )
sdn.l.unshift(b.l )
sdn.n.unshift(n )
sH =>
sup.p.unshift(b.h )
sup.l.unshift(b.h )
sup.n.unshift(n )
// INTERNAL BULLISH STRUCTURE
if up.p.size() > 0 and dn.l.size() > 1
if ta.crossover(b.c, up.p.first())
bool CHoCH = na
string txt = na
if itrend < 0
CHoCH := true
switch
not CHoCH =>
txt := "BOS"
css := i_ms_up_BOS
blalert.bos := true
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS
, txt
, true
)
CHoCH =>
dn.l.first() > dn.l.get(1) ? blalert.chochplus : blalert.choch
txt := dn.l.first() > dn.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_up_BOS.darkcss(0.25, true)
if (dn.l.first() > dn.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => bull_ob := true
ob_filter == "BOS" and txt == "BOS" => bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bull_ob := true
itrend := 1
up.n.clear()
up.p.clear()
// INTERNAL BEARISH STRUCTURE
if dn.p.size() > 0 and up.l.size() > 1
if ta.crossunder(b.c, dn.p.first())
bool CHoCH = na
string txt = na
if itrend > 0
CHoCH := true
switch
not CHoCH =>
bralert.bos := true
txt := "BOS"
css := i_ms_dn_BOS
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS
, txt
, false
)
CHoCH =>
if up.l.first() < up.l.get(1)
bralert.chochplus := true
else
bralert.choch := true
txt := up.l.first() < up.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_dn_BOS.darkcss(0.25, false)
if (up.l.first() < up.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => bear_ob := true
ob_filter == "BOS" and txt == "BOS" => bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bear_ob := true
itrend := -1
dn.n.clear()
dn.p.clear()
// SWING BULLISH STRUCTURE
if sup.p.size() > 0 and sdn.l.size() > 1
if ta.crossover(b.c, sup.p.first())
bool CHoCH = na
string txt = na
if trend < 0
CHoCH := true
switch
not CHoCH =>
blalert.swingbos := true
txt := "BOS"
icss := s_ms_up_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS
, txt
, true
)
CHoCH =>
if sdn.l.first() > sdn.l.get(1)
blalert.chochplusswing := true
else
blalert.chochswing := true
txt := sdn.l.first() > sdn.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_up_BOS.darkcss(0.25, true)
if (sdn.l.first() > sdn.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => s_bull_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bull_ob := true
trend := 1
sup.n.clear()
sup.p.clear()
// SWING BEARISH STRUCTURE
if sdn.p.size() > 0 and sup.l.size() > 1
if ta.crossunder(b.c, sdn.p.first())
bool CHoCH = na
string txt = na
if trend > 0
CHoCH := true
switch
not CHoCH =>
bralert.swingbos := true
txt := "BOS"
icss := s_ms_dn_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS
, txt
, false
)
CHoCH =>
if sup.l.first() < sup.l.get(1)
bralert.chochplusswing := true
else
bralert.chochswing := true
txt := sup.l.first() < sup.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_dn_BOS.darkcss(0.25, false)
if (sup.l.first() < sup.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => s_bear_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bear_ob := true
trend := -1
sdn.n.clear()
sdn.p.clear()
= structure(false)
if isdrw
f_line(drw, size.small, line.style_dashed)
if isdrwS
f_line(drw, size.small, line.style_solid)
= request.security("", "15" , structure(true))
= request.security("", "60" , structure(true))
= request.security("", "240" , structure(true))
= request.security("", "1440" , structure(true))
if show_mtf_str
var tab = table.new(position = position.top_right, columns = 10, rows = 10, bgcolor = na, frame_color = color.rgb(54, 58, 69, 0), frame_width = 1, border_color = color.rgb(54, 58, 69, 100), border_width = 1)
table.cell(tab, 0, 1, text = "15" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 2, text = "1H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 3, text = "4H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 4, text = "1D" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 1, 1, text = itrend15 == 1 ? "BULLISH" : itrend15 == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend15 == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend15 == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 2, text = itrend1H == 1 ? "BULLISH" : itrend1H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 3, text = itrend4H == 1 ? "BULLISH" : itrend4H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend4H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend4H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 4, text = itrend1D == 1 ? "BULLISH" : itrend1D == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1D == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1D == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 5, text = "Detected Pattern", text_halign = text.align_center, text_size = size.normal, text_color = color.silver, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 6, text = p.found, text_halign = text.align_center, text_size = size.normal, text_color = na(p.bull) ? color.white : p.bull ? i_ms_up_BOS.darkcss(-0.25, true) : p.bull == false ? i_ms_dn_BOS.darkcss(0.25, false) : na, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.merge_cells(tab, 0, 5, 1, 5)
table.merge_cells(tab, 0, 6, 1, 6)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Strong/Weak High/Low And Equilibrium }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
var phl = Zphl.new(
na
, na
, label.new(na , na , color = invcol , textcolor = i_ms_dn_BOS , style = label.style_label_down , size = size.tiny , text = "")
, label.new(na , na , color = invcol , textcolor = i_ms_up_BOS , style = label.style_label_up , size = size.tiny , text = "")
, true
, true
, true
, true
, ""
, ""
, 0
, 0
, 0
, 0
, high
, low
, 0
, 0
, 0
, 0
, 0
, 0
, na
, na
)
zhl(len)=>
upper = ta.highest(len)
lower = ta.lowest(len)
var float out = 0
out := b.h > upper ? 0 : b.l < lower ? 1 : out
top = out == 0 and out != 0 ? b.h : 0
btm = out == 1 and out != 1 ? b.l : 0
= zhl(sLen)
= zhl(iLen)
upphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
if top
phl.stopcross := true
phl.txtup := top > phl.topy ? "HH" : "HL"
if show_lbl
topl = label.new(
b.n - swing_r_lookback
, top
, phl.txtup
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
line.delete(phl.top )
phl.top := line.new(
b.n - sLen
, top
, b.n
, top
, color = toplvl)
phl.topy := top
phl.topx := b.n - sLen
phl.tup := top
phl.tupx := b.n - sLen
if itop
phl.itopcross := true
phl.itopy := itop
phl.itopx := b.n - iLen
phl.tup := math.max(high, phl.tup)
phl.tupx := phl.tup == high ? b.n : phl.tupx
phl.uV := phl.tup != phl.tup ? b.v : phl.uV
if barstate.islast
line.set_xy1(
phl.top
, phl.tupx
, phl.tup
)
line.set_xy2(
phl.top
, b.n + 50
, phl.tup
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tup
)
dist = math.abs(phl.uV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend < 0
? "Strong High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
dnphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
if btm
phl.sbottomcross := true
phl.txtdn := btm > phl.bottomy ? "LH" : "LL"
if show_lbl
btml = label.new(
b.n - swing_r_lookback
, btm, phl.txtdn
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
line.delete(phl.bottom )
phl.bottom := line.new(
b.n - sLen
, btm
, b.n
, btm
, color = btmlvl
)
phl.bottomy := btm
phl.bottomx := b.n - sLen
phl.tdn := btm
phl.tdnx := b.n - sLen
if ibtm
phl.ibottomcross := true
phl.ibottomy := ibtm
phl.ibottomx := b.n - iLen
phl.tdn := math.min(low, phl.tdn)
phl.tdnx := phl.tdn == low ? b.n : phl.tdnx
phl.dV := phl.tdn != phl.tdn ? b.v : phl.dV
if barstate.islast
line.set_xy1(
phl.bottom
, phl.tdnx
, phl.tdn
)
line.set_xy2(
phl.bottom
, b.n + 50
, phl.tdn
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tdn
)
dist = math.abs(phl.dV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend > 0
? "Strong Low | " + str.tostring(phl.dV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak Low | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
midphl() =>
avg = math.avg(phl.bottom.get_y2(), phl.top.get_y2())
var line l = line.new(
y1 = avg
, y2 = avg
, x1 = b.n - sLen
, x2 = b.n + 50
, color = midlvl
, style = line.style_solid
)
var label lbl = label.new(
x = b.n + 50
, y = avg
, text = "Equilibrium"
, style = label.style_label_left
, color = invcol
, textcolor = midlvl
, size = size.small
)
if barstate.islast
more = (phl.bottom.get_x1() + phl.bottom.get_x2()) > (phl.top.get_x1() + phl.top.get_x2()) ? phl.top.get_x1() : phl.bottom.get_x1()
line.set_xy1(l , more , avg)
line.set_xy2(l , b.n + 50, avg)
label.set_x (lbl , b.n + 50 )
label.set_y (lbl , avg )
dist = math.abs((l.get_y2() - close) / close) * 100
label.set_text (lbl, "Equilibrium (" + str.tostring(math.round(dist,0)) + "%)")
hqlzone() =>
if barstate.islast
var hqlzone dZone = hqlzone.new(
box.new(
na
, na
, na
, na
, bgcolor = color.new(toplvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(midlvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(btmlvl, 70)
, border_color = na
)
, label.new(na, na, text = "Premium" , color = invcol, textcolor = toplvl, style = label.style_label_down, size = size.small)
, label.new(na, na, text = "Equilibrium", color = invcol, textcolor = midlvl, style = label.style_label_left, size = size.small)
, label.new(na, na, text = "Discount" , color = invcol, textcolor = btmlvl, style = label.style_label_up , size = size.small)
)
dZone.pbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)) , phl.tup)
dZone.pbx.set_rightbottom(b.n + 50 , 0.95 * phl.tup + 0.05 * phl.tdn)
dZone.ebx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.525 * phl.tup + 0.475 * phl.tdn)
dZone.ebx.set_rightbottom(b.n + 50 , 0.525 * phl.tdn + 0.475 * phl.tup)
dZone.lbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.95 * phl.tdn + 0.05 * phl.tup)
dZone.lbx.set_rightbottom(b.n + 50 , phl.tdn)
dZone.plb.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tup)
dZone.elb.set_xy( int(b.n + 50) , math.avg(phl.tup, phl.tdn))
dZone.lbl.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tdn)
if show_mtb
upphl (trend)
dnphl (trend)
hqlzone()
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Volumetric Order Block }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method eB(box b, bool ext, color css, bool swing) =>
b.unshift(
box.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, text_font_family = font.family_monospace
, extend = ext ? extend.right : extend.none
, border_color = swing ? color.new(css, 0) : color.new(color.white,100)
, bgcolor = css
, border_width = 1
)
)
method eL(line l, bool ext, bool solid, color css) =>
l.unshift(
line.new(
na
, na
, na
, na
, width = 1
, color = css
, xloc = xloc.bar_time
, extend = ext ? extend.right : extend.none
, style = solid ? line.style_solid : line.style_dashed
)
)
method drawVOB(bool cdn, bool bull, color css, int loc, bool swing) =>
= request.security(
syminfo.tickerid
, ""
,
, lookahead = barmerge.lookahead_off
)
var obC obj = obC.new(
array.new()
, array.new()
, array.new< int >()
, array.new()
, array.new()
, array.new()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new()
, array.new()
, array.new< int >()
)
var obD draw = obD.new(
array.new()
, array.new()
, array.new()
, array.new()
, array.new()
)
if barstate.isfirst
for i = 0 to ob_num - 1
draw.mL .eL(false, false, use_grayscale ? color.new(color.gray, 0) : color.new(css,0))
draw.ob .eB(false, use_grayscale ? color.new(color.gray, 90) : css, swing)
draw.blB.eB(false, css_metric_up , swing)
draw.brB.eB(false, css_metric_dn , swing)
draw.eOB.eB(true , use_grayscale ? color.new(color.gray, 90) : css, swing)
float pos = ob_pos == "Full"
? (bull ? high : low)
: ob_pos == "Middle"
? ohlc4
: ob_pos == "Accurate"
? hl2
: hl2
if cdn
obj.h.clear()
obj.l.clear()
obj.n.clear()
for i = 0 to math.abs((loc - b.n)) - 1
obj.h.push(hH )
obj.l.push(lL )
obj.n.push(b.t )
// obj.h.reverse()
// obj.l.reverse()
int iU = obj.l.indexof(obj.l.min()) + 1
int iD = obj.h.indexof(obj.h.max()) + 1
obj.dir.unshift(
bull
? (b.c > b.o ? 1 : -1)
: (b.c > b.o ? 1 : -1)
)
obj.top.unshift(
bull
? pos
: obj.h.max()
)
obj.btm.unshift(
bull
? obj.l.min()
: pos
)
obj.left.unshift(
bull
? obj.n.get(obj.l.indexof(obj.l.min()))
: obj.n.get(obj.h.indexof(obj.h.max()))
)
obj.avg.unshift(
math.avg(obj.top.first(), obj.btm.first())
)
obj.cV.unshift(
bull
? b.v
: b.v
)
if ob_pos == "Precise"
switch bull
true =>
if obj.avg.get(0) < (b.c < b.o ? b.c : b.o ) and obj.top.get(0) > hlcc4
obj.top.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
false =>
if obj.avg.get(0) > (b.c < b.o ? b.o : b.c ) and obj.btm.get(0) < hlcc4
obj.btm.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
obj.blVP.unshift ( 0 )
obj.brVP.unshift ( 0 )
obj.wM .unshift ( 1 )
if use_overlap
int rmP = use_overlap_method == "Recent" ? 1 : 0
if obj.avg.size() > 1
if bull
? obj.btm.first() < obj.top.get(1)
: obj.top.first() > obj.btm.get(1)
obj.wM .remove(rmP)
obj.cV .remove(rmP)
obj.dir .remove(rmP)
obj.top .remove(rmP)
obj.avg .remove(rmP)
obj.btm .remove(rmP)
obj.left .remove(rmP)
obj.blVP .remove(rmP)
obj.brVP .remove(rmP)
if barstate.isconfirmed
for x = 0 to ob_num - 1
tg = switch ob_mitigation
"Middle" => obj.avg
"Absolute" => bull ? obj.btm : obj.top
for in tg
if (bull ? cC < pt : cC > pt)
obj.wM .remove(idx)
obj.cV .remove(idx)
obj.dir .remove(idx)
obj.top .remove(idx)
obj.avg .remove(idx)
obj.btm .remove(idx)
obj.left .remove(idx)
obj.blVP .remove(idx)
obj.brVP .remove(idx)
if barstate.islast
if obj.avg.size() > 0
// Alert
if bull
? ta.crossunder(low , obj.top.get(0))
: ta.crossover (high, obj.btm.get(0))
switch bull
true => blalert.obtouch := true
false => bralert.obtouch := true
float tV = 0
obj.dV.clear()
seq = math.min(ob_num - 1, obj.avg.size() - 1)
for j = 0 to seq
tV += obj.cV.get(j)
if j == seq
for y = 0 to seq
obj.dV.unshift(
math.floor(
(obj.cV.get(y) / tV) * 100)
)
obj.dV.reverse()
for i = 0 to math.min(ob_num - 1, obj.avg.size() - 1)
dmL = draw.mL .get(i)
dOB = draw.ob .get(i)
dblB = draw.blB.get(i)
dbrB = draw.brB.get(i)
deOB = draw.eOB.get(i)
dOB.set_lefttop (obj.left .get(i) , obj.top.get(i))
deOB.set_lefttop (b.t , obj.top.get(i))
dOB.set_rightbottom (b.t , obj.btm.get(i))
deOB.set_rightbottom(b.t + (b.t - b.t ) * 100 , obj.btm.get(i))
if use_middle_line
dmL.set_xy1(obj.left.get(i), obj.avg.get(i))
dmL.set_xy2(b.t , obj.avg.get(i))
if ob_metrics_show
dblB.set_lefttop (obj.left.get(i), obj.top.get(i))
dbrB.set_lefttop (obj.left.get(i), obj.avg.get(i))
dblB.set_rightbottom(obj.left.get(i), obj.avg.get(i))
dbrB.set_rightbottom(obj.left.get(i), obj.btm.get(i))
rpBL = dblB.get_right()
rpBR = dbrB.get_right()
dbrB.set_right(rpBR + (b.t - b.t ) * obj.brVP.get(i))
dblB.set_right(rpBL + (b.t - b.t ) * obj.blVP.get(i))
if use_show_metric
txt = switch
obj.cV.get(i) >= 1000000000 => str.tostring(math.round(obj.cV.get(i) / 1000000000,3)) + "B"
obj.cV.get(i) >= 1000000 => str.tostring(math.round(obj.cV.get(i) / 1000000,3)) + "M"
obj.cV.get(i) >= 1000 => str.tostring(math.round(obj.cV.get(i) / 1000,3)) + "K"
obj.cV.get(i) < 1000 => str.tostring(math.round(obj.cV.get(i)))
deOB.set_text(
str.tostring(
txt + " (" + str.tostring(obj.dV.get(i)) + "%)")
)
deOB.set_text_size (size.auto)
deOB.set_text_halign(text.align_left)
deOB.set_text_color (use_grayscale ? color.silver : color.new(css, 0))
if ob_metrics_show and barstate.isconfirmed
if obj.wM.size() > 0
for i = 0 to obj.avg.size() - 1
switch obj.dir.get(i)
1 =>
switch obj.wM.get(i)
1 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 1)
-1 =>
switch obj.wM.get(i)
1 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 1)
var hN = array.new(1, b.n)
var lN = array.new(1, b.n)
var hS = array.new(1, b.n)
var lS = array.new(1, b.n)
if iH
hN.pop()
hN.unshift(int(b.n ))
if iL
lN.pop()
lN.unshift(int(b.n ))
if sH
hS.pop()
hS.unshift(int(b.n ))
if sL
lS.pop()
lS.unshift(int(b.n ))
if ob_show
bull_ob.drawVOB(true , ob_bull_css, hN.first(), false)
bear_ob.drawVOB(false, ob_bear_css, lN.first(), false)
if ob_swings
s_bull_ob.drawVOB(true , css_swing_up, hS.first(), true)
s_bear_ob.drawVOB(false, css_swing_dn, lS.first(), true)
if bull_ob
blalert.ob := true
if bear_ob
bralert.ob := true
if s_bull_ob
blalert.swingob := true
if s_bear_ob
blalert.swingob := true
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - FVG | VI | OG }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
ghl() => request.security(syminfo.tickerid, fvg_tf, [high , low , close , open ])
tfG() => request.security(syminfo.tickerid, fvg_tf, )
cG(bool bull) =>
= ghl()
= tfG()
var FVG draw = FVG.new(
array.new()
, array.new()
)
var FVG cords = array.new()
float pup = na
float pdn = na
bool cdn = na
int pos = 2
cc = timeframe.change(fvg_tf)
if barstate.isfirst
for i = 0 to fvg_num - 1
draw.box.unshift(box.new (na, na, na, na, border_color = color.new(color.white, 100), xloc = xloc.bar_time))
draw.ln.unshift (line.new(na, na, na, na, xloc = xloc.bar_time, width = 1, style = line.style_solid))
switch what_fvg
"FVG" =>
pup := bull ? gl : l
pdn := bull ? h : gh
cdn := bull ? gl > h and cc : gh < l and cc
pos := 2
"VI" =>
pup := bull
? (gc > go
? go
: gc)
: (gc > go
? go
: gc )
pdn := bull
? (gc > go
? gc
: go )
: (gc > go
? gc
: go)
cdn := bull
? go > gc and gh >
Price Action - Trend BarFrom Al Brooks' "Trading Price Action Trends," this indicator colors strong trend bars. Bull trend bars (green body ≥50%, close ≥60% up range, larger than 1.5x average) highlight buyer control, while bear trend bars (red body ≥50%, close ≤40% down range) show seller dominance. Use to identify trend resumption or climaxes. Philosophy: Trends persist until tested—focus on high-probability entries after pullbacks, avoiding barbwire noise.
Price Action - Inside/Outside BarsThis indicator highlights Inside and Outside bars based on Al Brooks' price action philosophy from "Reading Price Charts Bar by Bar." Inside bars (high ≤ previous high and low ≥ previous low) represent contraction and potential breakouts, often leading to two-legged moves. Outside bars (high > previous high and low < previous low with min body 50%) signal volatility and possible reversals or trends. Customizable highlights, lines, and labels help identify high-probability setups in trends or ranges. Always focus on context—buy low, sell high, and wait for confirmation.
EMA 50/200 Signals with Price-Arrows✔ Plots EMA 50 and EMA 200
✔ Displays arrows when a crossover occurs (signals)
✔ Creates alerts for TradingView
✔ Works for crypto, forex, and stocks
Fib+BOS/CHOCH+OB# ⭐ 1) **What This Indicator Does**
The indicator combines 4 major concepts:
### **1️⃣ Market Structure (Swing High/Low)**
* Detects major swing highs and lows using pivot logic
* Determines whether the market is **Bullish** or **Bearish**
### **2️⃣ BOS / CHOCH (Break of Structure / Change of Character)**
* **BOS:** continuation of trend
* **CHOCH:** early signal of trend reversal
* Only the **last 5** levels are displayed → keeps chart clean
### **3️⃣ Order Blocks (OB)**
* Detects last opposite candle before BOS/CHOCH
* Displays only **the latest 3 OB zones**
* Ideal for identifying high-probability pullbacks
BTC GOD — DEFINITIVE BTC MULTI INDICATORBTC GOD — The Ultimate Bitcoin Cycle Indicator (2025 Edition)
The one indicator every serious BTC holder and trader has been waiting for.
A single script that perfectly combines the 5 most powerful and accurate Bitcoin indicators ever created — all 100 % official versions:
- Official Pi Cycle Top (LookIntoBitcoin) → in 2013, 2017 & 2021 (3/3 hits)
- Official MVRV Z-Score (Glassnode / LookIntoBitcoin) → every major bottom (2015, 2018–19, 2022)
- Dynamic Bull/Bear background (red bear-market when price drops X % from cycle ATH + monthly RSI filter)
- Monthly Golden/Death Cross (50-month EMA vs 200-week EMA) → huge, unmistakable signals
- SuperTrend + 200-week EMA + 50-month EMA
- Cycle ATH/ATL tracking with flashing alert in the table when new highs/lows are made
- Exact days to/from the next halving + optimal accumulation zone (200–750 days post-halving)
- Fully customizable inputs for experienced traders
Zero repainting. Zero errors. Works on every timeframe.
This is the indicator used by people who truly understand Bitcoin’s 4-year cycles.
If you could only keep ONE Bitcoin indicator for the rest of your life… this would be it.
Save it, test it, and you’ll instantly see why it’s called BTC GOD.
Built with love and obsession for Bitcoin cycles.
Last update: November 2025
Gann Levels (Auto) by RRR📌 Gann Levels (Auto) — Intraday, Swing & Elliott Wave Precision Tool
Gann Levels (Auto) is a high-accuracy price-reaction indicator designed for intraday scalpers, swing traders, and Elliott Wave traders who want clean, auto-updating support and resistance levels without manually drawing anything.
The indicator automatically detects the latest swing high & swing low and plots the 8 Gann Octave Levels between them. These levels act as a complete price map—showing equilibrium, structure, trend continuation zones, and reversal points with extreme precision.
🔥 Why This Indicator Stands Out
✔ Fully automatic swing detection
Levels update as structure evolves — no manual adjustments.
✔ All Gann Octave levels
Plots 1/8 through 8/8 including the critical 4/8 midpoint.
✔ Intraday-optimized
Exceptional on 1m, 3m, 5m, and 15m charts.
✔ Ultra-clean support & resistance
Levels act as reliable barriers and breakout zones.
⭐ MOST IMPORTANT LEVELS FOR INTRADAY
4/8 – Midpoint (Major Decision Pivot)
Strongest Gann level.
Controls trend or reversal for the session.
Breakout → Trend Day
Rejection → Reversal Day
8/8 & 0/8 – Extreme Structure Edges
Most likely zones for intraday reversals.
Perfect for scalp entries when combined with volume exhaustion.
🎯 How to Trade ELLIOTT WAVE Using Gann Levels
This indicator is exceptionally powerful when combined with Elliott Wave Theory.
Here is how to use it wave-by-wave:
🔵 Wave 2 → Identify Bottom Using 0/8 or 1/8 Levels
Wave 2 typically retraces deep but remains above key structure.
Gann confirmation:
Price stops at 0/8 or 1/8 zone
Rejection wick + low volume breakdown attempt
Bullish intent starts forming
This gives a perfect Wave 3 entry zone.
🔴 Wave 3 → Breakout Above 4/8 Midpoint
Wave 3 is the strongest impulsive wave.
The 4/8 level works like a force-field.
Wave 3 confirmation:
Price breaks and retests 4/8
Strong volume
No deep pullbacks after break
This is one of the most reliable Elliott + Gann trades.
🟡 Wave 4 → Uses 3/8 or 5/8 as Support/Resistance
Wave 4 is corrective and shallow compared to Wave 2.
Gann alignment:
Wave 4 often consolidates between 3/8 and 5/8
Levels act like range boundaries
Avoid trading inside chop; wait for breakout
This gives perfect continuation entries for Wave 5.
🟣 Wave 5 → Ends Near 7/8 or 8/8 Extreme Zone
Wave 5 usually ends in overbought territory.
Gann confirmation:
Price hits 7/8 or 8/8
Momentum weakens
Divergence builds (RSI/MACD optional)
Last push = exhaustion
This is where reversals or major pullbacks begin.
💥 BONUS: Corrective Waves (A-B-C)
Wave A:
Often rejects from 4/8 or 5/8.
Wave B:
Typically trapped between 3/8–5/8.
Wave C:
Usually ends around 0/8 (for bullish trend)
or 8/8 (for bearish trend).
These zones give ultra-high confidence entries.
⚙️ Who This Indicator Is Perfect For
Elliott Wave traders
Intraday scalpers
Swing traders
Price action & structure traders
Traders who want automatic support-resistance levels
Traders who want clean, non-cluttered levels
⚠️ Disclaimer
This indicator is for educational purposes only.
Trading involves risk. Always use proper risk management.
ICT FVG & Swing Detector Basic by Trader Riaz//@version=6
indicator("ICT FVG & Swing Detector Basic by Trader Riaz", overlay=true)
// Display toggles for Bullish FVGs
show_bull_fvg = input.bool(true, "Show Bullish FVGs?")
// Input settings for Bullish FVGs
fvg_bull_count = input.int(1, "Number of Bullish FVGs to show", minval=1)
// Color settings for Bullish FVGs
bullish_fvg_color = input.color(color.green, "Bullish FVG Color")
// Bullish FVG Extend Options
bull_fvg_extendGroup = "Bullish FVG Extend Options"
bull_fvg_extendOption = input.string("Default", "Bullish FVG Extend Option", options= , group=bull_fvg_extendGroup)
bull_fvg_extendCandles = input.int(8, "Bullish FVG Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=bull_fvg_extendGroup)
// Display toggles for Bearish FVGs
show_bear_fvg = input.bool(true, "Show Bearish FVGs?")
// Input settings for Bearish FVGs
fvg_bear_count = input.int(1, "Number of Bearish FVGs to show", minval=1)
// Color settings for Bearish FVGs
bearish_fvg_color = input.color(color.red, "Bearish FVG Color")
// Bearish FVG Extend Options
bear_fvg_extendGroup = "Bearish FVG Extend Options"
bear_fvg_extendOption = input.string("Default", "Bearish FVG Extend Option", options= , group=bear_fvg_extendGroup)
bear_fvg_extendCandles = input.int(8, "Bearish FVG Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=bear_fvg_extendGroup)
// Display toggles for Swing Highs
show_swing_high = input.bool(true, "Show Swing Highs?")
// Input settings for Swing Highs
swing_high_count = input.int(2, "Number of Swing Highs to show", minval=1)
// Color settings for Swing Highs
swing_high_color = input.color(color.green, "Swing High Line & Label Color")
// Swing High Extend Options
swing_high_extendGroup = "Swing High Extend Options"
swing_high_extendOption = input.string("Default", "Swing High Extend Option", options= , group=swing_high_extendGroup)
swing_high_extendCandles = input.int(8, "Swing High Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=swing_high_extendGroup)
// Display toggles for Swing Lows
show_swing_low = input.bool(true, "Show Swing Lows?")
// Input settings for Swing Lows
swing_low_count = input.int(2, "Number of Swing Lows to show", minval=1)
// Color settings for Swing Lows
swing_low_color = input.color(color.red, "Swing Low Line & Label Color")
// Swing Low Extend Options
swing_low_extendGroup = "Swing Low Extend Options"
swing_low_extendOption = input.string("Default", "Swing Low Extend Option", options= , group=swing_low_extendGroup)
swing_low_extendCandles = input.int(8, "Swing Low Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=swing_low_extendGroup)
// Target Settings
showNextTarget = input.bool(true, "Show Next Target")
nextTargetHighColor = input.color(color.red, "Next Target High Color")
nextTargetLowColor = input.color(color.red, "Next Target Low Color")
// === Time Calculation ===
// Calculate one bar duration in milliseconds
barDuration = time - time
// Define reasonable extension period (4 bars into future)
extensionPeriod = barDuration * 4
// Arrays to store values with timestamps
var bull_fvg_data = array.new(0)
var bear_fvg_data = array.new(0)
var swing_high_data = array.new(0)
var swing_low_data = array.new(0)
var bull_fvg_labels = array.new(0)
var bear_fvg_labels = array.new(0)
var swing_high_labels = array.new(0)
var swing_low_labels = array.new(0)
var bull_fvg_midlines = array.new(0)
var bear_fvg_midlines = array.new(0)
var bull_fvg_tops = array.new(0)
var bull_fvg_bottoms = array.new(0)
var bear_fvg_tops = array.new(0)
var bear_fvg_bottoms = array.new(0)
// Get the last bar index
last_bar = last_bar_index + 3
// Function to determine right boundary based on extend option
get_right_boundary(option, extend_candles, default_right) =>
if option == "None"
bar_index - 2
else if option == "Limited"
bar_index - 2 + extend_candles
else
default_right
// Bullish FVG Detection
if high < low and show_bull_fvg
right_bar = get_right_boundary(bull_fvg_extendOption, bull_fvg_extendCandles, last_bar)
new_box = box.new(left=bar_index-2,
top=low,
right=right_bar,
bottom=high ,
bgcolor=color.new(bullish_fvg_color, 90),
border_color=bullish_fvg_color)
bull_mid = (low + high ) / 2
new_midline = line.new(bar_index-2, bull_mid, right_bar, bull_mid,
color=color.new(bullish_fvg_color, 50),
style=line.style_dashed)
new_label = label.new(right_bar-1, bull_mid, "Bullish FVG",
color=color.new(bullish_fvg_color, 100),
textcolor=bullish_fvg_color,
style=label.style_none,
textalign=text.align_right,
size=size.small)
array.unshift(bull_fvg_data, new_box)
array.unshift(bull_fvg_midlines, new_midline)
array.unshift(bull_fvg_labels, new_label)
array.unshift(bull_fvg_tops, low)
array.unshift(bull_fvg_bottoms, high )
if array.size(bull_fvg_data) > fvg_bull_count
box.delete(array.pop(bull_fvg_data))
line.delete(array.pop(bull_fvg_midlines))
label.delete(array.pop(bull_fvg_labels))
array.pop(bull_fvg_tops)
array.pop(bull_fvg_bottoms)
// Bearish FVG Detection
if low > high and show_bear_fvg
right_bar = get_right_boundary(bear_fvg_extendOption, bear_fvg_extendCandles, last_bar)
new_box = box.new(left=bar_index-2,
top=low ,
right=right_bar,
bottom=high,
bgcolor=color.new(bearish_fvg_color, 90),
border_color=bearish_fvg_color)
bear_mid = (low + high) / 2
new_midline = line.new(bar_index-2, bear_mid, right_bar, bear_mid,
color=color.new(bearish_fvg_color, 50),
style=line.style_dashed)
new_label = label.new(right_bar-1, bear_mid, "Bearish FVG",
color=color.new(bearish_fvg_color, 100),
textcolor=bearish_fvg_color,
style=label.style_none,
textalign=text.align_right,
size=size.small)
array.unshift(bear_fvg_data, new_box)
array.unshift(bear_fvg_midlines, new_midline)
array.unshift(bear_fvg_labels, new_label)
array.unshift(bear_fvg_tops, low )
array.unshift(bear_fvg_bottoms, high)
if array.size(bear_fvg_data) > fvg_bear_count
box.delete(array.pop(bear_fvg_data))
line.delete(array.pop(bear_fvg_midlines))
label.delete(array.pop(bear_fvg_labels))
array.pop(bear_fvg_tops)
array.pop(bear_fvg_bottoms)
// Swing High Detection
is_swing_high = high < high and high > high
if is_swing_high and show_swing_high
right_bar = get_right_boundary(swing_high_extendOption, swing_high_extendCandles, last_bar + 3)
new_line = line.new(bar_index - 1, high , right_bar, high ,
color=swing_high_color)
new_label = label.new(right_bar, high , "Swing High",
color=color.new(color.white, 30),
style=label.style_label_left,
textcolor=swing_high_color,
size=size.tiny)
array.unshift(swing_high_data, new_line)
array.unshift(swing_high_labels, new_label)
if array.size(swing_high_data) > swing_high_count
line.delete(array.pop(swing_high_data))
label.delete(array.pop(swing_high_labels))
// Swing Low Detection
is_swing_low = low > low and low < low
if is_swing_low and show_swing_low
right_bar = get_right_boundary(swing_low_extendOption, swing_low_extendCandles, last_bar + 3)
new_line = line.new(bar_index -1, low , right_bar, low ,
color=swing_low_color)
new_label = label.new(right_bar, low , "Swing Low",
color=color.new(color.white, 30),
style=label.style_label_left,
textcolor=swing_low_color,
size=size.tiny)
array.unshift(swing_low_data, new_line)
array.unshift(swing_low_labels, new_label)
if array.size(swing_low_data) > swing_low_count
line.delete(array.pop(swing_low_data))
label.delete(array.pop(swing_low_labels))
// Clean up if toggles are turned off
if not show_bull_fvg and array.size(bull_fvg_data) > 0
for i = 0 to array.size(bull_fvg_data) - 1
box.delete(array.get(bull_fvg_data, i))
line.delete(array.get(bull_fvg_midlines, i))
label.delete(array.get(bull_fvg_labels, i))
array.clear(bull_fvg_data)
array.clear(bull_fvg_midlines)
array.clear(bull_fvg_labels)
array.clear(bull_fvg_tops)
array.clear(bull_fvg_bottoms)
if not show_bear_fvg and array.size(bear_fvg_data) > 0
for i = 0 to array.size(bear_fvg_data) - 1
box.delete(array.get(bear_fvg_data, i))
line.delete(array.get(bear_fvg_midlines, i))
label.delete(array.get(bear_fvg_labels, i))
array.clear(bear_fvg_data)
array.clear(bear_fvg_midlines)
array.clear(bear_fvg_labels)
array.clear(bear_fvg_tops)
array.clear(bear_fvg_bottoms)
// === Swing High/Low Detection ===
var float swingHighs = array.new()
var int swingHighTimes = array.new()
var float swingLows = array.new()
var int swingLowTimes = array.new()
var line swingHighLines = array.new()
var label swingHighLabels = array.new()
var line swingLowLines = array.new()
var label swingLowLabels = array.new()
isSwingHigh = high > high and high > high
isSwingLow = low < low and low < low
if isSwingHigh
array.unshift(swingHighs, high )
array.unshift(swingHighTimes, time )
if isSwingLow
array.unshift(swingLows, low )
array.unshift(swingLowTimes, time )
// === Next Target Detection ===
var line currentTargetLine = na
var label currentTargetLabel = na
if showNextTarget
if not na(currentTargetLine)
line.delete(currentTargetLine)
if not na(currentTargetLabel)
label.delete(currentTargetLabel)
priceRising = close > open
priceFalling = close < open
// Use slightly longer extension for targets
targetExtension = barDuration * 8
if priceRising and array.size(swingHighs) > 0
for i = 0 to array.size(swingHighs) - 1
target = array.get(swingHighs, i)
targetTime = array.get(swingHighTimes, i)
if target > close
currentTargetLine := line.new(
x1=targetTime, y1=target,
x2=time + targetExtension, y2=target,
color=nextTargetHighColor, width=2,
style=line.style_dashed,
xloc=xloc.bar_time)
currentTargetLabel := label.new(
x=time + targetExtension, y=target,
text="Potential Target", size=size.tiny,
style=label.style_label_left,
color=nextTargetHighColor,
textcolor=color.white,
xloc=xloc.bar_time)
break
else if priceFalling and array.size(swingLows) > 0
for i = 0 to array.size(swingLows) - 1
target = array.get(swingLows, i)
targetTime = array.get(swingLowTimes, i)
if target < close
currentTargetLine := line.new(
x1=targetTime, y1=target,
x2=time + targetExtension, y2=target,
color=nextTargetLowColor, width=2,
style=line.style_dashed,
xloc=xloc.bar_time)
currentTargetLabel := label.new(
x=time + targetExtension, y=target,
text="Potential Target", size=size.tiny,
style=label.style_label_left,
color=nextTargetLowColor,
textcolor=color.white,
xloc=xloc.bar_time)
break
Reversal Candlestick Setups (Doji, Outside, Extreme, Wick)Reversal Candlestick Setups – Doji, Outside, Extreme & Wick
This indicator identifies four high-probability reversal candlestick patterns across all timeframes: Doji Reversals, Outside Reversals, Extreme Reversals, and Wick Reversals. Each setup is based on clearly defined quantitative rules, allowing traders to filter noise and focus on strong reversal signals instead of relying on subjective visual interpretation.
The tool automatically scans every candle, highlights qualifying patterns on the chart, and provides alert options for both bullish and bearish versions of all four setups. This makes it suitable for intraday traders, swing traders, and positional traders seeking early reversal confirmation.
Included Setups
1. Doji Reversal Setup
Identifies candles with extremely small bodies relative to their range, combined with a smaller-than-average bar size. Useful for spotting market indecision before a directional shift.
2. Outside Reversal Setup
Flags candles that engulf the previous candle’s high–low range and exceed the average range by a multiplier. This is designed to capture strong momentum reversals driven by aggressive buying or selling.
3. Extreme Reversal Setup
Highlights large-bodied candles that dominate their overall range and exceed twice the average bar size. These signals aim to catch climactic exhaustion and institutional-level reversals.
4. Wick Reversal Setup
Detects candles with long rejection wicks, small bodies, and closes near an extreme of the range, supported by above-average bar size. Ideal for identifying sharp intrabar rejections.
Key Features
• Automatically detects all four reversal setups
• Works on all timeframes and symbols
• Customizable variables for deeper testing and optimization
• Clear bullish and bearish labels directly on the chart
• Fully integrated alert conditions for real-time notifications
• Suitable for crypto, stocks, indices, forex, and commodities
Who This Indicator Is For
• Traders who want objective, rule-based reversal detection
• Price action traders looking to enhance accuracy
• Systematic traders wanting quantifiable candlestick criteria
• Beginners learning reversal structures with visual guidance
• Professionals integrating reversal patterns into algorithmic or discretionary systems
How to Use
Add the indicator to your chart and enable alerts for the specific setups you want to track (e.g., “Bullish Wick Reversal”). Combine these signals with market structure, trend filters, volume analysis, or momentum indicators for increased conviction.
Daily Separator_Yoot HobbizSimply helps you separate each trading day — a clean, visual indicator that marks daily sessions so you can read price action faster and stay focused on what really matters.
A simple indicator that clearly separates each trading day, making your charts easier to read and your decisions easier to take.
MoneyLine FusionMoneyLine Fusion is an advanced multi-indicator system combining linear regression trend analysis with dynamic volatility bands, Fisher Transform oscillator signals, and Aroon momentum filters. The core "Money Line" uses linear regression to identify trend direction, surrounded by ATR-based bands that dynamically expand during strong trends (powered by ADX). Buy and sell signals trigger when the Fisher Transform crosses extreme levels (-2.0/+2.0) while Aroon conditions confirm momentum exhaustion or reversal. The indicator features an enhanced scoring system integrating MACD, DMI, MFI, and RSI to provide a comprehensive market sentiment gauge. Visual feedback includes color-coded trend bands, scoring bars at chart bottom, and an info panel displaying Money Line value, volatility percentile, RSI levels, and composite TA score. Signal filtering prevents duplicate entries within 5 bars, and all parameters (Fisher/Aroon periods, signal thresholds, band multipliers) are fully customizable. Ideal for swing traders seeking high-probability entries with multi-timeframe confluence and clear visual confirmation.






















