Specter Trend Cloud [ChartPrime]⯁ OVERVIEW
Specter Trend Cloud is a flexible moving-average–based trend tool that builds a colored “cloud” around market direction and highlights key retest opportunities. Using two adaptive MAs (short vs. long), offset by ATR for volatility adjustment, it shades the background with a gradient cloud that switches color on trend flips. When price pulls back to retest the short MA during an active trend, the script plots diamond markers and extends dotted levels from that retest price. If price later breaks through that level, the extension is terminated—giving traders a clean visual of valid vs. invalid retests.
⯁ KEY FEATURES
Multi-MA Core Engine:
Choose from SMA, EMA, SMMA (RMA), WMA, or VWMA as the base. The indicator tracks both a short-term MA (Length) and a longer twin (2 × Length).
Volatility-Adjusted Offset:
Both MAs are shifted by ATR(200) depending on trend direction—pulling them down in uptrends, up in downtrends—so the cloud reflects realistic breathing room instead of razor-thin bands.
Gradient Trend Cloud:
Between the two shifted MAs, the script fills a shaded region:
• Aqua cloud = bullish trend
• Orange cloud = bearish trend
Gradient intensity increases toward the active edge, providing a visual sense of strength.
Trend Flip Logic:
A flip occurs whenever the short MA crosses above or below the long MA. The cloud instantly changes color and begins tracking the new regime.
Retest Detection:
During an ongoing trend (no flip), if price retests the short MA within a 5-bar “cooldown,” the tool:
• Marks the retest with diamond shapes below/above the bar.
• Draws a dotted horizontal line from the retest price, extending into the future.
Automatic Level Termination:
If price later closes through that dotted level, the line disappears—keeping only active, respected retest levels on your chart.
⯁ HOW IT WORKS (UNDER THE HOOD)
MA Calculations:
ma1 = MA(src, Length), ma2 = MA(src, 2 × Length).
Trend = ma1 > ma2 (bull) or ma1 < ma2 (bear).
ATR shift offsets both ma1 and ma2 by ±ATR depending on trend.
Cloud Fill:
Plots ma1 and ma2 (invisible for long MA). Uses fill() with semi-transparent aqua/orange gradient between the two.
Retest Logic:
• Bullish retest: ta.crossover(low, ma1) while trend = bull.
• Bearish retest: ta.crossunder(high, ma1) while trend = bear.
Only valid if at least 5 bars have passed since last retest.
When triggered, it stores bar index and price, draws diamonds, and extends a dotted line.
Level Clearing:
If current high > retest upper line (bearish case) or low < retest lower line (bullish case), that line is deleted (stops extending).
⯁ USAGE
Use the cloud color as the higher-level trend bias (aqua = long, orange = short).
Look for diamonds + dotted lines as pullback/retest zones where trend continuation may launch.
If a retest level holds and price rebounds, it strengthens confidence in the trend.
If a retest level is broken, treat it as a warning of weakening trend or possible reversal.
Experiment with MA Type (SMA vs. EMA, etc.) to align sensitivity with your asset or timeframe.
Adjust Length for faster flips on low timeframes or smoother signals on higher ones.
⯁ CONCLUSION
Specter Trend Cloud combines trend detection, volatility-adjusted shading, and retest visualization into a single tool. The gradient cloud provides instant clarity on direction, while diamonds and dotted retest levels give you tactical entry/retest zones that self-clean when invalidated. It’s a versatile trend-following and confirmation layer, adaptable across multiple assets and styles.
Bandas e Canais
Guardeer//@version=5
indicator("Guardeer", shorttitle = "Guardeer", 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 (true , "Show swing point" , inline = "1", group = "High and Low" , tooltip = "Display swing point")
show_mtb = input.bool (true , "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 > gl and gc > gc and go > go and gh < math.min(gc, go) and cc
: go < gc and gl < gh and gc < gc and go < go and gl > math.max(gc, go) and cc
pos := 1
"OG" =>
pup := bull ? b.l : gl
pdn := bull ? gh : gh
cdn := bull ? gl > gh and cc : gh < gl and cc
pos := 1
if not na(cdn ) and cdn
cords.unshift(
FVG.new(
na
, na
, bull
? true
Algo MA💎 (V.4.3)Algo MA💎 V.4.3 - Multi-EMA System with Advanced Candle Analysis
**Algo MA💎 V.4.3** is a comprehensive trend analysis system that combines multiple EMA configurations with advanced candle coloring, support/resistance detection, and integrated trade management dashboards. This indicator provides a complete visual trading environment with sophisticated trend identification and portfolio tracking capabilities.
**Core Innovation & Originality**
This system uniquely integrates seven distinct analytical components:
1. **Dual-EMA Signal Engine** - Primary trend detection using 9/21 EMA crossovers with customizable sensitivity
2. **Advanced Candle Classification** - Multi-layer candle coloring with two sensitivity levels (violet/rose) based on ATR calculations
3. **Trend Confirmation System** - Secondary 20/50 EMA trend filter with dynamic cloud visualization
4. **Zero Lag EMA Implementation** - 144-period Zero Lag EMA with directional color coding for reduced lag trend analysis
5. **RSI Extreme Detection** - Overbought (75) and oversold (25) level identification with visual markers
6. **Dynamic Support/Resistance** - Pivot-based support and resistance level calculation with 50-bar lookback
7. **Integrated Trade Management** - Three customizable dashboard tables for real-time portfolio tracking
**System Architecture & Functionality**
**Primary Signal Generation:**
The core system uses a 9-period EMA and 21-period EMA comparison to generate directional bias. When EMA9 > EMA21, the system indicates bullish conditions; when EMA9 < EMA21, it signals bearish conditions. This creates the foundation for all visual elements and trend analysis.
**Advanced Candle Coloring Logic:**
The system employs a sophisticated three-layer candle coloring approach:
- **Green Candles**: EMA9 > EMA21 (bullish trend)
- **Red Candles**: EMA9 < EMA21 (bearish trend)
- **Violet Candles**: EMAs within sensitivity_violet * ATR(14) range (consolidation)
- **Rose Candles**: EMAs within sensitivity_rose * ATR(14) range (tight consolidation)
**Sensitivity-Based Classification:**
Two independent sensitivity parameters allow fine-tuning of consolidation detection:
- **Violet Sensitivity (0.3 default)**: Broader consolidation zones
- **Rose Sensitivity (0.1 default)**: Tighter consolidation zones
**Zero Lag EMA Implementation:**
Uses advanced calculation: `zlema = ema(src + src - src , length)` where lag = floor((length-1)/2). This reduces the inherent lag of traditional EMAs while maintaining smoothness.
**Trend Confirmation Framework:**
The 20/50 EMA system provides trend context with visual cloud fills:
- **Blue Cloud**: 20 EMA > 50 EMA (bullish trend environment)
- **Red Cloud**: 20 EMA < 50 EMA (bearish trend environment)
**Unique Visual Features**
**Multi-Layer Candle System:**
The indicator plots up to four candle layers simultaneously:
1. **Base Candles**: Primary EMA-based trend colors
2. **Violet Consolidation**: ATR-adjusted consolidation detection
3. **Rose Consolidation**: Tighter consolidation identification
4. **Bearish Overlay**: Optional bearish candle highlighting
**Support/Resistance Detection:**
Uses pivot point calculations with 50-bar left and right parameters:
- **Green Lines**: Resistance levels from pivot highs
- **Red Lines**: Support levels from pivot lows
- **Dynamic Updates**: Lines adjust based on price action
**RSI Extreme Markers:**
- **Red Triangles**: First occurrence of RSI > 75 (overbought)
- **Green Triangles**: First occurrence of RSI < 25 (oversold)
**Integrated Dashboard System**
**Trade Management Tables:**
Three independent dashboard tables provide comprehensive trade tracking:
- **Stock Information**: Ticker symbol and trade direction (BUY/SELL)
- **Order Details**: Entry price, stop loss, and take profit levels
- **Position Status**: Real-time trade monitoring with color-coded status
**Dashboard Customization:**
- **Positioning**: Bottom-right, bottom-center, bottom-left placement options
- **Color Coding**: Green for BUY positions, red for SELL positions
- **Manual Entry**: User-customizable fields for trade parameters
**Volume Analysis Integration**
**Volume Oscillator:**
Implements short (5) and long (10) EMA volume comparison:
`osc = 100 * (short_volume_ema - long_volume_ema) / long_volume_ema`
This provides additional confirmation for trend strength and potential reversals.
**Usage Instructions**
**Trend Identification:**
- **Primary Trend**: Monitor 9/21 EMA relationship and candle colors
- **Trend Strength**: Observe Zero Lag EMA color (green=bullish, red=bearish)
- **Trend Context**: Use 20/50 EMA cloud for higher timeframe bias
**Entry Signal Recognition:**
- **Bullish Setup**: Green candles + blue trend cloud + support level test
- **Bearish Setup**: Red candles + red trend cloud + resistance level test
- **Consolidation**: Violet/rose candles indicate ranging conditions
**Risk Management Application:**
- **Support/Resistance**: Use pivot levels for stop placement and targets
- **RSI Extremes**: Monitor overbought/oversold conditions for reversal potential
- **Dashboard Tracking**: Utilize tables for position management
**Advanced Analysis:**
- **Sensitivity Adjustment**: Modify violet/rose parameters for market volatility
- **Multi-Timeframe**: Apply system across different timeframes for confluence
- **Volume Confirmation**: Use volume oscillator for signal validation
**Customization Options**
**EMA Parameters:**
- **Main Flow EMAs**: Adjustable 9/21 period settings
- **Trend EMAs**: Customizable 20/50 period configuration
- **Zero Lag EMA**: Modifiable 144-period length
**Visual Settings:**
- **Candle Display**: Toggle bearish candle overlay
- **Trend Visualization**: Show/hide trend cloud and EMAs
- **Support/Resistance**: Enable/disable pivot level display
- **RSI Markers**: Control overbought/oversold triangle display
**Dashboard Configuration:**
- **Table Display**: Independent control for three dashboard tables
- **Trade Details**: Customizable entry, stop, and target fields
- **Position Status**: Manual BUY/SELL/neutral designation
**Alert System**
Built-in alert conditions for:
- **Bullish Signal**: EMA9 crosses above EMA21
- **Bearish Signal**: EMA9 crosses below EMA21
**Important Considerations**
This system works optimally in trending markets with clear directional bias. During consolidation periods, focus on violet/rose candle identification and range-bound strategies. The multiple EMA layers provide comprehensive trend analysis but may generate conflicting signals during choppy conditions.
The dashboard tables serve as trade management tools but require manual input for position tracking. The system combines established EMA techniques with original sensitivity-based consolidation detection and advanced visual presentation methods.
**Disclaimer**: This indicator is designed for educational and analytical purposes. The dashboard tables are for position tracking only and do not execute trades automatically. Past performance does not guarantee future results. Always implement proper risk management and consider multiple confirmation methods before making trading decisions.
Adaptive Pivot Zones█ OVERVIEW
The "Adaptive Pivot Zones" indicator is a versatile tool designed to identify and visualize key pivot levels directly on the price chart. By detecting pivot highs and lows, the indicator calculates dynamic support and resistance zones based on user-defined levels (default: 0.382, 0.5, 0.618). These zones adapt to market volatility, providing traders with clear visual cues for potential reversal or continuation points. The indicator offers extensive customization options, such as adjusting colors, smoothing lines, and setting fill transparency, making it highly adaptable to various trading styles.
█ CONCEPTS
The "Adaptive Pivot Zones" indicator simplifies the identification of significant price levels by plotting three dynamic pivot lines, which can be smoothed to reduce market noise. The indicator dynamically changes the colors of the lines and fill zones based on price action, using bullish, bearish, or neutral colors to reflect market sentiment.
█ CALCULATIONS
The indicator relies on the following calculations:
- Pivot Detection: Pivot highs (ta.pivothigh) and pivot lows (ta.pivotlow) are identified using a user-defined pivot length (default: 10). Pivots represent significant price peaks and troughs. Higher pivot length values produce more stable levels but introduce a delay equal to the set value. For more aggressive strategies, the pivot length can be reduced.
- Pivot Levels: When both a pivot high and low are detected, the range between them is calculated (rng = drHigh - drLow). Three pivot levels are computed as:
Line 1: drLow + rng * pivotLevel1
Line 2: drLow + rng * pivotLevel2
Line 3: drLow + rng * pivotLevel3
- Smoothing: Pivot lines can be smoothed using a simple moving average (SMA) with a user-defined smoothing length (default: 1) to reduce noise and improve readability.
- Color Logic: Lines and fill zones are colored based on the price position relative to the pivot zones:
If the price is below the lowest pivot line, a bearish color is used (default: red).
If the price is above the highest pivot line, a bullish color is used (default: green).
If the price is within the pivot zones and the neutral color option is enabled, a neutral color is used (default: gray); otherwise, the previous color is retained.
- Fill Zones: The areas between pivot lines are filled with a user-defined transparency level (default: 80) to visually highlight support and resistance zones.
█ INDICATOR FEATURES
- Dynamic Pivot Lines: Three adaptive pivot lines (default levels: 0.382, 0.5, 0.618) are plotted on the price chart, adjusting to market volatility.
- Smoothing: User-defined smoothing length (default: 1) for pivot lines to reduce noise and enhance signal clarity.
- Dynamic Coloring: Lines and fill zones change color based on price action (bullish, bearish, or neutral when the price moves within the zone), reflecting market sentiment.
- Fill Zones: Transparent fills between pivot lines to visually highlight support and resistance zones.
- Customization: Options to adjust pivot length, pivot levels, smoothing, colors, transparency, and enable/disable neutral color logic.
█ HOW TO SET UP THE INDICATOR
- Add the "Adaptive Pivot Zones" indicator to your TradingView chart.
- Configure parameters in the settings, such as pivot length, pivot levels, smoothing length, and colors, to align with your trading strategy. Without smoothing, lines behave like levels; with smoothing, they act like bands. All three levels can be set to the same value to obtain a single level or a line behaving like a moving average derived from pivots.
- Enable or disable the neutral color option (for prices moving within the zone) and adjust fill transparency for optimal visualization.
- Adjust line thickness and style in the "Style" section to improve chart readability.
Example of bands – lines behave like support/resistance zones.
Example of a moving average derived from pivots – line behaves like a pivot-based MA.
█ HOW TO USE
Add the indicator to your chart, adjust the settings, and observe price interactions with the pivot lines and zones to identify potential trading opportunities. Key signals include:
- Price Interaction with Pivot Lines: When the price approaches or crosses a pivot line, it may indicate a potential support or resistance level. A bounce from a pivot line could signal a reversal, while a breakout might suggest trend continuation.
- Zone-Based Signals and Trend Line Usage: Price movement within or outside the filled zones can indicate market sentiment. Price below the lowest pivot line suggests bearish momentum, price above the highest pivot line suggests bullish momentum, and price within the zones may indicate consolidation. With higher pivot length values, the indicator can be used as a trend line, particularly during clear market movements.
- Color Changes: Shifts in line and fill colors (bullish, bearish, or neutral) provide visual cues about changing market conditions.
- Confirmation with Other Tools: Combine the indicator with tools like RSI or Bollinger Bands to validate signals and improve trade accuracy. For example, a buy signal from RSI in the oversold zone combined with a bounce from the lowest pivot line may indicate a strong entry point.
BOCS Adaptive🚀 BOCS Adaptive - Advanced Dynamic Volatility Breakout Channel System
Enhanced version of AlgoAlpha's Smart Money Breakout Channels with adaptive ATR-based risk management for professional-grade trading signals.
📜 CREDITS & ATTRIBUTION:
This indicator is based on the original "Smart Money Breakout Channels" by AlgoAlpha (). Full credit goes to AlgoAlpha for the innovative breakout channel detection methodology. This enhanced version adds adaptive ATR-based TP/SL functionality and advanced volume analysis features.
🔬 THE BOCS METHODOLOGY EXPLAINED:
What is BOCS?
BOCS (Breakout Channel System) is AlgoAlpha's sophisticated algorithm that identifies high-probability breakout opportunities by analyzing normalized price volatility patterns. Unlike traditional support/resistance methods, BOCS uses mathematical normalization to detect when markets are consolidating before explosive moves.
📊 HOW THE CHANNEL DETECTION WORKS (Original AlgoAlpha Method):
Step 1: Price Normalization
Calculates the highest high and lowest low over a specified period (default 100 bars)
Normalizes current price position within this range: (close - lowest) / (highest - lowest)
This creates a 0-1 scale that works across all markets and timeframes
Step 2: Volatility Analysis
Applies standard deviation to the normalized price over 14 periods
Identifies volatility peaks and troughs using specialized algorithms
Tracks volatility cycles to predict consolidation phases
Step 3: Channel Formation
Detects when volatility crosses from high to low (consolidation begins)
Creates dynamic channels using the highest/lowest points during consolidation
Channels automatically expand/contract based on price action
Minimum 10-bar duration ensures meaningful consolidation patterns
Step 4: Breakout Detection
Strong Closes Mode: Requires >50% of candle body outside channel (reduces false signals from wicks)
Any Touch Mode: Triggers on any price movement outside channel boundaries
Volume confirmation analysis validates breakout strength
🆕 ENHANCED FEATURES (This Version):
⚡ Adaptive ATR Risk Management:
Revolutionary Volatility-Based TP/SL System:
Traditional fixed pip/tick stops don't account for changing market conditions. This enhanced version adds ATR (Average True Range) multipliers to create dynamic TP/SL levels that automatically adjust to current volatility.
ATR Calculation Process:
Select any timeframe for ATR source (1min, 5min, 15min, etc.)
Uses customizable period length (default 14) for smoothing
Calculates: TP Distance = ATR × Multiplier
Updates continuously as market volatility changes
Example Setup:
Chart: 5-minute NQ futures
ATR Source: 1-minute timeframe
Current 1min ATR: 4.36 points
TP1 Multiplier: 2.0 → TP1 = 8.72 points from entry
TP2 Multiplier: 3.5 → TP2 = 15.26 points from entry
SL Multiplier: 1.0 → SL = 4.36 points from entry
📈 ENHANCED VOLUME ANALYSIS SYSTEM:
Three Advanced Volume Modes (Enhanced from Original):
1. Volume Mode:
Displays total volume relative to 20-period moving average
Visual transparency indicates volume strength
Helps identify accumulation/distribution phases
2. Comparison Mode:
Separates up volume (green) vs down volume (red)
Shows buying vs selling pressure within channels
Critical for breakout direction bias
3. Delta Mode:
Calculates net volume delta (up volume - down volume)
Positive delta = buying pressure (above midline)
Negative delta = selling pressure (below midline)
Uses multi-timeframe data for granular analysis
🎯 VOLUME CONFIRMATION ALGORITHM (Enhanced):
Breakout Validation System:
Compares breakout volume to 20-period average
CONFIRMED: Volume >120% of average (strong breakout)
WEAK: Volume 80-120% of average (proceed with caution)
FAILED: Volume <80% of average (likely false breakout)
Volume Gauge Feature (New):
Real-time volume delta visualization
Color-coded pressure indicator (red to green spectrum)
Shows current positioning within high/low volume range
Updates continuously during active channels
📊 COMPREHENSIVE TRADE MONITORING (Enhanced):
Real-Time Analysis Table:
Trade status and direction
Channel formation status
Current ATR value and timeframe
Calculated TP/SL distances with multipliers
Last breakout analysis with volume confirmation
Current vs average volume comparison
Volume strength rating (Very High/High/Normal/Low)
🔔 INTELLIGENT ALERT SYSTEM (Enhanced):
Six Alert Types:
New Channel Formation - Consolidation pattern detected
Bullish Breakout - Upward channel break with entry price
Bearish Breakout - Downward channel break with entry price
Take Profit 1 Hit - First target reached (New)
Take Profit 2 Hit - Second target reached (New)
Stop Loss Hit - Risk management triggered (New)
🎨 VISUAL FEATURES (Enhanced):
Channel Visualization (Original AlgoAlpha Design):
Semi-transparent main channel box
Colored upper/lower zones (red=resistance, green=support)
Dashed center line for reference
Volume bars within channels
Real-time volume gauge (new)
TP/SL Display (New Enhancement):
White entry line with price label
Green TP lines with distance calculations
Red SL line with distance calculation
Customizable line lengths and colors
Shows both price levels AND point distances
⚙️ ADVANCED CUSTOMIZATION (Enhanced):
Original AlgoAlpha Settings:
Nested channels (multiple overlapping) or single channel mode
Strong closes only vs any touch breakouts
Normalization and detection lengths
Volume analysis timeframe selection
New ATR Risk Management Settings:
Independent ATR timeframe selection
Customizable ATR calculation period
Separate multipliers for TP1, TP2, and SL
Toggle TP2 on/off as needed
Enhanced Display Options:
Four table positions with offset controls
Three table sizes (Small/Normal/Large)
Volume text sizing and positioning
Complete color customization
Show/hide individual components
📈 OPTIMAL USE CASES:
Scalping (1-5 minute charts):
Use 1-minute ATR for responsive risk management
Enable strong closes mode for cleaner signals
Monitor volume confirmation closely
Day Trading (5-30 minute charts):
Use 5-minute ATR for balanced approach
Enable nested channels for multiple setups
Focus on volume delta for direction bias
Swing Trading (1-4 hour charts):
Use 15-30 minute ATR for stable levels
Longer detection periods for significant channels
Emphasize volume confirmation for major moves
📊 COMPATIBLE MARKETS:
✅ Forex pairs (EUR/USD, GBP/USD, USD/JPY, etc.)
✅ Stock indices (SPY, QQQ, IWM, DIA)
✅ Futures (ES, NQ, YM, RTY, CL, GC)
✅ Individual stocks (AAPL, TSLA, GOOGL, etc.)
✅ Cryptocurrencies (BTC, ETH, altcoins)
✅ Commodities (Gold, Silver, Oil, etc.)
🙏 ACKNOWLEDGMENTS:
Special thanks to AlgoAlpha for creating the original Smart Money Breakout Channels indicator and sharing it with the TradingView community. Their innovative approach to breakout detection formed the foundation for this enhanced version. Please support the original creator by checking out their other excellent indicators.
⚠️ RISK DISCLAIMER:
This indicator is designed for educational and analytical purposes only. Trading involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. The BOCS Adaptive system, while sophisticated, should be used as part of a comprehensive trading strategy that includes proper risk management, position sizing, and market analysis. Always conduct your own due diligence and consider consulting with a qualified financial advisor before making trading decisions. No system can guarantee profitable trades, and users should never risk more than they can afford to lose.
TMA and Oracle MoveCombined view of both TMA indicator and Oracle Move indicator. This results in more reliable prediction of valuable Entry and Exit condition.
Custom High and Low (W,D,4,1)Custom High and Low (W,D,4,1)
can choose Weekly Daily 4h 1hr Previous High and Low.
Stochastic Power SwingStochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................Stochastic Power Swing............................................................................
CointégrationThis Pine Script v6 indicator approximates cointegration between ES and NQ futures by calculating a dynamic beta (hedge ratio) using manual covariance and variance on closing prices over a user-defined lookback period. It computes a mean-reverting spread as ES - (beta * NQ), then normalizes it into a Z-score for divergence detection. The script plots the Z-score with customizable thresholds and triggers alerts for potential trades, like long ES/short NQ when Z-score drops below -2. Add it to an ES1! or NQ1! chart for visualization, but backtest thoroughly as it's not a full statistical test.
Cumulative Buy/Sell — with HTF Confirmation ArrowsOrange line = HTF Delta (15m default).
• Blue line = Chart Delta (5m default).
• Green arrow ↑ = Buyers confirmed (both chart + HTF Delta positive).
• Red arrow ↓ = Sellers confirmed (both chart + HTF Delta negative).
This makes the arrows appear only when both timeframes agree, which removes a lot of false noise.
Moving Average Channel with Slope Coloring - 55 EMAA simple moving average channel using the 55 EMA
Simple for simple people.. lets go!!!!
Buy & Sell by AnupamKafleThis indicator provides Buy and Sell signals based on a combination of classic technical analysis tools: EMA Crossovers, RSI, MACD, and optional Bollinger Bands.
✅ Buy signals are shown as green arrows below bars
✅ Sell signals are shown as red arrows above bars
📊 Logic Overview:
EMA Crossover: Fast EMA crossing over the Slow EMA = Bullish signal
RSI Filter: RSI below oversold threshold = Buy condition, above overbought = Sell condition
MACD Filter: MACD line crossing above Signal line = Buy, crossing below = Sell
Bollinger Bands (optional): Buy when price breaks below lower band, Sell when price breaks above upper band
All filters can be turned on or off individually to customize the signal conditions to your strategy.
⚙️ Settings Include:
Enable/Disable each indicator (EMA, RSI, MACD, BB)
Custom lengths for EMA, RSI, MACD, and BB
Adjustable RSI thresholds and Bollinger Band deviation
🔔 Alerts:
Built-in alert conditions for Buy and Sell signals allow you to set up real-time notifications.
S&P500 Net Issues Block 2Description:
This indicator calculates and plots net advancers minus decliners for 13 predefined blocks of S&P 500 stocks. Each block represents a sector or a selected subset of stocks.
Features:
Shows net issues (advancers – decliners) for each block separately.
13 blocks plotted with distinct colors for easy identification.
Fully compatible with 1-minute, intraday, or higher timeframe charts.
Ideal for identifying sector momentum and market breadth trends.
Can be used standalone or combined with other indicators such as market indices (e.g., S&P 500 futures or TICK).
Usage:
Green/red/blue/orange lines represent different blocks; positive values indicate more advancing stocks than declining, negative values indicate more declining stocks.
Best viewed on intraday charts for short-term market breadth analysis.
Disclaimer:
This indicator is for educational and analytical purposes only. Not a buy/sell signal. Use proper risk management and verify data before trading.
Ross-Style Momentum — StudyRoss-Style Momentum — Study
This indicator is designed to identify high-probability breakout setups inspired by Ross Cameron’s momentum trading style. It combines multiple filters and confirmations to highlight strong long opportunities, while giving traders full control over visibility and thresholds.
Core Features:
Price Range Filter: Only signals when price is between a defined min/max range (ideal for small-cap momentum).
VWAP Alignment: Ensures trades are biased to the long side only when price is above VWAP (optional).
MACD Momentum Check: Requires a fresh MACD bullish crossover within a user-defined lookback.
RSI & ATR Filters: Prevents chasing overextended moves (RSI ceiling) and ignores low-volatility tickers (ATR floor).
Relative Volume (RVOL): Confirms unusual trading activity with minimum RVOL thresholds.
Breakout & Volume Spike: Detects flat-top/base breakouts with volume expansion.
Higher Lows Option: Optional requirement for a constructive higher-lows pattern before breakout.
Float Filter: User-provided float value to avoid large-float stocks if desired.
Visual Tools:
Optional VWAP, Base High/Low, and RVOL plots.
Long setup markers (green labels under qualifying bars).
Background highlight when all conditions align.
Real-time dashboard (top-right) showing pass/fail status of each filter.
Alerts:
Triggers an alert when a full long setup condition is met.
This study does not place trades; it is intended as a signal and confirmation tool for discretionary traders who want to visually validate Ross-style momentum breakout conditions.
16H Bollinger BandsThis indicator plots Bollinger Bands based on the 16-hour timeframe, regardless of the chart’s current timeframe.
📌 Features:
Uses a higher-timeframe (16H / 960 minutes) SMA as the basis
Upper and lower bands calculated with standard deviation
Adjustable parameters: length, standard deviation multiplier, and source
Works even when applied on lower timeframes (e.g. 1H, 15m), allowing you to overlay higher-timeframe volatility zones on intraday charts
📌 Use cases:
Identify major support and resistance zones from a higher timeframe
Filter out market noise by relying on broader 16H volatility structure
Combine with lower-timeframe signals for more accurate entries and exits
HMA Bollinger BandsThis script is Bollinger Bands with Hull Moving average as a basis. Users using HMA will benefit from this
1H FVG Zones Only (5m & 1h)new uses trend anaylosis. takes 15 min chart and breaks into 1hr chart fvg gaps
Multi-WMA Trend ZonesMulti-WMA Trend Zones is a custom indicator that visually highlights when multiple Weighted Moving Averages (WMAs) are in perfect alignment.
It shades the area between the shortest and longest selected WMAs with different colours for bullish, bearish, and neutral states.
How It Works:
The indicator allows you to plot up to 5 WMAs (default: 10, 20, 50, 100, 200).
You choose which WMAs to use (e.g., just 2, 3, 4, or all 5).
The script automatically checks the order of the selected WMAs:
Bullish Zone: when WMAs are in strict bullish alignment (shorter > longer).
Bearish Zone: when WMAs are in strict bearish alignment (shorter < longer).
Neutral Zone: when WMAs are jumbled / not aligned.
The shaded area is drawn between the shortest and longest active WMAs, giving a clean “zone” effect.
Customization:
WMA Periods: choose custom lengths for up to 5 WMAs.
WMA Selection: toggle which WMAs you want active.
Colours: customize shading for Bullish, Bearish, and Neutral zones (with transparency).
Usage
Quickly identify strong trending conditions when all selected WMAs are aligned.
Spot trend reversals when shading switches from bullish to bearish.
Use the neutral zone to stay cautious when price action is choppy or WMAs are out of sync.
Works well on any timeframe and for any asset class (stocks, crypto, forex, futures).
Disclaimer: This indicator is a technical analysis tool. It should not be considered financial advice. Always combine with your own research and risk management before trading.
MAX TRADEAuto signal generation with high accuracy
Risk/Reward calculation built-in
Stop Loss and Take Profit levels displayed on the chart
Customizable sensitivity and settings
Works on Forex, Gold (XAU/USD), Crypto, and other assets
AKASH.SKYLINETHIS INDICATOR HAS FOUR LINE....lower is green, middle is red and higher is blue.
AND pink is segregator line.
simply when price is above segregator line(PINK LINE) generally we go for long trade....and vise versa.
when we set, we have to take the long trade .....
then find the opportunity of long trade condition.......
CONDITION FOR LONG:--
when the red line crossed above the blue line....this is the signal alert for u...
then when the green line crossed above the red line.....
ur uptrend is starting......
ALSO when the price crossed above the three lines(green,red,blue)in a single candle and clossed above.
go for long trade ....and ENJOY THE GOODNESS OF INDICATION.
CONDITION FOR short:--
vise versa of above long condition scripts.
Srujan Naidu Triple Consensus SuperTrendUse the effect of three super trends combined.
Combine with other indicators to find out strength of the market movement/