DeltaFlow Volume Profile [BigBeluga]🔵 OVERVIEW
The DeltaFlow Volume Profile builds a compact volume profile next to price and enriches every bin with flow context : bullish vs. bearish participation (%), a per-bin Delta % , an optional Delta Heat Map , and a PoC band with the bin’s absolute volume. This lets you see not just where volume clustered, but who (buyers or sellers) dominated inside each price slice.
🔵 CONCEPTS
Binned Volume Profile : Price range over a user-defined LookBack is split into Bins ; each bin aggregates traded volume.
Bull/Bear Split : Within every bin, volume is separated by candle direction into Bull Volume and Bear Volume , then normalized to % of the bin’s displayed size.
Delta % : The difference between Bull % and Bear % for the bin. Positive = buyer dominance; negative = seller dominance.
Delta Heat Map : Bin background shading that scales with both total volume strength and delta bias.
PoC (Point of Control) : The most significant bin gets a PoC band and a label with its absolute volume.
🔵 FEATURES
Profile with Flow : A clean horizontal volume bar per bin plus stacked Bull % and Bear % .
Per-Bin Delta Label : A readable “Δ xx%” tag at the start of each bin shows dominance at a glance.
Delta Heat Map : Optional gradient that intensifies with higher volume and stronger delta.
PoC Highlight : Optional PoC band colored separately, labeled with absolute volume (e.g., “1.23M”).
Configurable Inputs : LookBack, number of Bins (10–100), toggles for Delta, Heat Map, Volume Bars, and PoC color.
Readable Colors : Separate inputs for bullish (volume +) and bearish (volume –) hues.
🔵 HOW TO USE
Set the window : Choose LookBack and Bins to balance detail vs. performance (more bins = finer resolution).
Enable “Volume Bars” to display the bull/bear split as two stacked percent bars inside each bin.
High Bull % near support → constructive demand.
High Bear % near resistance → active supply.
Use Δ labels (toggle “Delta”) to quickly spot bins with clear buyer/seller control; combine with price position for confluence.
Turn on Delta Heat Map to prioritize areas with both large volume and strong imbalance.
Watch the PoC : The PoC band marks the most traded (and often magnet) level; its label shows absolute size for context.
Trade ideas :
Breakout continuation when Δ stays positive across consecutive upper bins.
Reversion risk when price enters a large bearish-Δ cluster below.
Manage risk around the PoC; reactions there can be sharp.
🔵 CONCLUSION
DeltaFlow Volume Profile upgrades a classic profile with flow intelligence. The bull/bear split, explicit Δ %, heat-weighted backdrop, and PoC volume label make dominant participation and key price shelves obvious. Use it to filter levels, time entries with imbalance, and validate breakouts or fades with objective volume-flow evidence.
אינדיקטורים ואסטרטגיות
Trading Activity Index (Zeiierman)█ Overview
Trading Activity Index (Zeiierman) is a volume-based market activity meter that transforms dollar-volume into a smooth, normalized “activity index.”
It highlights when market participation is unusually low or high with a dynamic color gradient:
Light Blue → Low Activity (thin participation, low liquidity conditions)
Red/Orange → High Activity (active markets, large trades flowing in)
Additional percentile bands (20/40/60/80%) give context, helping you see whether the current activity level is in the bottom quintile, mid-range, or near historical extremes.
█ How It Works
⚪ Dollar Volume Transformation
Each bar, dollar volume is computed:
float dlrVol = close * volume
float dlrVolAvg = ta.sma(dlrVol, len_form)
Dollar volume = price × volume, smoothed by a configurable SMA window.
The result is log-transformed, compressing large outliers for a more stable signal.
⚪ Rolling Percentiles & Ranking
The log-dollar-volume series is compared to its rolling history (len_hist bars):
float p20 = ta.percentile_linear_interpolation(vscale, len_hist, 20)
float p40 = ta.percentile_linear_interpolation(vscale, len_hist, 40)
float p60 = ta.percentile_linear_interpolation(vscale, len_hist, 60)
float p80 = ta.percentile_linear_interpolation(vscale, len_hist, 80)
A normalized rank (0–1) is produced to color the main Trading Activity line.
█ How to Use
⚪ Detect High-Impact Sessions
Quickly see if today’s session is active or quiet relative to its own history — great for filtering setups that need activity.
⚪ Spot Breakouts & Traps
Combine with price action:
High activity near breakouts = strong follow-through likely.
Low activity breakouts = vulnerable to fake-outs.
⚪ Market Regime Context
Percentile bands help you assess whether participation is building up, in the middle of the range, or drying out — valuable for timing mean-reversion trades.
Above 80th percentile (red/orange) → Market is highly active, breakout trades and trend strategies are favored.
Below 20th percentile (light blue) → Market is quiet; fade moves or wait for expansion.
Watch transitions from blue → orange as a signal of growing institutional participation.
█ Settings
Formation Window (bars) – Number of bars used to average dollar volume before log transform.
History Window (bars) – Lookback period for percentile calculations and rank normalization.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
order block new 113/// 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 >
SMT (DXY) DIVERGENCESThis indicator detects Smart Money Technique (SMT) Divergences between the chart symbol and up to two comparison symbols defined in the settings.
It identifies swing highs and swing lows on correlated/uncorrelated instruments, compares their highs and lows, and determines possible divergences.
🔷 What It Detects
-Bullish SMT Divergence: When the lows of the chart symbol slope in the opposite direction of the comparison symbol’s lows.
-Bearish SMT Divergence: When the highs of the chart symbol slope in the opposite direction of the comparison symbol’s highs.
-Multi-Symbol Compatibility: Ability to compare the main symbol with one or two external tickers (default: DXY and GBPUSD).
-Negative Divergence Option: The inversion feature allows comparison with opposite-moving charts.
🔷 Calculation Logic
-Swing Detection: Swing highs and lows are confirmed using pivot-based logic.
-Comparison: Slopes of highs and lows are calculated for both the chart symbol and the comparison symbols.
-Divergence Identification: If slopes point in opposite directions, an SMT divergence (bullish or bearish) is marked.
-Visualization: Lines and labels (“+ SMT” or “– SMT”) are drawn on the chart. Historical lines can be kept or cleared depending on user settings.
🔷 Visual
Bearish SMT: Downward line with “– SMT” label.
Bullish SMT: Upward line with “+ SMT” label.
Style Options: Predefined color schemes (TLAB, standard, monochrome) or fully customizable colors.
Line Style: Solid, dashed, or dotted.
🔷 Customization Options
-Show Historical: Decide whether past divergences remain visible on the chart.
-Comparison Symbols: Define up to two external tickers, with optional inversion.
-Swing Lengths: Preconfigured pivot lengths automatically adapt to the selected timeframe (Daily, 4H, 1H, 5m/15m).
-Lines & Labels: Enable or disable bullish/bearish SMT divergences and their annotations.
🔷 Indicator Usage
Select the comparison symbol with positive or negative correlation.
Wait for the “+ SMT” or “– SMT” marker to appear on the chart.
Divergences can be used as contextual confluence when studying potential market shifts:
A + SMT marker may suggest bullish divergence.
A – SMT marker may suggest bearish divergence.
mara Dynamic RangeUpdated pp dynamic zone indicator, which helps to provide support/resistance for intra day and swing trade
Volatility Momentum Score | Lyro RSVolatility Momentum Score | Lyro RS
Overview
The Volatility Momentum Score (VMS) combines price movement and volatility into a single, easy-to-read signal. Using z-scores, standard deviation bands, and flexible display modes, it helps traders identify trends, overbought/oversold conditions, and potential reversals quickly and effectively.
Key Features
Price + Volatility Blend
Tracks price action and volatility with separate z-scores and merges them into a unified momentum score.
Standard Deviation Bands
Upper and lower bands highlight extreme readings.
Adjustable multipliers allow for fine-tuning sensitivity.
Two Signal Modes
Trend Mode: Plots “Long” and “Short” signals when momentum crosses bands.
Reversion Mode: Colors the chart background when the score indicates stretched conditions.
Overbought & Oversold Alerts
▲ markers indicate oversold conditions.
▼ markers indicate overbought conditions.
Custom Colors
Four preset color themes or fully customizable bullish/bearish colors.
Clear Visuals
Dynamic line coloring based on momentum.
Candles recolored at signal points.
Background shading for quick visual assessment.
How It Works
Calculates z-scores for both price and volatility.
Blends the z-scores into a single average score.
Compares the score against dynamic upper and lower bands.
Triggers signals, markers, or background shading depending on the chosen display mode.
Practical Use
Ride trends: Follow Trend Mode signals to align with momentum.
Spot reversals: Watch ▲ and ▼ markers when markets are overextended.
Stay aware: Background shading highlights potentially overheated conditions.
Customization
Set lookback lengths for price, volatility, and bands.
Adjust band multipliers for more or less sensitive signals.
Choose between Trend or Reversion mode based on trading style.
Select color themes or create custom palettes.
⚠️ Disclaimer
This indicator is a technical analysis tool and does not guarantee results. It should be used alongside other methods and proper risk management. The creators are not responsible for any financial decisions based on its signals.
Volume Delta Oscillator with Divergence█ OVERVIEW
The Volume Delta Oscillator with Divergence is a technical indicator designed for the TradingView platform, helping traders identify potential trend reversal points and market momentum shifts through volume delta analysis and divergence detection. The indicator combines a smoothed volume delta oscillator with moving average-based signals, overbought/oversold levels, and divergence visualization, enhanced by configurable gradients and alerts for quick decision-making.
█ CONCEPT
The core idea of the indicator is to measure net buying or selling pressure through volume delta, smooth it for greater clarity, and detect divergences between price action and the oscillator. The indicator does not use external data, making it a compromise but practical tool for analyzing market dynamics based on available price and volume data. It provides insights into market dynamics, overbought/oversold conditions, and potential reversal points, with an attractive visual presentation.
█ WHY USE IT?
- Divergence detection: Identifies bullish and bearish divergences between price and the oscillator, signaling potential reversals.
- Volume delta analysis: Measures cumulative volume delta to assess buying/selling pressure, expressed as a percentage for cross-market comparability.
- Signal generation: Creates buy/sell signals based on overbought/oversold level crossovers, zero line crossovers, and moving average zero line crossovers.
- Visual clarity: Uses gradients, fills, and dynamic colors for intuitive chart analysis.
- Flexibility: Numerous settings allow adaptation to various markets (e.g., forex, crypto, stocks) and trading strategies.
█ HOW IT WORKS?
- Volume delta calculation: Computes net buying/selling pressure per candle as volume * (close - open) / (high - low), aggregated over a specified period (Cumulative Delta Length).
- Smoothing: Applies an EMA (Smoothing Length) to the cumulative delta percentage, creating a smoother oscillator (Delta Oscillator).
- Moving Average: Calculates an SMA (Moving Average Length) of the smoothed delta for trend confirmation (Moving Average (SMA)).
- Divergence detection: Identifies bullish and bearish divergences by comparing price and oscillator pivot highs/lows within a specified range (Pivot Length).
- Normalization: Delta is expressed as a percentage of total volume, ensuring consistency across instruments and timeframes.
- Signals: Generates signals for:
Crossing the oversold level upward (buy) or overbought level downward (sell).
Crossing the zero line by the oscillator or moving average (buy/sell).
Bullish/bearish divergences, marked with labels.
- Visualization: Draws the oscillator and moving average with dynamic colors, gradient fills, and transparent bands and labels, with configurable overbought/oversold levels.
- Alerts: Built-in alerts for divergence detection, overbought/oversold crossovers, and zero line crossovers (both oscillator and moving average).
█ SETTINGS AND CUSTOMIZATION
- Cumulative Delta Length: Period for aggregating volume delta (default: 14).
- Smoothing Length (EMA): EMA length for smoothing the delta oscillator (default: 2). Higher values smooth the signal but reduce the number of generated signals.
- Moving Average Length (SMA): SMA length for the moving average line (default: 40). Higher values allow SMA to be analyzed as a trend indicator, but require adjusting overbought/oversold levels for MA, as longer MA oscillates less.
- Pivot Length (Left/Right): Number of candles for detecting pivot highs/lows in divergence calculations (default: 2). Higher values can reduce noise but introduce a delay equal to the set value.
- Overbought/Oversold Levels: Thresholds for the oscillator (default: 18/-18) and for the moving average (default: 10/-10). For the moving average, no arrows appear; instead, the band changes color from gray to green (oversold) or red (overbought), which can strengthen entry signals for delta.
- Signal Type: Select signals to display: "Overbought/Oversold", "Zero Line", "MA Zero Line", "All", or "None" (default: Overbought/Oversold).
- Colors and gradients: Customize colors for bullish/bearish oscillator, moving average, zero line, overbought/oversold levels, and divergence labels.
- Transparency: Adjust gradient fill transparency (default: 70) and band/label transparency (default: 40) for consistent appearance.
- Visualizations: Enable/disable the moving average, gradients for zero/overbought/oversold levels, and gradient fills.
█ USAGE EXAMPLES
- Momentum analysis: Observe the delta oscillator above 0 for bullish momentum or below 0 for bearish momentum. The moving average (SMA), being smoothed, reacts more slowly and can confirm trend direction as a noise filter.
- Reversal signals: Look for buy triangles when the oscillator crosses the oversold level upward, especially when the moving average is below the MA oversold threshold. Similarly, look for sell triangles when crossing the overbought level downward, with the moving average above the MA overbought threshold. Divergence labels (bullish/bearish) indicate potential reversals.
- Divergence trading: Use bullish divergence labels (green) for potential buy opportunities and bearish labels (red) for sell opportunities, especially when confirmed by price action or other indicators.
- Customization: Adjust the cumulative delta length, smoothing, and moving average length to specific instruments and timeframes to minimize false signals.
█ NOTES FOR USERS
- Combine the indicator with other tools, such as Fibonacci levels, RSI, or pivot points, to increase accuracy.
- Test different settings for cumulative delta length, smoothing, and moving average length on your chosen instrument and timeframe to find optimal values.
Bitcoin Cycles IndicatorTrack Bitcoin's cyclical price patterns across multiple timeframes with this cycle analysis tool. The indicator automatically identifies cycle lows and highs, marking them with clear visual labels that show cycle day counts and failed cycle detection.
Key Features:
Multi-Time frame Support - Optimized settings for Daily, Weekly, Monthly, and Custom time frames
Cycle Tracking - Identifies and labels cycle lows (green) and highs (red) with day counts
Failed Cycle Detection - Highlights when cycles break below previous lows
Customizable Settings - Adjust cycle lengths, colors, and display options for each timeframe
Info Box - Real-time cycle information display with current cycle day count
Projection Boxes - Visual cycle length projections for better analysis
Perfect for Bitcoin traders and analysts who want to understand market cycles and timing. Works best on Daily charts for short-term cycles and Weekly/Monthly charts for longer-term analysis.
The Maker StrategyDESCRIPTION
The Maker Strategy is a trend-following system built around exponential moving averages (EMAs). By analyzing the alignment of multiple EMAs, the strategy identifies strong bullish or bearish momentum and generates precise entry signals. This method is designed to capture sustained trends while filtering out sideways or noisy market conditions.
USER INPUTS :
• EMA 1 Length (Default: 30)
• EMA 2 Length (Default: 35)
• EMA 3 Length (Default: 40)
• EMA 4 Length (Default: 45)
• EMA 5 Length (Default: 50)
• EMA 6 Length (Default: 60)
LONG CONDITION :
A long signal is triggered when all EMAs are perfectly aligned in ascending order:
EMA1 > EMA2 > EMA3 > EMA4 > EMA5 > EMA6
SHORT CONDITION :
A short signal is triggered when all EMAs are perfectly aligned in descending order:
EMA1 < EMA2 < EMA3 < EMA4 < EMA5 < EMA6
WHY IT IS UNIQUE:
Unlike traditional EMA crossover systems that rely on just 2 or 3 moving averages, The Maker Strategy uses 6 EMAs in sequence. This ensures that trades are only taken when there is clear and strong market momentum. The approach minimizes false signals in ranging markets and focuses on capturing trends with higher probability setups.
HOW USER CAN BENEFIT FROM IT :
• Clear entry alerts for both long and short positions.
• Visual confirmation through candle coloring and EMA band fills.
• Works on multiple timeframes and instruments (stocks, forex, crypto, indices).
• Helps traders stay on the right side of the trend while avoiding whipsaws.
• A simple yet effective tool for those who want a disciplined, rules-based strategy.
HighestHigh LowestLow Lookback Window AAVWAPPlots Auto Anchored Vwap from either highest high and lowest low inside the lookback window from the last bar.
Includes 1 deviation multiplier band set each for highest high and lowest low.
You can configure the lookback window and deviation band multiplier and the line colors.
Includes alert conditions.
This code is functional replication of TradingView's auto anchored VWAP.
Fractal Model (TTrades)Fractal Model - Higher Timeframe Analysis with TTFM Labeling
A higher timeframe candle visualization tool enhanced with TTFM (The Fractal Model) labeling system for pivot-based price action analysis, made popular by Youtuber TTrades
What This Script Does:
This indicator displays higher timeframe candles on your current chart and identifies key pivot formations using the TTFM labeling system. It helps traders understand market structure and potential reversal points through systematic pivot analysis.
Key Features:
Higher Timeframe Visualization : Shows HTF candles without switching timeframes
TTFM Labeling System : Identifies pivot components with C2, C3, and C4 labels
T-Spot Detection : Marks areas where price is likely to form wicks based on pivot logic
Sweep Confirmation : Detects when price sweeps previous levels but closes opposite
Fair Value Gap Detection : Identifies imbalance zones between candle ranges
Alert System : Sends alerts when T-spot formations are confirmed using pivot logic
Silver T-Spot Alerts : Special alerts during specific market hours
How TTFM Labeling Works:
The TTFM system labels pivot formations based on their structure:
C2 : The candle that "sticks out" - the initial move that creates the pivot
C3 / C4 : The distribution candle that continues the reversal (standard pivots)
Alert System:
The indicator provides alerts when:
T-spot formations are created and confirmed
Price sweeps tspot levels with proper confirmation (This signal tries to alert you when a potential wick has formed in the tspot location
Silver T-spot patterns occur during specific market hours
T-spot sweep confirmations are triggered
Practical Usage:
Add the indicator to your chart
Watch for T-spot formations (highlighted zones)
Look for C2, C3, C4 labels to understand pivot structure
Use sweep confirmations for entry timing
Set up alerts for T-spot confirmations and sweeps
Technical Implementation:
Logarithmic Midpoint Calculation:
The T-spot levels are calculated using logarithmic midpoint analysis:
Log Values : log_high = ln(high), log_low = ln(low), log_open = ln(open), log_close = ln(close)
Wick Analysis : upper_wick = log_high - max(log_open, log_close), lower_wick = min(log_open, log_close) - log_low
Body Size : body_size = |log_close - log_open|
Midpoint Logic : If max(upper_wick, lower_wick) > body_size, use wick-based midpoint; otherwise use (log_high + log_low)/2
Final Level : T-spot level = exp(log_mid_level)
T-Spot Formation Conditions:
Standard Bearish : last_closed.h > prev_closed.h AND last_closed.c < prev_closed.h
Standard Bullish : last_closed.l < prev_closed.l AND last_closed.c > prev_closed.l
Expansive Bearish : prev_closed.h > prev_prev_closed.h AND last_closed.c < max(prev_closed.o, prev_closed.c)
Expansive Bullish : prev_closed.l < prev_prev_closed.l AND last_closed.c > min(prev_closed.o, prev_closed.c)
Pro-trend Bearish : last_closed.h > mid_level AND last_closed.h < prev_closed.o AND last_closed.c < prev_closed.l
Pro-trend Bullish : last_closed.l < mid_level AND last_closed.l > prev_closed.o AND last_closed.c > prev_closed.h
Sweep Confirmation Logic:
Pivot Detection : Uses ta.pivothigh(high, 1, 2) and ta.pivotlow(low, 1, 2)
Touch Detection : Price must touch T-spot level (high > level OR open > level) AND close opposite
Confirmation Requirements : Pivot must form before touch, close must break beyond pivot level
Alert Trigger : Sweep confirmed when all conditions are met
Silver T-Spot Conditions:
Special T-spots during specific market hours (4th-5th candle of day or 4th candle after 1PM ET) with additional confirmation requirements.
HTF Auto-Detection:
Automatically selects appropriate higher timeframes: 1m→15m, 3m→30m, 5m→1h, 15m→4h, 30m-1h→1D, 4h-8h→1W, 1D→1M.
Based on HTF Candles by Fadi, enhanced with T-spot detection, sweep logic, TTFM labeling system, and comprehensive alert functionality.
Note: This tool is for educational purposes and should be used in conjunction with proper risk management and market analysis.
Smart Index Levels — GSK-VIZAG-AP-INDIA📌 Smart Index Levels — GSK-VIZAG-AP-INDIA
Smart Index Levels is a versatile support and resistance plotting tool designed for intraday, weekly, and monthly analysis.
It automatically generates key price zones based on user-defined step sizes, helping traders visualize important market levels more clearly.
🔹 Features
Daily / Weekly / Monthly Modes
Switch easily between daily, weekly, or monthly reference levels.
Customizable Level Steps
Choose step intervals of 50 or 100 points for cleaner index-based zones.
Support & Resistance Zones
Auto-draws multiple support and resistance levels around the opening base price.
Mid-Level Marking
Highlights the nearest “mid” price level for balance reference.
Weekly High/Low Tracking (Optional)
Plots dynamic weekly high & low levels with dotted lines.
Monthly High/Low Tracking (Optional)
Displays monthly high & low levels for broader market context.
Custom Market Session Timing
Define your own market open and close times.
Line Style & Colors
Fully customizable line styles (solid, dashed, dotted) and colors.
⚙️ How It Works
At the start of the selected session (daily, weekly, or monthly), the script identifies the opening reference price.
From this base, it calculates and draws support and resistance levels at fixed step intervals.
Optionally, it overlays weekly and monthly high/low levels for additional perspective.
This provides a structured price map that helps you quickly spot potential reaction zones, without cluttering the chart.
🖥️ Best Use Cases
Intraday index traders who want quick reference levels (Nifty, BankNifty, etc.)
Swing traders who prefer weekly and monthly zones for context.
Anyone looking for clean, rule-based support/resistance plotting.
⚠️ Disclaimer
This indicator is for educational and informational purposes only.
It does not provide financial advice or trading signals. Always use in combination with your own analysis and risk management.
BK AK-Warfare Formations👑 Introducing BK AK-Warfare Formations — Form the pride. Take the high ground. Strike with wisdom. 👑
This is my 9th release—built for traders who think like commanders: see the formation, decide the maneuver, deliver the strike.
🎖️ Full Credit
The pattern engine, detection logic, and architecture come from Trendoscope—one of the absolute best coders on TradingView and the original creator of this indicator’s core.
I asked for a few interface upgrades and knew he was driving bigger builds. So I forged the add-ons myself and am releasing them for those who value a cleaner, more tactical read.
My enhancements (on top of Trendoscope):
Label transparency (text + background)
Short-form pattern codes (AC/DC/RC/RWE/...)
Transparency controls for short-form labels
Hover tooltips with full pattern name + bullish/bearish/neutral bias (toggle)
Everything else is Trendoscope. Respect where it’s due.
🧠 What It Does
Auto-detects Channels, Wedges (expanding/contracting), and Triangles (ascending/descending/converging/diverging).
Prints clean battlefield tags (AC, DC, RWE, …) so structure is visible without drowning price.
Hover for the brief: long name + directional bias exactly when you need it.
Multi-zigzag sweep, overlap control, bar-ratio verification, max-pattern caps, dark/light aware palette + custom colors.
🧭 Read the Battlefield
AC — Ascending Channel: trend carry; respect higher-lows and ride the lane.
RWE — Rising Wedge: distribution bias; watch the fracture and the retest.
Converging/Diverging Triangles: compression → expansion; stage entries at the edges.
DC — Descending Channel: late down-leg + momentum shift = tactical long.
Structure is the map. Bias is the compass. Your risk plan is the sword.
🤝 Acknowledgments
Original engine & libraries: Trendoscope (legend).
Enhancement layer (UX): transparency, short codes, tooltip system — BK.
Mentor: A.K. — discipline, patience, and clarity. His standard lives in every decision here.
🫡 Give Forward
Don’t be cheap with your knowledge. If my indicators sharpen your edge:
Teach someone how to read formations with discipline.
Share your process, not just screenshots.
Contribute code, context, or courage to those behind you.
A king’s wisdom multiplies the camp. A lion’s courage protects the pride.
🙏 Final Word
“By wise guidance you will wage your war, and victory lies in many counselors.” — Proverbs 24:6
See the array. Choose the strike. Lead with wisdom.
BK AK-Warfare Formations — where formation meets judgment, and judgment meets execution.
Gd bless. 🙏
Trendline Breakout Strategy [KedArc Quant] Description
A single, rule-based system that builds two trendlines from confirmed swing pivots and trades their breakouts, with optional retest, trend-regime gates (EMA / HTF EMA), and ATR-based risk. All parts serve one decision flow: structure → breakout → gated entry → managed risk.
What it does (for traders)
Draws Up line (teal) through the last two Higher Lows and Down line (red) through the last two Lower Highs, then extends them forward.
Long when price breaks above red; Short when price breaks below teal.
Optional Retest entry: after a break, wait for a pullback toward the broken line within an ATR-scaled buffer.
Uses ATR stop and R-multiple target so risk is consistent across symbols/timeframes.
Labels HL1/HL2/LH1/LH2 so non-coders can verify which pivots built each line.
Why these components are combined
Pure breakout systems on trendlines suffer from three practical issues:
False breaks in chop → solved by trend-regime gates (EMA / HTF EMA) that only allow trades aligned with the prevailing trend.
Uneven volatility across markets/timeframes → solved by ATR-based stop/target, normalizing distance so R-multiples are comparable.
First break whipsaws near wedge apices → mitigated by the optional retest rule that demands a pullback/hold before entry.
These modules are not separate indicators with their own signals. They are support roles inside one method.
The pivot engine defines structure, the breakout detector defines signal, the regime gates decide if we’re allowed to take that signal, and the ATR module sizes risk.
Together they make the trendline breakout usable, testable, and explainable.
How it works (mechanism; each component explained)
1) Pivot engine (structure, non-repainting)
Swings are confirmed with ta.pivotlow/high(L, R). A pivot only exists after R bars (no look-ahead), so once plotted, the line built from those pivots will not repaint.
2) Trendline builder (geometry)
Teal line updates when two consecutive pivot lows satisfy HL2.price > HL1.price (and HL2 occurs after HL1).
Red line updates when two consecutive pivot highs satisfy LH2.price < LH1.price.
Lines are extended right and their current value is read every bar via line.get_price().
3) Breakout detector (signal)
On every bar, compute:
crossover(close, redLine) ⇒ Long breakout
crossunder(close, tealLine) ⇒ Short breakdown
4) Regime gates (trend filters, not separate signals)
EMA gate: allow longs only if close > EMA(len), shorts only if close < EMA(len).
HTF EMA gate (optional): same rule on a higher timeframe to avoid fighting the larger trend.
These do not create entries; they simply permit or block the breakout signal.
5) Retest module (optional confirmation)
After a breakout, record the line price. A valid retest occurs if price pulls back within an ATR-scaled buffer toward that broken line and then closes back in the breakout direction.
This reduces first-tick fakeouts.
6) Risk module (position exit)
Initial stop = ATR(len) × atrMult from entry.
Target = tpR × (ATR × atrMult) (e.g., 2R).
This keeps results consistent across instruments/timeframes.
Entries & exits
Long entry
Base: close breaks above red and passes EMA/HTF gates.
Retest (if enabled): after the break, price pulls back near the broken red line (within the ATR buffer) and holds; then enter.
Short entry
Mirror logic with teal (break below & gates), optionally with a retest.
Exit
strategy.exit places ATR stop & R-multiple target automatically.
Optional “flip”: close if the opposite base signal triggers.
How to use it (step-by-step)
Timeframe: 1–15m for intraday, 1–4h for swing.
Start defaults: Pivot L/R = 5, EMA len = 200, ATR len = 14, ATR mult = 2, TP = 2R, Retest = ON.
Tune sensitivity:
Faster lines (more trades): set L/R = 3–4.
Fewer counter-trend trades: enable HTF EMA (e.g., 60-min or Daily).
Visual audit: labels HL1/HL2 & LH1/LH2 show which pivots built each line—verify by eye.
Alerts: use Long breakout, Short breakdown, and Retest alerts to automate.
Originality (why it merits publication)
Trades the visualization: many “auto-trendline” tools only draw lines; this one turns them into testable, alertable rules.
Integrated design: each component has a defined role in the same pipeline—no unrelated indicators bolted together.
Transparent & non-repainting: pivot confirmation removes look-ahead; labels let non-coders understand the setup that produced each signal.
Notes & limitations
Lines update only after pivot confirmation; that lag is intentional to avoid repainting.
Breakouts near an apex can whipsaw; prefer Retest and/or HTF gate in choppy regimes.
Backtests are idealized; forward-test and size risk appropriately.
⚠️ Disclaimer
This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.
Period Separator + Future LinesDescription
This indicator draws vertical separator lines for each selected timeframe (e.g., daily or hourly) and also projects additional separator lines into the future.
It helps traders visually divide the chart into consistent time periods and see upcoming period boundaries in advance.
Features
- Draws vertical lines at the start of each chosen period (daily by default).
- Extends several separator lines into the future so you can anticipate upcoming sessions.
- Fully customizable: color, style (solid/dashed/dotted), line width, and timeframe can be adjusted from the settings.
- Lines are plotted without distorting auto-scaling, so the chart view remains clean.
Use Case
Ideal for intraday and swing traders who want clear visual time markers and the ability to prepare for upcoming trading sessions.
Simple Auto Swing Lines# Simple Auto Swing Lines
## What It Does
This indicator automatically draws horizontal support and resistance lines based on swing highs and lows with line management and touch-based alerts.
## How It Works
**Swing Detection:**
- Uses pivot point analysis to identify significant highs and lows
- Configurable pivot strength determines sensitivity (higher = more significant swings)
- Draws horizontal lines from these swing points extending to current price
**Line Management:**
- Proximity Filter: Removes lines that are too close together to prevent clutter
- Auto-Hide Feature: Lines disappear after price closes beyond them for a set number of candles
- Permanent Clipping: Once a line is crossed for the threshold period, it stays hidden
- Dynamic Updates: Only shows the most relevant recent swing levels
**Touch-Based Alert System:**
- "Swing High touched" - Alerts when price touches resistance lines from any direction
- "Swing Low touched" - Alerts when price touches support lines from any direction
- "Any Swing Level touched" - Combined alert for any swing line interaction
## Key Settings
**Pivot Detection:**
- Pivot Strength (50): Higher values = fewer, more significant swing lines
- Max Lookback Bars (1000): How far back to look for swing points
**Line Appearance:**
- Max Lines (5): Maximum number of swing lines per side (total lines = 2x this number)
- Line Thickness (1-5): Customize line width
- Resistance/Support Colors: Red for highs, green for lows
- Show Labels: Optional swing high/low labels (default: off)
**Display Controls:**
- Proximity Filter (2000 ticks): Minimum distance between lines to prevent clutter
- Candles Before Hide (7): How many consecutive closes beyond a line before permanent removal
ZigZag+4 EMA89 Trend Candles + BUY/SELL SCALPThis script combines ZigZag patterns, EMA89 trend detection, and custom buy/sell scalp signals. It helps identify trend direction and potential entry points in trending markets.
Features:
- ZigZag structure points
- EMA89 as dynamic trend filter
- Buy/Sell scalp markers
- HL/HH swing labels
- Works best on 15m–4h timeframes
VIM (Volume in Money)Volume in Money + MA (Short Numbers & Coloring)
This indicator visualizes the monetary volume traded in each candle, calculated as:
Money Volume
=
Volume
×
Close Price
Money Volume=Volume×Close Price
🔹 Features:
Plots bars representing the money volume (total traded value).
Coloring options:
• Prev Close → Green if the current close is higher than the previous close, Red if lower.
• Candle Direction → Green if the candle is bullish (close > open), Red if bearish (close < open).
Moving Average (default length: 14) applied on the money volume for trend analysis.
Axis values and labels displayed in a shortened format (K, M, B, T) for readability.
📊 This helps traders quickly identify whether large amounts of money flowed into or out of the asset, making it easier to detect unusual activity compared to regular volume indicators.
FXHacker BUY SELL SIGNAL V2“FXHacker BUY SELL SIGNAL V2 marks key Nairobi session blocks and detects liquidity sweeps. Traders can choose between Strict CHoCH (confirmation on structure break) or Immediate Sweep (signal at first sweep). Designed to highlight high-probability reversal zones within important time windows.”
FXHacker Buy Sell Signals - Volume 15min“FXHacker Buy Sell Signals – Volume 15min identifies swing highs and lows, then waits for price retests with high-volume confirmation before generating reversal BUY/SELL signals. Designed to highlight strong turning points while filtering out weak moves.”
Adaptive Log Trend ChannelOne-line Summary / 一句话简介
EN: Adaptive log-scale trend channel using Pearson-optimized regression and deviation bands.
中文:基于皮尔逊优化回归的自适应对数趋势通道,带标准差波动带。
Full Description / 完整介绍
What it does / 功能
EN: This indicator fits a log-linear regression to price and builds a trend channel with ±k·σ deviation bands. It automatically selects the period with the highest Pearson correlation (R), ensuring the channel best matches the dominant market trend.
中文:该指标通过价格的对数线性回归拟合趋势,并在中线上下绘制 ±k·σ 偏差通道。它会自动选择皮尔逊相关系数 (R) 最高的周期,从而保证通道与主要趋势最贴合。
Why it’s useful / 适用价值
EN:
Naturally fits assets with multiplicative growth (crypto, tech stocks).
Adapts dynamically to different market regimes.
Provides CAGR estimates on Daily/Weekly charts for trend strength evaluation.
中文:
自然适用于呈现乘法增长的资产(如加密货币与科技股)。
可动态适应不同的市场阶段。
在日线/周线图上提供 趋势年化收益率 (CAGR),帮助评估趋势强度。
How it works / 工作原理
EN:
Computes log(price) → regression slope & intercept.
Draws a midline (log regression projection).
Upper & lower bands = ±k·σ in log space.
Info panel shows: Auto-Selected Period, Trend Strength (or Pearson’s R), and CAGR.
中文:
对价格取对数 → 计算回归斜率与截距。
绘制 中线(对数回归投影)。
上下轨 = 对数空间中的 ±k·σ。
信息面板显示:自动选择周期、趋势强度(或皮尔逊 R 值)、以及 CAGR 年化收益率。
Key Settings / 主要参数
EN:
Long-Term Mode: Uses extended periods (300–1200).
Deviation Multiplier (k): Controls channel width (default 2.0).
Styles: Colors, line type, and extension.
Panel Options: Toggle auto-period, Pearson’s R, and CAGR.
中文:
长期模式:采用更长周期 (300–1200)。
偏差倍数 (k):控制通道宽度(默认 2.0)。
样式:可设置颜色、线型、延长方式。
信息面板:可开关自动周期、皮尔逊 R、CAGR。
Notes / 注意事项
EN:
CAGR is only available on Daily/Weekly timeframes.
Regression-based tools may repaint as new bars form; treat it as context, not signals.
中文:
CAGR 仅在日线与周线周期可用。
回归类指标在新K线形成时可能重绘,仅用于趋势参考而非交易信号。
AWSA "Level Indicator with ATR" isn't a single, defined indicator but typically refers to a trading strategy or indicator that uses the Average True Range (ATR) to create dynamic levels on a price chart, such as support, resistance, or stop-loss levels. The ATR is a volatility indicator that measures market volatility; when high, it suggests the market has large price swings, and when low, small price swings. By using the ATR value with a multiplier, traders can set price levels that adapt to changing market volatility, providing more objective and dynamic trading signals than fixed-price levels.
BK AK-Flag Formations🏴☠️ Introducing BK AK-Flag Formations — Raise the standard. Drive the line. Continue the assault. 🏴☠️
Built for traders who exploit momentum with discipline: flagpoles, flags, and pennants detected, tagged, and briefed—so you can press advantage instead of hesitating.
🎖️ Full Credit
The pattern engine, detection logic, and architecture are Trendoscope—one of the absolute best coders on TradingView and the original creator of this indicator’s core. I asked for interface upgrades and knew he was deep in other builds, so I forged the add-ons and released them for the community that values them.
My enhancements (on top of Trendoscope):
Label transparency (text + background)
Short-form labels (BF/BeF/BP/BeP/…)
Transparency controls for short-form labels
Hover tooltips with full pattern name + bullish/bearish bias (toggle)
Everything else is Trendoscope. Respect where it’s due.
🧠 What It Does
Locks onto flags and pennants after strong impulses (flagpoles).
Prints clean battlefield tags (BF, BeF, BP, BeP…) so the setup is obvious without burying price.
Mouse-over for the brief: full pattern name + directional bias exactly when you need it.
Multi-zigzag sweep for micro→macro detection, overlap control, bar-ratio verification, max-pattern caps, dark/light aware palette + custom colors.
🧭 Read the Continuation
BF — Bull Flag: strong pole, orderly pullback; look for break and measured move continuity.
BP — Bull Pennant: tight triangle after thrust; expansion confirms carry.
BeF — Bear Flag: weak rallies in a downtrend; break = continuation lower.
BeP — Bear Pennant: compressed pause beneath resistance; release favors trend.
Standards are not decoration—they are orders.
🤝 Acknowledgments
Original engine & libraries: Trendoscope (legend).
Enhancement layer (UX): transparency, short codes, tooltip system — BK.
Mentor: A.K. — clarity, patience, judgment. His discipline guides every choice here.
🫡 Give Forward
Don’t be cheap with your knowledge. If my indicators sharpen your edge:
Teach someone to read structure with discipline.
Share your process, not just screenshots.
Contribute code, context, or courage to those behind you.
Tools are force multipliers. Character decides how they’re used.
🙏 Final Word
“Plans are established by counsel; by wise guidance wage war.” — Proverbs 20:18
Impulse → formation → continuation.
Raise the banner, hold formation, and execute with wisdom.
BK AK-Flag Formations — when the standard rises, the line advances.
Gd bless. 🙏