High/Low Targets - Abu Aydسكربت
//@version=5
indicator("High/Low Targets - Abu Ayd", overlay = true, max_lines_count = 200, ع")
widthLow = input.int(2, "سماكة خط القاع", minval=1, maxval=5)
colorHigh = input.color(color.purple, "لون خط القمة")
widthHigh = input.int(2, "سماكة خط القمة", minval=1, maxval=5)
colorUp = input.color(color.green, "لون أهداف الصعود")
widthUp = input.int(1, "سماكة أهداف الصعود", minval=1, maxval=5)
colorDown = input.color(color.red, "لون أهداف الهبوط")
widthDown = input.int(1, "سماكة أهداف الهبوط", minval=1, maxval=5)
//========= مكان كتابة الأهداف =========//
labelPosition = input.string("يمين", "مكان كتابة الأهداف", options= )
offsetBars = input.int(5, "المسافة أفقياً للكتابة", minval=1, maxval=50)
//========= عدد الأهداف =========//
targetsUpNum = input.int(5, "عدد أهداف الصعود", minval=1, maxval=20)
targetsDownNum = input.int(5, "عدد أهداف الهبوط", minval=1, maxval=20)
//========= حساب القاع والقمة =========//
srcLow = request.security(syminfo.tickerid, tf == "" ? timeframe.period : tf, ta.lowest(low, lookback))
srcHigh = request.security(syminfo.tickerid, tf == "" ? timeframe.period : tf, ta.highest(high, lookback))
// قاع أمس
yLow = request.security(syminfo.tickerid, "D", low )
yHigh = request.security(syminfo.tickerid, "D", high )
yOpen = request.security(syminfo.tickerid, "D", open )
yClose = request.security(syminfo.tickerid, "D", close )
yBodyLow = math.min(yOpen, yClose)
yLowerWick = yBodyLow - yLow
yRange = yHigh - yLow
isValidYesterdayLow = yLowerWick > yRange * wickRatio
// اختيار القاع
lowPoint =
mode == "Manual" ? manualLow :
(mode == "Auto" and useYesterdayLow and isValidYesterdayLow) ? yLow :
srcLow
// اختيار القمة
highPoint = mode == "Auto" ? srcHigh : manualHigh
//========= دالة لحساب مكان الليبل =========//
f_getXoffset(_pos) =>
_pos == "يمين" ? bar_index + offsetBars : _pos == "يسار" ? bar_index - offsetBars : bar_index
//========= أهداف القاع =========//
if mode == "Manual" or (mode == "Auto" and showLowAuto and not na(lowPoint))
// أهداف فوق القاع
for i = 1 to targetsUpNum
levelUp = lowPoint + stepUp * i
line.new(bar_index, levelUp, bar_index+1, levelUp, color=colorUp, width=widthUp, extend=extend.right)
if barstate.islast
label.new(f_getXoffset(labelPosition), levelUp, "🎯 " + str.tostring(levelUp),
textcolor=color.white, color=colorUp, style=label.style_label_left,
xloc=xloc.bar_index, yloc=yloc.price)
// أهداف تحت القاع إذا اخترنا "فوق وتحت"
if lowTargetsMode == "فوق وتحت"
for i = 1 to targetsDownNum
levelDownFromLow = lowPoint - stepDown * i
line.new(bar_index, levelDownFromLow, bar_index+1, levelDownFromLow, color=colorDown, width=widthDown, extend=extend.right)
if barstate.islast
label.new(f_getXoffset(labelPosition), levelDownFromLow, "🎯 " + str.tostring(levelDownFromLow),
textcolor=color.white, color=colorDown, style=label.style_label_left,
xloc=xloc.bar_index, yloc=yloc.price)
//========= أهداف القمة =========//
if mode == "Manual" or (mode == "Auto" and showHighAuto)
Genişlik Göstergeleri
Price Action Concepts [RUDYINDICATOR]/// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © RUDYBANK INDICATOR - formerly know as RUDY INDICATOR
//@version=5
indicator("Price Action Concepts ", shorttitle = "RUDYINDICATOR-V1
- Price Action RUDYINDICATOR ", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100)
//-----------------------------------------------------------------------------{
//Boolean set
//-----------------------------------------------------------------------------{
s_BOS = 0
s_CHoCH = 1
i_BOS = 2
i_CHoCH = 3
i_pp_CHoCH = 4
green_candle = 5
red_candle = 6
s_CHoCHP = 7
i_CHoCHP = 8
boolean =
array.from(
false
, false
, false
, false
, false
, false
, false
, false
, false
)
//-----------------------------------------------------------------------------{
// User inputs
//-----------------------------------------------------------------------------{
show_swing_ms = input.string ("All" , "Swing " , inline = "1", group = "MARKET STRUCTURE" , options = )
show_internal_ms = input.string ("All" , "Internal " , inline = "2", group = "MARKET STRUCTURE" , options = )
internal_r_lookback = input.int (5 , "" , inline = "2", group = "MARKET STRUCTURE" , minval = 2)
swing_r_lookback = input.int (50 , "" , inline = "1", group = "MARKET STRUCTURE" , minval = 2)
ms_mode = input.string ("Manual" , "Market Structure Mode" , inline = "a", group = "MARKET STRUCTURE" , tooltip = " Use selected lenght Use automatic lenght" ,options = )
show_mtf_str = input.bool (true , "MTF Scanner" , inline = "9", group = "MARKET STRUCTURE" , tooltip = "Display Multi-Timeframe Market Structure Trend Directions. Green = Bullish. Red = Bearish")
show_eql = input.bool (false , "Show EQH/EQL" , inline = "6", group = "MARKET STRUCTURE")
plotcandle_bool = input.bool (false , "Plotcandle" , inline = "3", group = "MARKET STRUCTURE" , tooltip = "Displays a cleaner colored candlestick chart in place of the default candles. (requires hiding the current ticker candles)")
barcolor_bool = input.bool (false , "Bar Color" , inline = "4", group = "MARKET STRUCTURE" , tooltip = "Color the candle bodies according to market strucutre trend")
i_ms_up_BOS = input.color (#089981 , "" , inline = "2", group = "MARKET STRUCTURE")
i_ms_dn_BOS = input.color (#f23645 , "" , inline = "2", group = "MARKET STRUCTURE")
s_ms_up_BOS = input.color (#089981 , "" , inline = "1", group = "MARKET STRUCTURE")
s_ms_dn_BOS = input.color (#f23645 , "" , inline = "1", group = "MARKET STRUCTURE")
lvl_daily = input.bool (false , "Day " , inline = "1", group = "HIGHS & LOWS MTF")
lvl_weekly = input.bool (false , "Week " , inline = "2", group = "HIGHS & LOWS MTF")
lvl_monthly = input.bool (false , "Month" , inline = "3", group = "HIGHS & LOWS MTF")
lvl_yearly = input.bool (false , "Year " , inline = "4", group = "HIGHS & LOWS MTF")
css_d = input.color (color.blue , "" , inline = "1", group = "HIGHS & LOWS MTF")
css_w = input.color (color.blue , "" , inline = "2", group = "HIGHS & LOWS MTF")
css_m = input.color (color.blue , "" , inline = "3", group = "HIGHS & LOWS MTF")
css_y = input.color (color.blue , "" , inline = "4", group = "HIGHS & LOWS MTF")
s_d = input.string ('⎯⎯⎯' , '' , inline = '1', group = 'HIGHS & LOWS MTF' , options = )
s_w = input.string ('⎯⎯⎯' , '' , inline = '2', group = 'HIGHS & LOWS MTF' , options = )
s_m = input.string ('⎯⎯⎯' , '' , inline = '3', group = 'HIGHS & LOWS MTF' , options = )
s_y = input.string ('⎯⎯⎯' , '' , inline = '4', group = 'HIGHS & LOWS MTF' , options = )
ob_show = input.bool (true , "Show Last " , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volumetric order blocks on the chart Ammount of volumetric order blocks to show")
ob_num = input.int (5 , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Orderblocks number", minval = 1, maxval = 10)
ob_metrics_show = input.bool (true , "Internal Buy/Sell Activity" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volume metrics that have formed the orderblock")
css_metric_up = input.color (color.new(#089981, 50) , " " , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
css_metric_dn = input.color (color.new(#f23645 , 50) , "" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
ob_swings = input.bool (false , "Swing Order Blocks" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display swing volumetric order blocks")
css_swing_up = input.color (color.new(color.gray , 90) , " " , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
css_swing_dn = input.color (color.new(color.silver, 90) , "" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
ob_filter = input.string ("None" , "Filtering " , inline = "d", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Filter out volumetric order blocks by BOS/CHoCH/CHoCH+", options = )
ob_mitigation = input.string ("Absolute" , "Mitigation " , inline = "4", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Trigger to remove volumetric order blocks", options = )
ob_pos = input.string ("Precise" , "Positioning " , inline = "k", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Position of the Order Block Cover the whole candle Cover half candle Adjust to volatility Same as Accurate but more precise", options = )
use_grayscale = input.bool (false , "Grayscale" , inline = "6", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Use gray as basic order blocks color")
use_show_metric = input.bool (true , "Show Metrics" , inline = "7", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show volume associated with the orderblock and his relevance")
use_middle_line = input.bool (true , "Show Middle-Line" , inline = "8", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show mid-line order blocks")
use_overlap = input.bool (true , "Hide Overlap" , inline = "9", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Hide overlapping order blocks")
use_overlap_method = input.string ("Previous" , "Overlap Method " , inline = "Z", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = " Preserve the most recent volumetric order blocks Preserve the previous volumetric order blocks", options = )
ob_bull_css = input.color (color.new(#089981 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
ob_bear_css = input.color (color.new(#f23645 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
show_acc_dist_zone = input.bool (false , "" , inline = "1", group = "Accumulation And Distribution")
zone_mode = input.string ("Fast" , "" , inline = "1", group = "Accumulation And Distribution" , tooltip = " Find small zone pattern formation Find bigger zone pattern formation" ,options = )
acc_css = input.color (color.new(#089981 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
dist_css = input.color (color.new(#f23645 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
show_lbl = input.bool (false , "Show swing point" , inline = "1", group = "High and Low" , tooltip = "Display swing point")
show_mtb = input.bool (false , "Show High/Low/Equilibrium" , inline = "2", group = "High and Low" , tooltip = "Display Strong/Weak High And Low and Equilibrium")
toplvl = input.color (color.red , "Premium Zone " , inline = "3", group = "High and Low")
midlvl = input.color (color.gray , "Equilibrium Zone" , inline = "4", group = "High and Low")
btmlvl = input.color (#089981 , "Discount Zone " , inline = "5", group = "High and Low")
fvg_enable = input.bool (false , " " , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap")
what_fvg = input.string ("FVG" , "" , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap", options = )
fvg_num = input.int (5 , "Show Last " , inline = "1a", group = "FAIR VALUE GAP" , tooltip = "Number of fvg to show")
fvg_upcss = input.color (color.new(#089981, 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_dncss = input.color (color.new(color.red , 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_extend = input.int (10 , "Extend FVG" , inline = "2", group = "FAIR VALUE GAP" , tooltip = "Extend the display of the FVG.")
fvg_src = input.string ("Close" , "Mitigation " , inline = "3", group = "FAIR VALUE GAP" , tooltip = " Use the close of the body as trigger Use the extreme point of the body as trigger", options = )
fvg_tf = input.timeframe ("" , "Timeframe " , inline = "4", group = "FAIR VALUE GAP" , tooltip = "Timeframe of the fair value gap")
t = color.t (ob_bull_css)
invcol = color.new (color.white , 100)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - UDT }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
type bar
float o = open
float c = close
float h = high
float l = low
float v = volume
int n = bar_index
int t = time
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type FVG
box box
line ln
bool bull
float top
float btm
int left
int right
type ms
float p
int n
float l
type msDraw
int n
float p
color css
string txt
bool bull
type obC
float top
float btm
int left
float avg
float dV
float cV
int wM
int blVP
int brVP
int dir
float h
float l
int n
type obD
box ob
box eOB
box blB
box brB
line mL
type zone
chart.point points
float p
int c
int t
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type ehl
float pt
int t
float pb
int b
type pattern
string found = "None"
bool isfound = false
int period = 0
bool bull = false
type alerts
bool chochswing = false
bool chochplusswing = false
bool swingbos = false
bool chochplus = false
bool choch = false
bool bos = false
bool equal = false
bool ob = false
bool swingob = false
bool zone = false
bool fvg = false
bool obtouch = false
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - General Setup }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
bar b = bar.new()
var pattern p = pattern.new()
alerts blalert = alerts.new()
alerts bralert = alerts.new()
if p.isfound
p.period += 1
if p.period == 50
p.period := 0
p.found := "None"
p.isfound := false
p.bull := na
switch
b.c > b.o => boolean.set(green_candle, true)
b.c < b.o => boolean.set(red_candle , true)
f_zscore(src, lookback) =>
(src - ta.sma(src, lookback)) / ta.stdev(src, lookback)
var int iLen = internal_r_lookback
var int sLen = swing_r_lookback
vv = f_zscore(((close - close ) / close ) * 100,iLen)
if ms_mode == "Dynamic"
switch
vv >= 1.5 or vv <= -1.5 => iLen := 10
vv >= 1.6 or vv <= -1.6 => iLen := 9
vv >= 1.7 or vv <= -1.7 => iLen := 8
vv >= 1.8 or vv <= -1.8 => iLen := 7
vv >= 1.9 or vv <= -1.9 => iLen := 6
vv >= 2.0 or vv <= -2.0 => iLen := 5
=> iLen
var msline = array.new(0)
iH = ta.pivothigh(high, iLen, iLen)
sH = ta.pivothigh(high, sLen, sLen)
iL = ta.pivotlow (low , iLen, iLen)
sL = ta.pivotlow (low , sLen, sLen)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - ARRAYS }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
hl () =>
= request.security(syminfo.tickerid , 'D' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'W' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'M' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , '12M', hl() , lookahead = barmerge.lookahead_on)
lstyle(style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
mtfphl(h, l ,tf ,css, pdhl_style) =>
var line hl = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var line ll = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var label lbl = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}L', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
var label hlb = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}H', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
hy = ta.valuewhen(h != h , h , 1)
hx = ta.valuewhen(h == high , time , 1)
ly = ta.valuewhen(l != l , l , 1)
lx = ta.valuewhen(l == low , time , 1)
if barstate.islast
extension = time + (time - time ) * 50
line.set_xy1(hl , hx , hy)
line.set_xy2(hl , extension , hy)
label.set_xy(hlb, extension , hy)
line.set_xy1(ll , lx , ly)
line.set_xy2(ll , extension , ly)
label.set_xy(lbl, extension , ly)
if lvl_daily
mtfphl(pdh , pdl , 'D' , css_d, s_d)
if lvl_weekly
mtfphl(pwh , pwl , 'W' , css_w, s_w)
if lvl_monthly
mtfphl(pmh , pml, 'M' , css_m, s_m)
if lvl_yearly
mtfphl(pyh , pyl , '12M', css_y, s_y)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Market Structure }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method darkcss(color css, float factor, bool bull) =>
blue = color.b(css) * (1 - factor)
red = color.r(css) * (1 - factor)
green = color.g(css) * (1 - factor)
color.rgb(red, green, blue, 0)
method f_line(msDraw d, size, style) =>
var line id = na
var label lbl = na
id := line.new(
d.n
, d.p
, b.n
, d.p
, color = d.css
, width = 1
, style = style
)
if msline.size() >= 250
line.delete(msline.shift())
msline.push(id)
lbl := label.new(
int(math.avg(d.n, b.n))
, d.p
, d.txt
, color = invcol
, textcolor = d.css
, style = d.bull ? label.style_label_down : label.style_label_up
, size = size
, text_font_family = font.family_monospace
)
structure(bool mtf) =>
msDraw drw = na
bool isdrw = false
bool isdrwS = false
var color css = na
var color icss = na
var int itrend = 0
var int trend = 0
bool bull_ob = false
bool bear_ob = false
bool s_bull_ob = false
bool s_bear_ob = false
n = bar_index
var ms up = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms dn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sup = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sdn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
switch show_swing_ms
"All" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, true )
"CHoCH" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, false )
"CHoCH+" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, true )
"BOS" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
"None" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
=> na
switch show_internal_ms
"All" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, true )
"CHoCH" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, false)
"CHoCH+" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, true )
"BOS" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
"None" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
=> na
switch
iH =>
up.p.unshift(b.h )
up.l.unshift(b.h )
up.n.unshift(n )
iL =>
dn.p.unshift(b.l )
dn.l.unshift(b.l )
dn.n.unshift(n )
sL =>
sdn.p.unshift(b.l )
sdn.l.unshift(b.l )
sdn.n.unshift(n )
sH =>
sup.p.unshift(b.h )
sup.l.unshift(b.h )
sup.n.unshift(n )
// INTERNAL BULLISH STRUCTURE
if up.p.size() > 0 and dn.l.size() > 1
if ta.crossover(b.c, up.p.first())
bool CHoCH = na
string txt = na
if itrend < 0
CHoCH := true
switch
not CHoCH =>
txt := "BOS"
css := i_ms_up_BOS
blalert.bos := true
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS
, txt
, true
)
CHoCH =>
dn.l.first() > dn.l.get(1) ? blalert.chochplus : blalert.choch
txt := dn.l.first() > dn.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_up_BOS.darkcss(0.25, true)
if (dn.l.first() > dn.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => bull_ob := true
ob_filter == "BOS" and txt == "BOS" => bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bull_ob := true
itrend := 1
up.n.clear()
up.p.clear()
// INTERNAL BEARISH STRUCTURE
if dn.p.size() > 0 and up.l.size() > 1
if ta.crossunder(b.c, dn.p.first())
bool CHoCH = na
string txt = na
if itrend > 0
CHoCH := true
switch
not CHoCH =>
bralert.bos := true
txt := "BOS"
css := i_ms_dn_BOS
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS
, txt
, false
)
CHoCH =>
if up.l.first() < up.l.get(1)
bralert.chochplus := true
else
bralert.choch := true
txt := up.l.first() < up.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_dn_BOS.darkcss(0.25, false)
if (up.l.first() < up.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => bear_ob := true
ob_filter == "BOS" and txt == "BOS" => bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bear_ob := true
itrend := -1
dn.n.clear()
dn.p.clear()
// SWING BULLISH STRUCTURE
if sup.p.size() > 0 and sdn.l.size() > 1
if ta.crossover(b.c, sup.p.first())
bool CHoCH = na
string txt = na
if trend < 0
CHoCH := true
switch
not CHoCH =>
blalert.swingbos := true
txt := "BOS"
icss := s_ms_up_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS
, txt
, true
)
CHoCH =>
if sdn.l.first() > sdn.l.get(1)
blalert.chochplusswing := true
else
blalert.chochswing := true
txt := sdn.l.first() > sdn.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_up_BOS.darkcss(0.25, true)
if (sdn.l.first() > sdn.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => s_bull_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bull_ob := true
trend := 1
sup.n.clear()
sup.p.clear()
// SWING BEARISH STRUCTURE
if sdn.p.size() > 0 and sup.l.size() > 1
if ta.crossunder(b.c, sdn.p.first())
bool CHoCH = na
string txt = na
if trend > 0
CHoCH := true
switch
not CHoCH =>
bralert.swingbos := true
txt := "BOS"
icss := s_ms_dn_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS
, txt
, false
)
CHoCH =>
if sup.l.first() < sup.l.get(1)
bralert.chochplusswing := true
else
bralert.chochswing := true
txt := sup.l.first() < sup.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_dn_BOS.darkcss(0.25, false)
if (sup.l.first() < sup.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => s_bear_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bear_ob := true
trend := -1
sdn.n.clear()
sdn.p.clear()
= structure(false)
if isdrw
f_line(drw, size.small, line.style_dashed)
if isdrwS
f_line(drw, size.small, line.style_solid)
= request.security("", "15" , structure(true))
= request.security("", "60" , structure(true))
= request.security("", "240" , structure(true))
= request.security("", "1440" , structure(true))
if show_mtf_str
var tab = table.new(position = position.top_right, columns = 10, rows = 10, bgcolor = na, frame_color = color.rgb(54, 58, 69, 0), frame_width = 1, border_color = color.rgb(54, 58, 69, 100), border_width = 1)
table.cell(tab, 0, 1, text = "15" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 2, text = "1H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 3, text = "4H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 4, text = "1D" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 1, 1, text = itrend15 == 1 ? "BULLISH" : itrend15 == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend15 == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend15 == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 2, text = itrend1H == 1 ? "BULLISH" : itrend1H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 3, text = itrend4H == 1 ? "BULLISH" : itrend4H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend4H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend4H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 4, text = itrend1D == 1 ? "BULLISH" : itrend1D == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1D == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1D == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 5, text = "Detected Pattern", text_halign = text.align_center, text_size = size.normal, text_color = color.silver, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 6, text = p.found, text_halign = text.align_center, text_size = size.normal, text_color = na(p.bull) ? color.white : p.bull ? i_ms_up_BOS.darkcss(-0.25, true) : p.bull == false ? i_ms_dn_BOS.darkcss(0.25, false) : na, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.merge_cells(tab, 0, 5, 1, 5)
table.merge_cells(tab, 0, 6, 1, 6)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Strong/Weak High/Low And Equilibrium }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
var phl = Zphl.new(
na
, na
, label.new(na , na , color = invcol , textcolor = i_ms_dn_BOS , style = label.style_label_down , size = size.tiny , text = "")
, label.new(na , na , color = invcol , textcolor = i_ms_up_BOS , style = label.style_label_up , size = size.tiny , text = "")
, true
, true
, true
, true
, ""
, ""
, 0
, 0
, 0
, 0
, high
, low
, 0
, 0
, 0
, 0
, 0
, 0
, na
, na
)
zhl(len)=>
upper = ta.highest(len)
lower = ta.lowest(len)
var float out = 0
out := b.h > upper ? 0 : b.l < lower ? 1 : out
top = out == 0 and out != 0 ? b.h : 0
btm = out == 1 and out != 1 ? b.l : 0
= zhl(sLen)
= zhl(iLen)
upphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
if top
phl.stopcross := true
phl.txtup := top > phl.topy ? "HH" : "HL"
if show_lbl
topl = label.new(
b.n - swing_r_lookback
, top
, phl.txtup
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
line.delete(phl.top )
phl.top := line.new(
b.n - sLen
, top
, b.n
, top
, color = toplvl)
phl.topy := top
phl.topx := b.n - sLen
phl.tup := top
phl.tupx := b.n - sLen
if itop
phl.itopcross := true
phl.itopy := itop
phl.itopx := b.n - iLen
phl.tup := math.max(high, phl.tup)
phl.tupx := phl.tup == high ? b.n : phl.tupx
phl.uV := phl.tup != phl.tup ? b.v : phl.uV
if barstate.islast
line.set_xy1(
phl.top
, phl.tupx
, phl.tup
)
line.set_xy2(
phl.top
, b.n + 50
, phl.tup
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tup
)
dist = math.abs(phl.uV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend < 0
? "Strong High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
dnphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
if btm
phl.sbottomcross := true
phl.txtdn := btm > phl.bottomy ? "LH" : "LL"
if show_lbl
btml = label.new(
b.n - swing_r_lookback
, btm, phl.txtdn
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
line.delete(phl.bottom )
phl.bottom := line.new(
b.n - sLen
, btm
, b.n
, btm
, color = btmlvl
)
phl.bottomy := btm
phl.bottomx := b.n - sLen
phl.tdn := btm
phl.tdnx := b.n - sLen
if ibtm
phl.ibottomcross := true
phl.ibottomy := ibtm
phl.ibottomx := b.n - iLen
phl.tdn := math.min(low, phl.tdn)
phl.tdnx := phl.tdn == low ? b.n : phl.tdnx
phl.dV := phl.tdn != phl.tdn ? b.v : phl.dV
if barstate.islast
line.set_xy1(
phl.bottom
, phl.tdnx
, phl.tdn
)
line.set_xy2(
phl.bottom
, b.n + 50
, phl.tdn
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tdn
)
dist = math.abs(phl.dV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend > 0
? "Strong Low | " + str.tostring(phl.dV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak Low | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
midphl() =>
avg = math.avg(phl.bottom.get_y2(), phl.top.get_y2())
var line l = line.new(
y1 = avg
, y2 = avg
, x1 = b.n - sLen
, x2 = b.n + 50
, color = midlvl
, style = line.style_solid
)
var label lbl = label.new(
x = b.n + 50
, y = avg
, text = "Equilibrium"
, style = label.style_label_left
, color = invcol
, textcolor = midlvl
, size = size.small
)
if barstate.islast
more = (phl.bottom.get_x1() + phl.bottom.get_x2()) > (phl.top.get_x1() + phl.top.get_x2()) ? phl.top.get_x1() : phl.bottom.get_x1()
line.set_xy1(l , more , avg)
line.set_xy2(l , b.n + 50, avg)
label.set_x (lbl , b.n + 50 )
label.set_y (lbl , avg )
dist = math.abs((l.get_y2() - close) / close) * 100
label.set_text (lbl, "Equilibrium (" + str.tostring(math.round(dist,0)) + "%)")
hqlzone() =>
if barstate.islast
var hqlzone dZone = hqlzone.new(
box.new(
na
, na
, na
, na
, bgcolor = color.new(toplvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(midlvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(btmlvl, 70)
, border_color = na
)
, label.new(na, na, text = "Premium" , color = invcol, textcolor = toplvl, style = label.style_label_down, size = size.small)
, label.new(na, na, text = "Equilibrium", color = invcol, textcolor = midlvl, style = label.style_label_left, size = size.small)
, label.new(na, na, text = "Discount" , color = invcol, textcolor = btmlvl, style = label.style_label_up , size = size.small)
)
dZone.pbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)) , phl.tup)
dZone.pbx.set_rightbottom(b.n + 50 , 0.95 * phl.tup + 0.05 * phl.tdn)
dZone.ebx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.525 * phl.tup + 0.475 * phl.tdn)
dZone.ebx.set_rightbottom(b.n + 50 , 0.525 * phl.tdn + 0.475 * phl.tup)
dZone.lbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.95 * phl.tdn + 0.05 * phl.tup)
dZone.lbx.set_rightbottom(b.n + 50 , phl.tdn)
dZone.plb.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tup)
dZone.elb.set_xy( int(b.n + 50) , math.avg(phl.tup, phl.tdn))
dZone.lbl.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tdn)
if show_mtb
upphl (trend)
dnphl (trend)
hqlzone()
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Volumetric Order Block }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method eB(box b, bool ext, color css, bool swing) =>
b.unshift(
box.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, text_font_family = font.family_monospace
, extend = ext ? extend.right : extend.none
, border_color = swing ? color.new(css, 0) : color.new(color.white,100)
, bgcolor = css
, border_width = 1
)
)
method eL(line l, bool ext, bool solid, color css) =>
l.unshift(
line.new(
na
, na
, na
, na
, width = 1
, color = css
, xloc = xloc.bar_time
, extend = ext ? extend.right : extend.none
, style = solid ? line.style_solid : line.style_dashed
)
)
method drawVOB(bool cdn, bool bull, color css, int loc, bool swing) =>
= request.security(
syminfo.tickerid
, ""
,
, lookahead = barmerge.lookahead_off
)
var obC obj = obC.new(
array.new()
, array.new()
, array.new< int >()
, array.new()
, array.new()
, array.new()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new()
, array.new()
, array.new< int >()
)
var obD draw = obD.new(
array.new()
, array.new()
, array.new()
, array.new()
, array.new()
)
if barstate.isfirst
for i = 0 to ob_num - 1
draw.mL .eL(false, false, use_grayscale ? color.new(color.gray, 0) : color.new(css,0))
draw.ob .eB(false, use_grayscale ? color.new(color.gray, 90) : css, swing)
draw.blB.eB(false, css_metric_up , swing)
draw.brB.eB(false, css_metric_dn , swing)
draw.eOB.eB(true , use_grayscale ? color.new(color.gray, 90) : css, swing)
float pos = ob_pos == "Full"
? (bull ? high : low)
: ob_pos == "Middle"
? ohlc4
: ob_pos == "Accurate"
? hl2
: hl2
if cdn
obj.h.clear()
obj.l.clear()
obj.n.clear()
for i = 0 to math.abs((loc - b.n)) - 1
obj.h.push(hH )
obj.l.push(lL )
obj.n.push(b.t )
// obj.h.reverse()
// obj.l.reverse()
int iU = obj.l.indexof(obj.l.min()) + 1
int iD = obj.h.indexof(obj.h.max()) + 1
obj.dir.unshift(
bull
? (b.c > b.o ? 1 : -1)
: (b.c > b.o ? 1 : -1)
)
obj.top.unshift(
bull
? pos
: obj.h.max()
)
obj.btm.unshift(
bull
? obj.l.min()
: pos
)
obj.left.unshift(
bull
? obj.n.get(obj.l.indexof(obj.l.min()))
: obj.n.get(obj.h.indexof(obj.h.max()))
)
obj.avg.unshift(
math.avg(obj.top.first(), obj.btm.first())
)
obj.cV.unshift(
bull
? b.v
: b.v
)
if ob_pos == "Precise"
switch bull
true =>
if obj.avg.get(0) < (b.c < b.o ? b.c : b.o ) and obj.top.get(0) > hlcc4
obj.top.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
false =>
if obj.avg.get(0) > (b.c < b.o ? b.o : b.c ) and obj.btm.get(0) < hlcc4
obj.btm.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
obj.blVP.unshift ( 0 )
obj.brVP.unshift ( 0 )
obj.wM .unshift ( 1 )
if use_overlap
int rmP = use_overlap_method == "Recent" ? 1 : 0
if obj.avg.size() > 1
if bull
? obj.btm.first() < obj.top.get(1)
: obj.top.first() > obj.btm.get(1)
obj.wM .remove(rmP)
obj.cV .remove(rmP)
obj.dir .remove(rmP)
obj.top .remove(rmP)
obj.avg .remove(rmP)
obj.btm .remove(rmP)
obj.left .remove(rmP)
obj.blVP .remove(rmP)
obj.brVP .remove(rmP)
if barstate.isconfirmed
for x = 0 to ob_num - 1
tg = switch ob_mitigation
"Middle" => obj.avg
"Absolute" => bull ? obj.btm : obj.top
for in tg
if (bull ? cC < pt : cC > pt)
obj.wM .remove(idx)
obj.cV .remove(idx)
obj.dir .remove(idx)
obj.top .remove(idx)
obj.avg .remove(idx)
obj.btm .remove(idx)
obj.left .remove(idx)
obj.blVP .remove(idx)
obj.brVP .remove(idx)
if barstate.islast
if obj.avg.size() > 0
// Alert
if bull
? ta.crossunder(low , obj.top.get(0))
: ta.crossover (high, obj.btm.get(0))
switch bull
true => blalert.obtouch := true
false => bralert.obtouch := true
float tV = 0
obj.dV.clear()
seq = math.min(ob_num - 1, obj.avg.size() - 1)
for j = 0 to seq
tV += obj.cV.get(j)
if j == seq
for y = 0 to seq
obj.dV.unshift(
math.floor(
(obj.cV.get(y) / tV) * 100)
)
obj.dV.reverse()
for i = 0 to math.min(ob_num - 1, obj.avg.size() - 1)
dmL = draw.mL .get(i)
dOB = draw.ob .get(i)
dblB = draw.blB.get(i)
dbrB = draw.brB.get(i)
deOB = draw.eOB.get(i)
dOB.set_lefttop (obj.left .get(i) , obj.top.get(i))
deOB.set_lefttop (b.t , obj.top.get(i))
dOB.set_rightbottom (b.t , obj.btm.get(i))
deOB.set_rightbottom(b.t + (b.t - b.t ) * 100 , obj.btm.get(i))
if use_middle_line
dmL.set_xy1(obj.left.get(i), obj.avg.get(i))
dmL.set_xy2(b.t , obj.avg.get(i))
if ob_metrics_show
dblB.set_lefttop (obj.left.get(i), obj.top.get(i))
dbrB.set_lefttop (obj.left.get(i), obj.avg.get(i))
dblB.set_rightbottom(obj.left.get(i), obj.avg.get(i))
dbrB.set_rightbottom(obj.left.get(i), obj.btm.get(i))
rpBL = dblB.get_right()
rpBR = dbrB.get_right()
dbrB.set_right(rpBR + (b.t - b.t ) * obj.brVP.get(i))
dblB.set_right(rpBL + (b.t - b.t ) * obj.blVP.get(i))
if use_show_metric
txt = switch
obj.cV.get(i) >= 1000000000 => str.tostring(math.round(obj.cV.get(i) / 1000000000,3)) + "B"
obj.cV.get(i) >= 1000000 => str.tostring(math.round(obj.cV.get(i) / 1000000,3)) + "M"
obj.cV.get(i) >= 1000 => str.tostring(math.round(obj.cV.get(i) / 1000,3)) + "K"
obj.cV.get(i) < 1000 => str.tostring(math.round(obj.cV.get(i)))
deOB.set_text(
str.tostring(
txt + " (" + str.tostring(obj.dV.get(i)) + "%)")
)
deOB.set_text_size (size.auto)
deOB.set_text_halign(text.align_left)
deOB.set_text_color (use_grayscale ? color.silver : color.new(css, 0))
if ob_metrics_show and barstate.isconfirmed
if obj.wM.size() > 0
for i = 0 to obj.avg.size() - 1
switch obj.dir.get(i)
1 =>
switch obj.wM.get(i)
1 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 1)
-1 =>
switch obj.wM.get(i)
1 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 1)
var hN = array.new(1, b.n)
var lN = array.new(1, b.n)
var hS = array.new(1, b.n)
var lS = array.new(1, b.n)
if iH
hN.pop()
hN.unshift(int(b.n ))
if iL
lN.pop()
lN.unshift(int(b.n ))
if sH
hS.pop()
hS.unshift(int(b.n ))
if sL
lS.pop()
lS.unshift(int(b.n ))
if ob_show
bull_ob.drawVOB(true , ob_bull_css, hN.first(), false)
bear_ob.drawVOB(false, ob_bear_css, lN.first(), false)
if ob_swings
s_bull_ob.drawVOB(true , css_swing_up, hS.first(), true)
s_bear_ob.drawVOB(false, css_swing_dn, lS.first(), true)
if bull_ob
blalert.ob := true
if bear_ob
bralert.ob := true
if s_bull_ob
blalert.swingob := true
if s_bear_ob
blalert.swingob := true
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - FVG | VI | OG }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
ghl() => request.security(syminfo.tickerid, fvg_tf, [high , low , close , open ])
tfG() => request.security(syminfo.tickerid, fvg_tf, )
cG(bool bull) =>
= ghl()
= tfG()
var FVG draw = FVG.new(
array.new()
, array.new()
)
var FVG cords = array.new()
float pup = na
float pdn = na
bool cdn = na
int pos = 2
cc = timeframe.change(fvg_tf)
if barstate.isfirst
for i = 0 to fvg_num - 1
draw.box.unshift(box.new (na, na, na, na, border_color = color.new(color.white, 100), xloc = xloc.bar_time))
draw.ln.unshift (line.new(na, na, na, na, xloc = xloc.bar_time, width = 1, style = line.style_solid))
switch what_fvg
"FVG" =>
pup := bull ? gl : l
pdn := bull ? h : gh
cdn := bull ? gl > h and cc : gh < l and cc
pos := 2
"VI" =>
pup := bull
? (gc > go
? go
: gc)
: (gc > go
? go
: gc )
pdn := bull
? (gc > go
? gc
: go )
: (gc > go
? gc
: go)
cdn := bull
? go > gc and gh > 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
p
自動斐波擴展思考了8sAuto Fibonacci Extension Explanation
Auto Fibonacci Extension is a technical analysis tool used in financial markets (such as stocks, forex, commodities, and cryptocurrencies) to automatically calculate and draw Fibonacci extension levels, helping traders identify potential target prices or reversal areas after price trend continuations. Below is a detailed explanation of its core concepts, functions, and applications:
What is Auto Fibonacci Extension?
The Auto Fibonacci Extension indicator is based on the Fibonacci sequence, which derives specific ratios (such as 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 200%, and 261.8%) that are considered important reference points for price behavior in financial markets. Unlike traditional Fibonacci tools that require manual setting of start and end points, the Auto Fibonacci Extension indicator can automatically identify and draw these levels based on historical fluctuations on the price chart (e.g., recent highs and lows calculated by indicators like ZigZag), saving time and reducing human error.
Functions and Features
Automated Calculation and Drawing:
The Auto Fibonacci Extension indicator automatically draws extension levels based on key points on the price chart (usually highs and lows calculated by technical indicators like ZigZag).
No need for traders to manually select start point (A), end point (B), and retracement point (C); the indicator automatically identifies trend direction and retracement amplitude, then calculates potential price targets.
Key Levels:
Common Retracement Levels: 23.6%, 38.2%, 50%, 61.8%, and 78.6%, used to identify support or resistance after price retracements.
Common Extension Levels: 61.8%, 100%, 161.8%, 200%, and 261.8%, used to predict potential targets that prices may reach after trend continuation.
Flexibility and Customization:
Traders can adjust settings, such as which extension levels to display, line colors, widths, and styles.
Some indicators (like MT4/MT5 versions) allow setting alerts to notify traders when prices touch specific Fibonacci levels.
Options to reverse calculation direction (e.g., switching from bullish to bearish trend) or extend lines (left or right).
Applicable Markets and Timeframes:
Suitable for various financial markets (stocks, forex, futures, cryptocurrencies, etc.) and all timeframes (minute charts, daily charts, weekly charts, etc.), fitting day trading, swing trading, or long-term investing.
Calculation Method
The calculation of the Auto Fibonacci Extension indicator is based on Fibonacci ratios, with no fixed formula, but typically involves the following steps:
Identify Trend (A to B):
The indicator automatically detects the "A to B" movement on the price chart, i.e., the start point (A, usually a swing high or low) and end point (B, trend pause or reversal point) of the trend.
Determine Retracement Point (C):
Point C is the position where the price retraces from point B, often marked using Fibonacci retracement levels (e.g., 38.2% or 61.8%).
Calculate Extension Levels:
Based on points A, B, C, the indicator calculates extension targets in the trend direction. For example, the 161.8% extension level indicates that the price may extend from point C in the trend direction to 161.8% of the A-B swing height.
How to Use Auto Fibonacci Extension?
Trend Confirmation:
Before applying the indicator, traders should confirm the market trend (upward or downward), using other technical tools (such as moving averages or trendlines) for assistance.
Apply Indicator:
Enable the Auto Fibonacci Extension indicator on trading platforms (such as TradingView, MetaTrader 4/5, or NinjaTrader), and the system will automatically draw the levels.
Find Trading Opportunities:
Entry Points: When the price retraces to a key Fibonacci level (e.g., 61.8%) and shows reversal signals (such as candlestick patterns or technical indicator confirmations), consider entering trades in the trend direction.
Exit Points: Use extension levels (such as 161.8% or 200%) as potential profit-taking targets.
Stop Loss Settings: Set stop losses below the retracement level (bullish) or above (bearish) to manage risk.
Combine with Other Tools:
Combine the Auto Fibonacci Extension indicator with other technical analysis tools (such as moving averages, RSI, MACD, or support/resistance levels) to improve trading decision accuracy.
Trading Strategy Examples
Trend Continuation Strategy:
In an uptrend, when the price retraces from the high (B) to the 61.8% level (C) and shows rebound signals, traders can consider going long, with target prices set at 161.8% or 200% extension levels.
In a downtrend, when the price retraces to 38.2% or 50% levels and continues falling, consider shorting, with targets at 161.8% extension levels.
Range Trading Strategy:
In ranging markets, use 0% and 100% levels as support and resistance, and look for breakout or rebound opportunities when prices approach these levels.
Risk Management:
Set stop-loss and take-profit orders, ensuring a risk-reward ratio of at least 1:2. For example, if the stop loss is set below the 61.8% retracement level, the take profit can be set at the 161.8% extension level.
Advantages
Efficiency: Automation reduces time and errors in manual drawing.
Versatility: Applicable to multiple markets and timeframes, suitable for different trading styles.
Visualization: Clearly shows potential support, resistance, and target prices, helping traders make quick decisions.
Limitations
Not Foolproof: Fibonacci levels do not always accurately predict price behavior; combine with other analysis methods.
Market Dependency: More effective in strong trend markets; may produce more false signals in ranging markets.
Subjectivity: Although automated, selecting trend start points and parameter settings may still affect results.
Where to Use?
TradingView: Select "Auto Fib Extension" under the "Indicators" option, customize parameters, and view source code.
MetaTrader 4/5: Download the Auto Fibonacci Extension indicator, which automatically draws retracement and extension levels, supporting alert functions.
NinjaTrader: Provides free Auto Fibonacci Extension indicators, customizable levels and styles.
Summary
The Auto Fibonacci Extension indicator is a powerful and efficient tool that helps traders identify potential price targets and reversal areas through automated Fibonacci level drawing. It is particularly suitable for trend market traders but needs to be combined with other technical analysis tools and strict risk management strategies to improve success rates. Traders should familiarize themselves with its settings and test in demo accounts to ensure adaptation to their trading style.
Ultimate Sniper Entry - Pivot PerfectionT2R📌 Description
The Ultimate Sniper Entry – Pivot Perfection is a precision trading tool designed to identify high-probability pivot points and generate early buy/sell entries with strong confirmation. By combining pivot detection, volume spikes, momentum filters (RSI), candle patterns, and EMA trend alignment, this system helps traders capture market reversals and trend continuation setups with improved accuracy.
It offers:
Smart Pivot Detection with adjustable sensitivity.
Multi-layer Confirmation: volume, momentum, candle structure, and EMA trend filter.
Non-Repainting Signals: arrows plotted only after pivot confirmation.
Visual Aids: buy/sell arrows, optional pivot markers, background trend shading.
Alerts: instant notifications for sniper buy/sell entries.
Info Panel: quick reference guide directly on chart.
Ideal for traders who want structured, rules-based entries while avoiding false signals, the Ultimate Sniper Entry system adapts to multiple markets and timeframes.
IaoriginalTrend following (CTA/Clenow): requires EMA50 > EMA200 (or < for shorts) and a Donchian breakout (50); ideally with a confirmation breakout (100).
Kleinman MA channel: price breaking above/below the channel bands adds points.
Squeeze / momentum (TTM-like): when the Bollinger Bands “release” from the Keltner Channels and momentum flips through zero, it adds points.
Signal logic: when the total points ≥ the threshold and the trend filter is met, the script draws arrows (LONG/SHORT) and triggers alerts.
Risk: shows an ATR stop line in the relevant direction when the signal fires (visual aid only, not an order).
Sessions Highs/LowsThis indicator plots the High and Low of the three main trading sessions:
Asia (20:00–03:00) – green lines
London (03:00–08:00) – blue lines
New York (08:00–13:00) – red lines
Features:
Levels update in real time during each session.
When a new session starts, the previous lines are deleted – only the latest active sessions remain visible.
Default session times are set to Asia (20:00–03:00), London (03:00–08:00), and New York (08:00–13:00), but you can adjust them to your own custom hours in the settings.
Colors can also be customized.
Use cases:
Quickly visualize session ranges.
Track session highs/lows for breakouts, fakeouts, and reactions around liquidity zones.
Fixed Asset TurnoverFixed Asset Turnover (FAT) measures how efficiently a company uses its fixed assets (Property, Plant & Equipment – PPE) to generate revenue. It shows how many times the company “turns over” its fixed assets in a period relative to revenue.
High FAT: Assets are used efficiently; the company generates more revenue per unit of fixed assets.
Low FAT: Fixed assets are underutilized; the company may have invested too much in assets that don’t produce sufficient revenue.
Formula:
Fixed Asset Turnover=Total Revenue/Average Net Fixed Assets
What it tells you:
Indicates asset efficiency in generating sales.
Useful to compare companies within the same industry (because asset intensity varies by sector).
Helps identify whether a company is over-invested in fixed assets or underutilizing them.
How to use it:
Trend Analysis:
Track FAT over time for the same company to see if asset utilization is improving.
Benchmarking:
Compare FAT against competitors or industry averages.
Investment Decisions:
Higher FAT usually suggests more efficient operations, but context matters (e.g., heavy-capital industries naturally have lower FAT).
Salim ALHammadi-Telegram @salimalhammadiAuto Trading its show entry price and tp price and sl i hope every one like it
AM PRO – KDJ Long v3.0 (TV×BingX×Auto)AM Pro – Long Only v3.0 • TradingView Publication
AM Pro – Long Only v3.0 • TradingView 發表說明
Backtest (hypothetical), ETHUSDT.P 5m, 2024-09-18→2025-09-18, fee 0.05%, slippage 1t: Equity +30.2%, CAGR 100%, Win 77%.
歷史回測(模擬),ETHUSDT.P 5分,2024-09-18→2025-09-18,手續費 0.05%,滑點 1跳:權益 +30.2%,年化 100%,勝率77%。
Overview
概覽
This strategy automates long-only entries by blending KDJ momentum, MACD trend confirmation, EMA structure, ADX strength, OB/FVG pullbacks, S/R touches, and a double-bottom chart pattern pack.
本策略結合 KDJ 動能、MACD 趨勢確認、EMA 結構、ADX 強度、OB/FVG 回踩、支撐阻力觸價,以及雙底圖形模組,實現「只做多」自動進場。
It is designed for crypto perpetuals but works on any symbol/timeframe; presets are included for quick ETH deployment. For other symbols/timeframes, parameters may differ and should be tuned; this strategy ships with ETH as the default preset.
主要面向加密永續合約,亦適用任意商品與週期;內建 ETH 快速部署預設。其他商品或週期之參數可能不同,請自行調整;本策略預設以 ETH 為主。
How it works
運作原理
Entries are tiered into channels: Core KDJ trend longs, OB/FVG touch longs, S/R bounce longs, CP double-bottom break, EMA pullback, VWAP reclaim, and liquidity sweep-reclaim.
訊號分層:KDJ 核心順勢、OB/FVG 觸價、S/R 觸價不破、圖形雙底突破、EMA 回踩、VWAP 收復、以及流動性掃低回收。
Signals are filtered by “trend-only” (EMA alignment, MACD>0, ADX≥閾值) plus lite guards (over-extension, candle body, DI edge).
訊號受「僅順勢」(EMA 排列、MACD>0、ADX≥門檻) 與輕量濾網(過度延伸、實體大小、DI 差距)共同篩選。
A session filter lets you restrict trading windows (up to three sessions) for different market regimes.
時段過濾可設定三段交易窗口以適配不同盤態。
Risk & exits
風險與出場
Stops use ATR, swing-low, or “ATR_or_Swing”, with optional TP cap by ATR or %.
止損可選 ATR、近端擺動低點或兩者取大,並可用 ATR 或百分比限制 TP 上限。
Breakeven and trailing are dynamic: BE arms after a target R:R, then a highest-high minus ATRx trail takes over.
保本與移動止損為動態:達到指定 R:R 後啟動保本,再以「最高價回看 − ATRx」進行追蹤。
Same-bar exits are configurable to avoid instant stop/limit on the entry candle if desired.
可設定是否允許同根 K 線觸發停利/停損以避免入場即出場。
Multi-timeframe structure
多週期結構
A trend pack (5/15/1H or 15/60/4H) provides mid/high-TF trendlines and context for touch-zones.
多週期組合(5/15/1H 或 15/60/4H)提供中/高週期趨勢線與觸價區域參考。
EMA200 bias, EMA21 proximity, and HTF trendline distance (≤ ATRx) act as structure gates.
EMA200 位階、EMA21 鄰近度與高週期趨勢線距離(≤ ATRx)共同作為結構門檻。
Chart patterns & liquidity
圖形與流動性
The CP module detects valid double bottoms with ATR-tolerant symmetry and triggers on a buffered neckline break.
圖形模組偵測 ATR 容差對稱的雙底,並於頸線加緩衝突破時觸發。
A sweep setup buys failed breakdowns: pierce a prior low then close back above with trend confluence.
掃低回收:先掃過前低再收回,上方條件符合趨勢後進場。
Presets
預設
ETH preset tightens several gates (ADX/DI/J/KDJ timing) for plug-and-play deployment.
ETH 預設收緊 ADX/DI/J/KDJ 時序門檻,開箱即用。
Position sizing
部位大小
Choose base/quote/percent/percent_local to size orders; percent_local references a local USD account value.
提供 base/quote/percent/percent_local 四種下單型式;percent_local 以本地 USD 帳戶估值計算。
Automation with TradingView + BingX
透過 TradingView + BingX 自動化
This strategy emits JSON messages via alert_message on entries/exits; use TradingView alerts with “Any alert() function call”.
策略在進出場透過 alert_message 輸出 JSON;請在 TradingView 設定警示時選擇「Any alert() function call」。
Paste your BingX bot Webhook URL into the alert’s Webhook URL field to route orders to the exchange.
將 BingX 機器人提供的 Webhook URL 貼入警示的 Webhook 欄位,即可把指令送往交易所。
Select your preferred sizing mode, leverage, and symbol mapping in the panel before starting live alerts.
啟用前於面板選好下單型式、槓桿與交易對映射,然後啟動即時警示。
When an entry triggers, TradingView sends a “buy” payload with price, qty, SL/TP; when an exit triggers, it sends a “flat/exit” payload.
當入場觸發時,TV 會送出含價格、數量、SL/TP 的「買入」訊息;當出場觸發時,會送出「平倉/出場」訊息。
BingX receives the payload and places/updates orders accordingly, achieving fully automated long-only execution.
BingX 接收訊息後自動下單/更新委託,完成全自動的只做多執行。
Plotting & labels
視覺標示
EMA200 is plotted; entry types A/B/CP/SR/D/E/F are tagged on chart with distinct colors for quick audit.
圖上繪出 EMA200;A/B/CP/SR/D/E/F 各類進場以不同顏色標示,便於回看驗證。
Optional TP/SL labels print the live targets used by the Webhook messages.
可選擇顯示 TP/SL 標籤,與 Webhook 內使用的目標一致。
Suggested workflow
建議流程
Backtest on your market/timeframe → tune session and filters → enable alerts to Webhook → monitor broker logs.
先回測目標市場/週期 → 調整時段與濾網 → 啟用 Webhook 警示 → 監看交易所日誌。
Start conservative sizing and gradually scale as stability is verified; never disable SL/TP in production.
初期使用保守倉位並逐步擴大;實盤請勿關閉 SL/TP。
Notes & disclaimer
注意與免責
Execution, slippage, and latency depend on market/liquidity and your alert/Webhook reliability.
成交、滑點與延遲取決於市場流動性與您的警示/Webhook 穩定度。
This is not financial advice; test thoroughly and trade responsibly.
本文非投資建議;請充分測試並審慎交易。
Optimized for ETH; parameters are micro-tuned for the 5-minute chart to maximize effectiveness.
本版針對 ETH 做參數微調,最佳適用於 5 分鐘圖表以獲得最大效益。
Other symbols or timeframes may need retuning; results degrade if used unchanged.
套用到其他商品或週期可能需重新調參,直接套用可能降低效果。
Use the ETH preset for plug-and-play on 5m; switch to Generic before adapting to non-ETH markets.
5 分鐘圖請使用 ETH 預設可即插即用;移轉到非 ETH 市場前請改為 Generic 再調整。
Pops Blessing — Custom MACD📌 Indicator Description
Pops Blessing — Custom MACD is a fine-tuned version of the classic MACD, designed to give traders clearer momentum signals with flexible moving average options.
🔹 Customizable MA Type – choose between SMA or EMA for faster or smoother reactions.
🔹 Color-Coded Momentum – MACD line changes color automatically:
Green (Lime): Momentum strengthening
Red: Momentum weakening
Blue: Neutral / flat
🔹 Signal Line & Histogram – standard MACD components are included to highlight crossovers and divergences.
🔹 Zero Line Reference – adds a clear visual anchor for bullish vs bearish momentum shifts.
This indicator keeps the familiarity of MACD while adding visual clarity and adaptability, making it easier to spot shifts in trend strength and potential entry/exit zones.
✅ Best Used For
Identifying momentum shifts before price breakouts.
Confirming trend continuation or reversal setups.
Enhancing scalping, swing trading, or long-term momentum strategies.
⚡ Suggested Settings
Default lengths: Fast 3, Slow 10, Signal 16.
Switch to EMA mode for faster reactions, or SMA mode for smoother signals.
📊 How to Trade With It
Look for MACD line crossing above/below the Signal line for potential entries.
Confirm with histogram expansion in the same direction.
Use the color change of the MACD line to quickly gauge momentum strength.
👉 Add this to your charts and let Pops Blessing guide you with sharper, cleaner momentum signals!
BTC RSI 35 이하 + 음봉 직후 양봉 (중복방지, 일봉 20일선 위)//@version=5
indicator("BTC RSI 35 이하 + 음봉 직후 양봉 (중복방지, 일봉 20일선 위)", overlay=true)
// === 일봉 기준 조건 ===
dailyClose = request.security(syminfo.tickerid, "D", close) // 일봉 종가
dailyMA20 = request.security(syminfo.tickerid, "D", ta.sma(close, 20)) // 일봉 20일선
aboveDailyMA = dailyClose > dailyMA20 // 일봉 종가가 20일선 위일 때만 true
// === RSI 계산 (1시간봉) ===
rsiLength = 14
rsi = ta.rsi(close, rsiLength)
// === 상태 변수 ===
var bool armed = false
var bool locked = false
// RSI 35 이하 → 무장(armed)
if (rsi <= 35)
armed := true
// RSI 40 이상 → 리셋
if (rsi >= 40)
armed := false
locked := false
// === BUY 조건 정의 (1시간봉 + 일봉 조건) ===
bearishPrev = close < open // 직전 봉 음봉
bullishNow = close > open // 현재 봉 양봉
buySignal = armed and not locked and bearishPrev and bullishNow and aboveDailyMA
// BUY 발생 시 잠금
if (buySignal)
locked := true
// === 차트 표시 ===
plotshape(buySignal, title="BUY", location=location.belowbar,
color=color.lime, style=shape.labelup, text="BUY", size=size.tiny)
// === 얼러트 조건 ===
alertcondition(buySignal, title="BUY Alert",
message="RSI 35 이하 + 음봉 직후 양봉 + 일봉 20일선 위 (1시간)")
Opening 15 Min Range Breakout — Current Day Draws the opening 15-minute range for the current day only, shows breakout markers, and stops plotting at 3:30 PM India Time, This script is for intra day 15 min time frame chart only
Key levels + Session Range (Sweep-Aware Levels)Overview
This indicator provides a single, clean view of two core intraday contexts that day traders rely on:
Daily Liquidity Levels: prior day high/low (PDH/PDL), prior day open/close, weekly highs/lows, and other commonly referenced reference points.
Session Ranges: clearly plotted high/low for each active session (e.g., Asia, London, New York), tracked live as the session evolves.
By unifying these two information layers, traders can immediately see when price is sweeping a session’s extremes into known daily liquidity—a frequent precursor to reversals or continuation moves. This saves chart space, reduces cognitive overload, and turns two separate checks into one coherent read.
What it does
Plots daily liquidity references: previous day high/low, previous day open/close, and optional higher-timeframe levels (open, high, mid and low 4H ,Day, Week, month, year and quarterly).
Tracks session high/low live: as each session unfolds, the indicator updates that session’s running High and Low, then locks them at session end.
Maps interaction between the two layers: you can instantly spot session sweeps that tag PDH/PDL (or weekly extremes), highlight potential liquidity grabs, and frame risk with objective boundaries.
Keeps the chart clean: just essential lines/zones and concise labels—no extra clutter.
Why it’s useful & original
Single-purpose integration: Rather than a generic mashup, this is a purpose-built fusion where session dynamics are read in the context of daily liquidity. That relationship is the core edge—seeing when a session sweep aligns with known liquidity pools.
Workflow efficiency: One overlay replaces two indicators, simplifying visibility and reducing conflicting visuals.
Decision clarity: The combination highlights setups many intraday traders already watch manually (e.g., NY session high sweep into PDH), but makes them obvious in real time.
How it works (plain-English logic)
Daily Liquidity Engine
At the start of each day, the indicator records PDH, PDL, prior open/close and (optionally) prior week high/low.
These levels are plotted and extended across the session as static references.
Session Range Tracker
For each defined session (e.g., Asia/London/New York), the script initializes session High/Low at session open.
Throughout the session, it updates those extremes in real time and locks them on session close.
Interaction Layer
When price reaches or sweeps a session High/Low near a daily level (e.g., within your chosen tolerance), the confluence becomes visually obvious.
Traders can then decide whether it’s a likely liquidity grab (fade/reversal idea) or a continuation through the pool (breakout idea), per their plan.
How to use it
Identify session context: Start by noting where price is trading relative to the current session’s High/Low.
Locate nearby daily liquidity: Check distance to PDH/PDL, prior open/close, and weekly extremes.
Look for confluence:
Sweep-and-fade idea: Session High swept into PDH (or Session Low into PDL) with failure to hold → potential reversal context.
Break-and-go idea: Strong close through PDH/PDL following a session extreme break → potential continuation context.
Risk framing: Session High/Low and PDH/PDL provide objective anchors for stops and targets. Adapt to your own risk model (e.g., use ATR or structure-based stops).
Keep it clean: Use this as your primary overlay to avoid clutter; add confirmations (volume, structure) only if they genuinely help your process.
Settings (typical options)
Sessions: Choose which sessions to display (e.g., Asia/London/NY) and their time zones/hours.
Daily Levels: Toggle PDH/PDL, prior open/close, prior week High/Low, and other references you rely on.
Visuals: Colors, line styles, label visibility, and optional band shading for quick recognition.
Confluence Tolerance (optional): Define how near a session extreme must be to a daily level to consider it a “liquidity touch/sweep” in your visuals.
Alerts (optional): First touch/sweep of session High/Low, break/close beyond PDH/PDL, or custom distance conditions.
Chart & Publishing Notes (for reviewers and users)
Clean chart by design: Only essential lines/labels for session extremes and daily references.
Plain-English description: Explains what, why, and how so non-coders can use it confidently.
Original integration: The value here is the purposeful interaction—seeing session sweeps in context of daily liquidity in one place—rather than a cosmetic mashup.
Limitations & good practice
This tool is contextual, not predictive. It highlights structure and liquidity landmarks; trade decisions are yours.
Session definitions vary by asset/exchange; ensure your session times match your market.
Past behavior at these levels does not guarantee future outcomes; always use proper risk management.
Disclaimer
This indicator is for educational and informational purposes only and is not financial advice. Trading involves risk; always test and evaluate with your own methods and risk parameters.
ORB NY — Opening Range Breakout (15-Min Session Levels)Overview
This indicator highlights the Opening Range High (ORH) and Opening Range Low (ORL) formed during the first 15 minutes of the trading session.
The Opening Range is one of the most widely used concepts by professional day traders, as it provides an early reference point for potential breakouts, retests, and intraday directional bias.
What the indicator does
At the market open, the script tracks the price action for the first 15 minutes.
It records the highest price and the lowest price reached during this period.
After the 15-minute window closes, these two levels are locked and extended across the rest of the trading session.
Traders can then use these levels to identify potential breakouts, failed breakouts (fakeouts), or continuation patterns.
Why it is useful & original
Unlike generic support/resistance tools, this indicator is purpose-built for the Opening Range breakout approach.
It focuses only on the 15-minute window, which is a key benchmark for many intraday strategies.
The simplicity and clarity of this design make it easy for traders to quickly see where the market stands relative to its early session range, without clutter or unnecessary mashups of other indicators.
How to use it
Breakout Trades
If price closes above the Opening Range High, traders may interpret this as bullish momentum and look for long opportunities.
If price closes below the Opening Range Low, traders may interpret this as bearish momentum and look for short opportunities.
Retest Trades
Some traders prefer to wait for a breakout, followed by a pullback (retest) back into the Opening Range boundary, and then enter in the breakout direction.
Risk Management
The Opening Range levels often act as natural support and resistance.
Traders commonly place stop-loss orders just inside the range and set profit targets at predefined multiples of risk or near key liquidity levels (previous day’s high/low, session levels, etc.).
Chart presentation
The indicator plots only the two horizontal levels (ORH & ORL), keeping the chart clean and easy to read.
The zone between them can optionally be shaded for clarity.
Labels clearly mark “ORH” and “ORL” so that even users without coding knowledge can immediately understand the meaning of each line.
Best practices
Use it on intraday charts (1m, 5m, etc.) during active market hours.
Works best on instruments with a defined market open (e.g., stocks, futures, forex sessions).
Combine it with your own trade management rules (e.g., ATR filters, volume confirmation, session bias).
进场与止损参考指标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.
让你更好的把握进场点,实现无脑进场的效果。
止损参考线,有效控制资金风险
AI-Powered Market and Fast Trend AnalysisAI-Powered Market and Fast Trend Analysis Presentation V7
Hello,
This presentation explains the core features and functionality of your "AI-Powered Market and Fast Trend Analysis" Pine Script indicator used on the TradingView platform.
1. General Overview
This indicator combines various technical analysis indicators and an AI-based decision-making mechanism to analyze market trends, volatility, volume movements, and potential reversal points. Its purpose is to provide users with a comprehensive and quick overview to make more informed buy/sell decisions.
2. General Settings and Periods
The indicator offers several input parameters to customize the analysis:
General Settings: Allows you to adjust the calculation periods for core indicators such as Period (General), TTM Period, Stoch %K/%D Period, Keltner Channel Multiplier, Volume Oscillator Fast/Slow Period.
3. AI Decision Weights
The AI decision mechanism, which is the heart of the indicator, generates a final AI score by assigning weights to different category scores:
Trend Indicators Weight: The impact of trend indicators such as Supertrend, TTM Squeeze, QQE, Vortex, RSI, Stochastic, Moving Averages (SMA, EMA, WMA, VWMA), MACD, Ichimoku Kijun, TEMA, HMA on the final score.
Momentum Indicators Weight: The impact of momentum indicators on the final score.
Volatility Indicators Weight: The impact of volatility indicators such as Bollinger Band Width, ATR, Keltner Channel Width, Donchian Channel Width, NATR.
Volume Indicators Weight: The impact of volume indicators such as OBV, AD, CMF, MFI, Volume Oscillator, VPT, VWAP.
Candlestick Pattern Weight (New): The impact of candlestick patterns like Doji, Bullish/Bearish Engulfing, Hammer, Shooting Star on the AI decision.
Reversal Momentum Weight (New): The impact of sudden price movements and reversal signals on the AI decision.
Market Context Weight: Determines how the general market sentiment from BIST indices (XU100, XU030, XBANK), in addition to the traded symbol's data, influences the AI decision. This weight controls how much the symbol's own data versus index data affects the AI decision.
4. AI Decision Thresholds
The AI score is converted into buy/sell signals based on specific threshold values, and the strength of the score is qualified:
AI Buy/Sell Thresholds: Separate buy and sell thresholds are defined for different asset classes like BIST stocks and Gold/MGC1.
Score Qualification Thresholds (New): The strength of the AI score is determined by levels such as Very Strong Buy/Sell, Strong Buy/Sell, Moderate Buy/Sell, Weak Buy/Sell.
Category-Based Signal Thresholds: Separate buy/sell thresholds exist for each category like trend, volatility, and volume.
5. Market Context Integration
The indicator analyzes not only the data of the traded symbol but also the data from BIST indices (XU100, XU030, XBANK) to incorporate general market sentiment into the AI decision. This provides a more holistic and reliable analysis.
6. Target Point Calculations
The indicator calculates potential buy and sell targets using ATR (Average True Range) multipliers. These targets are shown separately for different timeframes (30 Min, 1 Hour, 4 Hour, 1 Day, 1 Week) and are also marked on the chart. Additionally, Nearest Buy/Sell and Farthest Buy/Sell targets are determined from all timeframes.
7. Candlestick Patterns and Coloring
Pattern Detection: Automatically detects and marks important candlestick patterns such as Doji, Bullish Engulfing, Bearish Engulfing, Hammer, and Shooting Star on the chart.
Candlestick Coloring: Candlesticks are dynamically colored based on detected patterns and volume inflow. For example, in a Bullish Engulfing pattern, the candlestick turns solid green, while candlesticks with volume inflow are shown in white.
Fake Rally Indicator (New): Generates a "Fake Rally" signal when the overall AI score is still in a bearish zone, but there are bullish candlesticks and weak reversal signals.
8. Overbought/Oversold and Indecision Zones
On the chart, Overbought, Oversold, and Indecision zones are visually marked based on price movements within a specific period. These zones help you understand whether the price is near potential reversal points.
9. Panel Information (Top Right Corner)
The information panel located in the top right corner of the chart summarizes all important analysis results:
AI Decision: The general AI signal (Very Strong Buy/Sell, Strong Buy/Sell, etc.) and its color.
Score: The final AI score and its color (green, yellow, red).
Direction: The general market direction determined by AI (UP, DOWN, SIDEWAYS).
Category Signal: The combined signal of trend, volatility, and volume categories.
Confirmation Signal (New): The overall confidence level generated by combining the final AI score and the category signal (DEFINITE BUY/SELL, VERY STRONG, STRONG, MODERATE, WEAK, UNCERTAIN).
Timeframe-Based Status: Trend, Volatility, and Volume statuses for 30 Min, 1 Hour, 4 Hour, 1 Day, and 1 Week timeframes (Uptrend/Downtrend/Neutral, Inflow/Outflow/Neutral).
Candlestick Pattern: The detected candlestick pattern in the active timeframe.
Market Index Score: The average AI score of BIST indices.
Buyer/Seller Power (New): The percentage distribution of buyer and seller power in the current candlestick.
Target Buy/Sell: Potential buy and sell targets calculated for each timeframe.
Nearest/Farthest Buy/Sell (New): The nearest and farthest buy/sell points determined from targets across all timeframes.
10. How It Helps
This indicator helps you make sense of complex market data and assists you with:
Quick Decision Making: Allows you to quickly see the overall market situation and potential buy/sell signals at a glance.
Trend Identification: Helps you understand trends across different timeframes and their strength.
Risk Management: Supports your risk management strategies with target points and volatility analyses.
Market Sentiment: Enables you to make more accurate decisions by considering the general market context through index integration.
Important Note: When using the indicator for buy/sell decisions, please consider removing the "Overall AI Score" line and the "Buy/Sell Threshold" lines from the chart for a cleaner full-screen view.
I hope this presentation helps you better understand your code and proves useful in your TradingView operations.
Sincerely,
17 Tem
Sürüm Notları
VERSİON V9
Black DragonUse the RSI bands; when the price touches the upper band, it tends to go down, and when the price touches the lower band, it tends to go up. Pay attention to enter a trade only when a reversal candle appears; suitable for scalping on the M15 timeframe.
High volume bar by Vibiehigh volume bar - calculation based on Z-score. Very precise. Aggregated data. Adding autoselect soon.
Probability Density Function (rus)KZ Indicator (Probability Density Function)
KZ estimates price move probabilities using a normal distribution model. It automatically detects trend direction, volatility level, and strength, then visualizes the likelihood of reaching an upside or downside target.
✅ Auto-adjusts for different timeframes
✅ Plots green (long) and red (short) probability zones
✅ Shows suggested target, stop-loss, and limit order
✅ Ideal for identifying high-probability entry zones
Advanced Version Available
An advanced version of the KZ script is available with:
🎯 Precise entry/exit signals
🕵️ Liquidity zone detection
🔄 Multi-timeframe signal confirmation
🛑 Dynamic stop-loss based on volatility
🔔 Built-in alerts for signal triggers
📩 DM me to get access to the advanced script version.
✅ Автоматически адаптируется под таймфрейм
✅ Показывает зелёную (лонг) и красную (шорт) области вероятности
✅ Отображает рекомендуемые цель, стоп-лосс и лимитный ордер
✅ Отлично подходит для поиска точек входа с высокой вероятностью
Доступна продвинутая версия скрипта KZ, включающая:
🎯 Точные сигналы входа/выхода
🕵️ Обнаружение зон ликвидности
🔄 Подтверждение сигналов с других таймфреймов
🛑 Динамический стоп-лосс на основе волатильности
🔔 Алерты на сигналы
EMA+RSI Buy/Sell with Fibonacci GuideSingle-Instance EUR/USD & GBP/USD Trend+MACD ATR EA
Purpose:
This EA is designed for automated Forex trading on EUR/USD and GBP/USD. It identifies trend-based trading opportunities, dynamically calculates position sizes based on your available capital and risk percentage, and manages trades with ATR-based stop-loss and take-profit levels, including optional trailing stops.
Key Features:
Auto Pair Selection:
Compares the trend strength of EUR/USD vs GBP/USD using a combination of EMA slopes and MACD direction.
Automatically trades the stronger trending pair.
Trend & Signal Detection:
Uses Fast EMA / Slow EMA crossover for trend direction.
Confirms trend with MACD line vs signal line.
Generates long and short signals only when trend and MACD align.
Dynamic SL/TP:
Stop-loss and take-profit are calculated based on ATR (Average True Range).
Supports optional trailing stops to lock in profits.
Position Sizing:
Automatically calculates micro-lot sizes based on your capital and risk percentage.
Ensures risk per trade does not exceed the defined % of your account equity.
Chart Visualization:
Plots Fast EMA / Slow EMA.
Displays SL and TP levels on the chart.
Shows a label indicating the active pair currently being traded.
Alerts:
Generates alerts for long and short signals.
Can be used with TradingView alerts to notify or trigger webhooks.
Single Strategy Instance:
Fully compatible with Pine Script v6.
Only one strategy instance runs on the chart to prevent “too many strategies” errors.
Bedo osaimi "Pivot Pro"📎 Connect with me and explore my tools:
👉 linkfly.to/60812USKGpf
overview
Pivot Pro v3.1.1 is a production‑ready pivot system that plots multi‑timeframe pivots, generates entry signals on pivot crossovers, draws ATR‑based TP1/TP2/TP3 and SL boxes/lines, and maintains an advanced performance table updated on the last bar only.
Signals support Scale‑Out with Sequential or All‑At‑Once target priorities, plus full close after 100 bars to cap holding time for statistics consistency.
Core features
Multi‑type pivots: Traditional, Fibonacci, Woodie, Classic, DM, and Camarilla, anchored to Auto/1H/4H/D/W/M/Q/Y using request.security with lookahead off and previous HTF values to reduce repainting.
Entry logic: Buy on close crossover above P and Sell on crossunder below P with in‑position gating and all filter checks combined into allFiltersBuy/sell.
Risk model: ATR length input with per‑target multipliers and SL multiplier; visual trade boxes with lines and labels for Entry, TP1/TP2/TP3, and SL.
Scale‑Out engine: Portion exits at TP1/TP2/TP3 with remainingSize tracking, counters for hits per side, and forced archival/cleanup of objects; full close once size ≤ 0.01.
Performance table: Win rate from completed trades only, Profit/Loss totals, Profit Factor, Sharpe, Sortino, Max Drawdown %, Recovery Factor, Expectancy, Kelly, streaks, and average bars held; shows current trade snapshot with RR and TP/SL status.
Signal alerts
Provided conditions: Buy Signal, Sell Signal, TP1/TP2/TP3 Hit (Scale‑Out), SL Hit Long, SL Hit Short; create alerts from TradingView UI and customize message text if desired.
Filters (toggleable)
Moving averages: SMA/EMA/WMA/HMA/RMA/VWMA/TEMA/DEMA with optional MA cross filter and three lengths (20/50/200 by default).
Volume/VWAP: Volume vs SMA×multiplier, VWAP with upper/lower bands via standard deviation, and optional VWAP presence filter.
RSI: Level filter (buy below, sell above), optional divergence heuristic, and RSI MA reference.
MACD: Line relation, crossover filter, and histogram sign filter.
Stochastic: %K/%D with smoothing and overbought/oversold thresholds using ta.stoch(high, low, close, len) ordering.
Bollinger Bands: Length/StdDev with optional squeeze filter via band width vs MA(width).
ADX: Minimum trend strength threshold.
Candles: Engulfing, Hammer/Shooting Star, Doji, Pin Bar, Inside Bar; each is optional and combined logically with other filters.
Support/Resistance: Swing‑based detection with strength, lookback, and proximity buffer; buy near support and sell near resistance when enabled.
Market Structure: HH/HL uptrend, LH/LL downtrend, and breakout checks; all optional.
Time window: Hour‑of‑day and day‑of‑week gates for session control.
Drawing and performance safeguards
Manages separate limits and arrays for historical boxes, lines, and labels; archival and cleanup prevent object overflows while preserving recent context.
Pivots are drawn as timed lines with labels positioned left/right per input and rows managed in a matrix for efficient lifecycle updates.
Backtest window shown in tables
Statistics run over the full chart history loaded by TradingView for the symbol/timeframe, while each open position is force‑closed after 100 bars to standardize holding time metrics.
نظرة عامة
Pivot Pro v3.1.1 نظام بيفوت جاهز للإنتاج يرسم بيفوتات متعددة الأطر الزمنية، ويولد إشارات دخول عند تقاطع السعر مع P، ويرسم صناديق/خطوط TP1/TP2/TP3 وSL المبنية على ATR، ويعرض جدول أداء احترافي محدث على آخر شمعة فقط.
يدعم الخروج الجزئي Scale‑Out بخيارين للأولوية (تتابعي أو جميع الأهداف معاً) مع إغلاق إجباري للمركز بعد 100 شمعة لتوحيد حسابات الإحصائيات.
المميزات الأساسية
أنواع البيفوت: تقليدي، فيبوناتشي، وودي، كلاسيك، DM، وكاماريلا مع تثبيت زمني Auto/ساعة/4س/يومي/أسبوعي/شهري/ربع سنوي/سنوي باستخدام request.security بدون نظر للأمام واعتماد قيم HTF السابقة لتقليل إعادة الرسم.
منطق الدخول: شراء عند اختراق الإغلاق فوق P وبيع عند كسر الإغلاق أسفل P مع منع التكرار أثناء وجود مركز وتطبيق جميع الفلاتر ضمن allFiltersBuy/sell.
إدارة المخاطر: مدخل فترة ATR ومضاعفات TP/SL؛ رسم صناديق وخطوط وملصقات للدخول والأهداف ووقف الخسارة.
محرّك الخروج الجزئي: إغلاقات نسبية عند TP1/TP2/TP3 مع تتبع الحجم المتبقي وعدادات الإصابات لكل اتجاه، ثم إغلاق كامل عند بقاء حجم لا يُذكر.
جدول الأداء: نسبة النجاح من الصفقات المكتملة فقط، إجمالي الربح/الخسارة، PF، شارپ، سورتينو، أقصى تراجع %، Recovery، التوقعية، كيلي، السلاسل، ومتوسط مدة الاحتفاظ، مع بطاقة آنية للصفقة الحالية.
التنبيهات
شروط جاهزة: Buy/Sell وTP1/TP2/TP3 (في وضع Scale‑Out) وSL للونغ والشورت؛ يُنشأ التنبيه من واجهة TradingView مع إمكانية تخصيص النص.
الفلاتر
متوسطات متحركة (SMA/EMA/WMA/HMA/RMA/VWMA/TEMA/DEMA) مع فلتر تقاطع اختياري وثلاث فترات 20/50/200.
الحجم وVWAP: مقارنة الحجم بمتوسط×معامل، وفلتر VWAP مع نطاقات علوية/سفلية بالانحراف المعياري.
RSI: مستويات شراء/بيع مع خيار انحراف، ومتوسط RSI مرجعي.
MACD: علاقة الخطوط، تقاطعات، وإشارة الهيستوجرام.
Stochastic: %K/%D مع تنعيم وحدود تشبع شراء/بيع بالترتيب الصحيح للمدخلات.
بولنجر: طول/انحراف معياري مع فلتر الضغط عبر عرض الباند مقابل متوسط العرض.
ADX: حد أدنى لقوة الترند.
الشموع: ابتلاع، مطرقة/شوتنج ستار، دوجي، بين بار، وInside Bar قابلة للتفعيل الانتقائي.
دعم/مقاومة: اكتشاف تأرجحي بقوة/بحث/هامش قرب، شراء قرب الدعم وبيع قرب المقاومة عند التفعيل.
هيكل السوق: HH/HL للاتجاه الصاعد وLH/LL للهابط مع اختراقات اختيارية.
فلترة الوقت: ساعات العمل وأيام الأسبوع لتقييد الجلسات.
الرسم والحماية
إدارة حدود منفصلة للأصناف المرسومة (صناديق/خطوط/ملصقات) مع أرشفة وتنظيف يحافظان على الأداء والوضوح.
رسم خطوط البيفوت مؤقتة بملصقات يسار/يمين وإدارة عبر matrix لأسطر رسومية فعّالة.
نافذة الباك تست المعروضة بالجدول
تُحسب الإحصائيات على كامل تاريخ الشموع المحمّل للشارت، مع إغلاق إجباري لأي صفقة تتجاوز 100 شمعة لضبط متوسطات المدة.
©
🌌 Skywalker Strong Signals + Labels🟩 Skywalker Entry → Detects strong bullish setups when trend and momentum align
🟨 RSI Peak – Caution → Warns when RSI crosses into overbought territory, signaling possible exhaustion (Market is overwhelmed with buyers)
🟥 Sell Zone Detected → Confirms bearish momentum shifts with trend and volume filters
EMA Trend Tracking → Visual fast/slow EMA lines to spot bullish vs bearish zones instantly
Volume filter & candle confirmation for stronger signals
Perfect on all time-frames for scalp and swing traders.
Alpha Buy/Sell Signal✅ High Accuracy – Signals are generated using advanced algorithmic conditions to highlight reliable trade opportunities and reduce false entries.
✅ Clear Visual Alerts – Buy and sell signals appear as distinct markers directly on your chart for easy interpretation.
✅ Easy to Use – Apply it directly to your charts without needing to adjust complex settings.