Candlestick Suite–(Phoenix) it colors the major Reversal candlesticks
BullEngulf or BearEngulf or Engulfing() -> DARK_ORANGE
PiercingLine or DarkCloudCover -> CYAN
BullishHarami or BearishHarami -> YELLOW
BullishInsideBar or BearishInsideBar -> WHITE
Chart patterns
Supply & Demand & Backtest (M5-H4)// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © RoseZero
//@version=6
indicator('Vung Cung va Cau (M5-H4)', overlay = true)
//===Input===
length1 = input.int(5, 'Swing Loockback', minval = 1)
lengthM5 = input.int(10, title = 'Lookback (M5-M30)')
LengthH1 = input.int(20, title = 'Lookback (H1-H4)')
volMultiplier = input.float(1.5, title = 'Volume Threshold')
zoneHeight = input.float(0.4, title = 'Zone Height (%)')
rsiPeriod = input.int(14, title = 'RSI Period')
rsiOB = input.int(70, title = 'RSI Overbought')
rsiOS = input.int(30, title = 'RSI Oversold')
zoneDuration = input.int(20, title = 'ZOne Duration (bars)')
showEngulfing = input.bool(true, 'Highlight Engulfing Candles')
//boxLookback = input.int(10, title = 'Khoang cach toi da giua 2 liquidity Grab')
//===Auto-adjust by timeframe===
isLowerTF = timeframe.isminutes and timeframe.multiplier <= 30
length = isLowerTF ? lengthM5 : LengthH1
//===Calculation==
avgVol = ta.sma(volume, length)
rsi = ta.rsi(close, rsiPeriod)
highVol = volume > avgVol * volMultiplier
//===Supply Zone Conditions===
isSwingHigh = high == ta.highest(high, length)
bearish = close < open
supplyCond = highVol and isSwingHigh and bearish and rsi > rsiOB
//===Demand Zone Condition===
isSwingLow = low == ta.lowest(low, length)
bullish = close > open
demandCond = highVol and isSwingLow and bullish and rsi < rsiOS
//===Strength Classification===
zoneStrength = volume / avgVol
supplyColor = zoneStrength > 2 ? color.red : color.new(color.red, 60)
demandColor = zoneStrength > 2 ? color.green : color.new(color.green, 60)
supplyLabel = zoneStrength > 2 ? 'Supply(Strong)' : 'Supply(Week)'
demandLabel = zoneStrength > 2 ? 'Demand(Strong)' : 'Demand(Week)'
//===Draw Zone===
if supplyCond
box.new(left = bar_index, right = bar_index + zoneDuration, top = high, bottom = high * (1 - zoneHeight / 100), bgcolor = color.new(supplyColor, 80), border_color = supplyColor, text = supplyLabel, text_color = color.white)
alert('Vung cung moi xuat hien', alert.freq_once_per_bar_close)
if demandCond
box.new(left = bar_index, right = bar_index + zoneDuration, top = low * (1 + zoneHeight / 100), bottom = low, bgcolor = color.new(demandColor, 80), border_color = demandColor, text = demandLabel, text_color = color.white)
alert('Vung cau moi xuat hien', alert.freq_once_per_bar_close)
//===Alert=== alertc
alertcondition(supplyCond, title = 'New Supply Zone', message = 'Vung Cung moi xuat hien!')
alertcondition(demandCond, title = 'New Demand Zone', message = 'Vung Cau moi xuat hien!')
//============================================================================================
//===Khung thoi gian su ly===
timeframe = input.timeframe('30', 'Khung phan tich(vd:\'30\', \'60\')')
//===So nen truoc de do vung OB===
lookback = input.int(10, 'so nen truoc de do oder block')
//===Lay du lieu tu khung thoi gian lon hon===
= request.security(syminfo.tickerid, timeframe, [high , low , open , close ])
src = input.source(close, 'Nguon gia')
//===Logic phat hien OB ===
isBearishOB = closeHTF < openHTF
isBullishOB = closeHTF > openHTF
//===Vung OB===
obHigh = isBearishOB ? highHTF : na
obLow = isBullishOB ? lowHTF : na
//===Canh bao===
touchOB = close >= obLow and close <= obHigh
alertcondition(touchOB, title = 'Cham vung OB', message = 'Gia dang cham vung Smart Money Order Block!')
plotshape(touchOB, location = location.belowbar, color = color.orange, style = shape.triangleup, size = size.small)
if touchOB
alert('Cham vung OB: Gia dang cham vung Smart Money Order Block!', alert.freq_once_per_bar_close)
//===Vung thanh khoan===(Liquidity Sweep Zones)
swingHigh = ta.highest(high, length1)
swingLow = ta.lowest(low, length1)
liquidityHigh = high > swingHigh
liquidityLow = low < swingLow
//==========================================================================================
//===Volume filter===
avgVol2 = ta.sma(volume, 20)
highVol2 = volume > avgVol2 * volMultiplier
//===Candle Pattern===
bullishEngulfing = close > open and close < open and close > open and open < close
bearishEngulfing = close < open and close > open and close < open and open > close
isPinBarBull = close > open and (open - low) > 2 * (close - open)
isPinBarBear = close < open and (high - open) > 2 * (open - close)
isHammer = (high - low) > 3 * (open - close) and (close - low) / (high - low) > 0.6
isHangingMan = (high - low) > 3 * (open - close) and (high - open) / (high - low) > 0.6
isBullMarubozu = close > open and (high - close) < 0.1 * (high -low) and (open -low) < 0.1 * (high - low)
isBearMarubozu = close < open and (high - open) < 0.1 * (high - low) and (close -low) < 0.1 * (high -low)
//===Bien luu vung Cung / Cau da bi pha===
var float lastSupplyTop = na
var float lastSupplyBottom = na
var bool supplyBroken = false
var float lastDemandTop = na
var float lastDemandBottom = na
var bool demandBroken = false
//===Cap nhat vung moi khi co Cung/Cau moi ===
if supplyCond
lastSupplyTop := high
lastSupplyBottom := high * (1 - zoneHeight / 100)
supplyBroken := false
if demandCond
lastDemandBottom := low
lastDemandTop := low * (1 + zoneHeight / 100)
//===Kiem tra pha vo vung Cung/Cau===
if not supplyBroken and close > lastSupplyTop
supplyBroken := true
if not demandBroken and close < lastDemandBottom
demandBroken := true
//===Kiem tra backtest vung da bi pha===
backtestSupply = supplyBroken and close <= lastSupplyTop and close >= lastSupplyBottom
backtestDemand = demandBroken and close >= lastDemandBottom and close <= lastDemandTop
//===Kiem tra thung vung backtest (gia vuot qua vung luon)===
failBacktestSupply = supplyBroken and close < lastSupplyBottom
failBacktestDemand = demandBroken and close > lastDemandTop
//Hien thi canh bao tren bieu do===
plotshape(backtestSupply, title = 'Backtest Supply', location = location.abovebar, color = color.new(color.red, 50), style = shape.circle, size = size.small)
plotshape(backtestDemand, title = 'Backtest Demand', location = location.belowbar, color = color.new(color.green, 60), style = shape.circle, size = size.small)
volStrong = volume > ta.sma(volume, 20) * volMultiplier
validBull = bullishEngulfing and isPinBarBull and isHammer and isBullMarubozu and volStrong and demandCond
validBear = bearishEngulfing and isPinBarBear and isHangingMan and isBearMarubozu and volStrong and supplyCond
if validBull
alert("Tin hieu Buy: Mo hinh nen dao chieu tang + RSI + Volume lon", alert.freq_once_per_bar_close)
if validBear
alert("Tin hieu Sell: Mo hinh nen dao chieu giam + RSI + Volume lon", alert.freq_once_per_bar_close)
//plot(close)
//===============================================================================================
📱 Mobile EMA + V2L5 (edegrano)User Manual: Mobile EMA + V2 (edegrano)
Overview
This TradingView indicator combines EMA bias analysis and multi-timeframe linear regression trendlines with key crossover signals, displayed both on the chart and summarized in a colour-coded table for quick decision-making on mobile devices or desktops.
Inputs
Input Name Description Default
Custom EMA Timeframe Timeframe used to calculate EMA 50, 100, 200 "1" (1m)
Show EMAs on Chart Toggle to plot EMAs (50-blue, 100-black, 200-red) true
Linear Regression Length Period length for linear regression trendlines 20
Show EMA 50 > EMA 200 Bias Show EMA bias row in the table (Bullish/Bearish) true
Show Trendline Slope Bias Show trendline slope bias row in the table true
Price Distance % from Cross Percentage distance used to calculate above/below cross prices in table 2.0
What It Shows
On Chart:
EMA 50 (blue), EMA 100 (black), EMA 200 (red) lines
Vertical lines at EMA 50/200 crossover bars (blue for bullish, red for bearish)
Labels “Bull Cross” or “Bear Cross” on crossover bars
Signal dots (up to 3 consecutive strong buy or sell signals)
Table (bottom-left corner):
Row Description
EMA 50 > EMA 200 Bullish if EMA 50 is above EMA 200, Bearish otherwise (colored green/red text)
Trendline slope Bullish if all 1m, 3m, 5m regression slopes are up, Bearish if all down, Neutral otherwise (green/red/gray text)
Last EMA Cross Price Price where EMA 50 and EMA 200 last crossed (light blue text)
+% Above Cross Price percentage above last EMA cross price (dark orange text)
-% Below Cross Price percentage below last EMA cross price (red text)
Final Suggestion Overall signal: “Strong Buy 💎”, “Strong Sell 💎”, or “Mixed / Neutral” with green/red/gray background
How To Use
Set your preferred timeframe for EMA calculations using the Custom EMA Timeframe input. The default is 1 minute.
Enable or disable EMAs and table rows as you prefer with toggles.
Watch the table for quick bias and trend signals with color-coded text for easy interpretation.
Use the Last EMA Cross Price and the above/below percentage price points to identify key levels for entries, stops, or take profits.
Monitor the chart for EMA crossover vertical lines and labels to confirm signals visually.
Strong Buy or Sell dots indicate good entry opportunities — limited to 3 per consecutive trend.
Tips
Adjust the Price Distance % input to increase/decrease sensitivity of above/below price levels.
Combine this indicator with volume, price action, or other tools for best results.
Use on mobile or desktop with the compact table to stay informed without clutter.
50 SMA 5-Candle Crossovercatching the cycle using very simple method. at your descrtion.
must know what you are doing.
this will work if you do not follow bindly.
Reversal Straategy(RSI & Volume & Support resistance)// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © RoseZero
//@version=6
indicator('Chien luoc dao chieu manh(RSI + Volume + Ho tro auto)', overlay = true)
//===Tham so nguoi dung===
rsiOversold = input.int(30, 'Nguong RSI qua ban')
rsiOverbought = input.int(70, 'Nguong RSI qua mua')
rsiLow = input.int(35, 'Nguong qua ban')
rsiHigh = input.int(55, 'Nguong qua mua')
volMultiplier = input.float(1.5, 'nguong khoi luong tang (so voi TB)')
mult = input.float(1.5, 'Nguong nhan do lon nen', step = 0.1)
supportLength = input.int(20, 'Do dai vung ho tro')
resistLength = input.int(20, 'Do dai vung khang cu')
length = input.int(20, 'So nen trung binh')
volume_threshold = input.float(1.2, title = 'Nguong volume dao chieu')
fastEMA = input.int(21, title = 'EMA nhanh')
slowEMA = input.int(55, title = 'EMA cham')
depth = input.int(3, title = 'Pivot Depth')
rsiLen = input.int(14, title = 'RSI Length')
//==============================================================================
// === Dấu hiệu Cạn Cung ===
lowVolMultiplier = input.float(0.5, title = 'Ngưỡng khối lượng thấp (Cạn cung)')
lowRangeMultiplier = input.float(0.7, title = 'Ngưỡng biên độ giá thấp (Cạn cung)')
avgVolCC = ta.sma(volume, 20)
avgRangeCC = ta.sma(high - low, 20)
isLowVolume = volume < avgVolCC * lowVolMultiplier
isNarrowRange = (high - low) < avgRangeCC * lowRangeMultiplier
isSideways = math.abs(close - close ) < avgRangeCC * 0.3
supplyDryUp = isLowVolume and isNarrowRange and isSideways
// === Dấu hiệu Cạn Cầu ===
lowVolMultiplier2 = input.float(0.5, title = 'Ngưỡng khối lượng thấp (Cạn cầu)')
lowRangeMultiplier2 = input.float(0.7, title = 'Ngưỡng biên độ giá thấp (Cạn cầu)')
avgVolCD = ta.sma(volume, 20)
avgRangeCD = ta.sma(high - low, 20)
isLowVolumeCD = volume < avgVolCD * lowVolMultiplier2
isNarrowRangeCD = (high - low) < avgRangeCD * lowRangeMultiplier2
isWeakDemand = close <= close or close - close < avgRangeCD * 0.2
demandDryUp = isLowVolumeCD and isNarrowRangeCD and isWeakDemand
//=====================================================================================
ema34 = ta.ema(close, 34)
ema89 = ta.ema(close, 89)
volAvg = ta.sma(volume, 20)
plot(ema34, color = color.green, title = 'EMA 34')
plot(ema89, color = color.orange, title = 'EMA 89')
emaUp = ta.crossover(ema34, ema89)
emaDow = ta.crossunder(ema34, ema89)
alertcondition(emaUp, title = 'EMA34 cat len tren EMA89', message = 'EMA34 cat len tren EMA89 xu huong gia di len')
alertcondition(emaDow, title = 'EMA34 cat xuong duoi EMA89', message = 'EMA34 cat xuong duoi EMA*9 xu huong gia di xuong')
// dieu kien pha len ema va nguoc lai============================================================================================================
breakoutEma = close < ema34 and close < ema89 and close > ema34 and close > ema89
breakdownEma = close > ema34 and close > ema89 and close < ema34 and close < ema89
//dieu kien test lai EMA sau break
retestUpEma = breakoutEma and close < ema34 * 1.02 and close > ema89 * 0.98
retestDownEma = breakdownEma and close > ema34 * 0.98 and close < ema89 * 1.02
//canh bao gia test lai cum ema
alertcondition(retestUpEma, title = 'Canh bao test lai EMA gia tang', message = 'Gia dang test lai cum EMA khi gia tang')
alertcondition(retestDownEma, title = 'Canh bao test lai EMA gia giam', message = 'Gia dang test lai cum EMA khi gia giam')
//Tinh toan co bao Pivot
pivotHigh = ta.pivothigh(high, depth, depth)
pivotLow = ta.pivotlow(low, depth, depth)
ema = ta.ema(close, fastEMA)
ma = ta.sma(close, slowEMA)
rsii = ta.rsi(close, rsiLen)
//Volume Breakout check
volStrong = volume > ta.sma(volume, 20) * volume_threshold
//Mo hinh nen : Pinbar, Engulfing, Doji
isPinBar = math.abs(close - open) / math.abs(high - low) < 0.2
isBullEngulfing = close > open and open < close and close > open
isBearishEngulfing = close < open and open > close and close < open
isDoji = math.abs(close - open) / math.abs(high - low) < 0.1
//Dao chieu tang manh va giam manh
candlePattern = isPinBar or isBullEngulfing or isDoji
candlePattern2 = isPinBar or isBearishEngulfing or isDoji
priceCondition = close > ema and close > ma and rsii < 30 and volStrong
priceCondition2 = close < ema and close < ma and rsii > 70 and volStrong
bullishSignal = not na(pivotLow) and candlePattern and priceCondition and volStrong
if bullishSignal
alert('Dao chieu tang manh: Xuat hien nen dao chieu Tang(PInBar, BullishEngulf, Doji)', alert.freq_once_per_bar_close)
bearishSignal = not na(pivotHigh) and candlePattern2 and priceCondition2 and volStrong
if bearishSignal
alert('Dao chieu giam manh: Xuat hien nen dao chieu Giam(PinBar, BearishEngul, Doji)', alert.freq_once_per_bar_close)
//EMA & Trend
emaFast = ta.ema(close, fastEMA)
emaSlow = ta.ema(close, slowEMA)
plot(emaFast, title = 'EMA nhanh', color = color.blue)
plot(emaSlow, 'EMA cham', color = color.purple)
//===Ho tro tu dong===
supportZone = ta.lowest(low, supportLength)
resistZone = ta.highest(high, resistLength)
nearSupport = math.abs(low - supportZone) < syminfo.mintick * 100
nearResistance = math.abs(high - resistZone) < syminfo.mintick * 100
plot(supportZone, 'Ho tro', color = color.gray)
plot(resistZone, 'Khang cu', color = color.orange)
//===Mo hinh nen dao chieu tang & giam===
//Bullish: Hammer, Engulfing, piercing
body = math.abs(close - open)
avgbody = ta.sma(body, length)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
isHammerUp = lowerWick > 2 * body and upperWick < body and close > open
//engulfingUp = close < open and close > open and close > open and open < close
piercingUp = close > open and open < close and close > (open + close ) / 2
bullishCandle = isHammerUp or isBullEngulfing or piercingUp
//Bearish: Inverted Hammer, Bearish Engulfing, Dark cloud Cover
isHammerDow = upperWick > 2 * body and lowerWick < body and close < open
//engulfingDow = close > open and close < open and close < open and open > close
darkCloud = close < open and open > close and close < (open + close ) / 2
bearishCandle = isHammerDow or isBearishEngulfing or darkCloud
//========================================================================
//===Chi bao RSI & Volume===
rsi = ta.rsi(close, 14)
oversold = rsi < rsiOversold
overbought = rsi > rsiOverbought
avgVol = ta.sma(volume, 20)
volumeSpike = volume > avgVol * volMultiplier
rsiLL = rsi < rsiLow
rsiHH = rsi > rsiHigh
// nen rut chan 50%
fibo50=high/2+low/2
Pinbarbullish=close>fibo50 and open>fibo50 and volumeSpike and rsiLL // and close ta.ema(close,89)
plotshape(Pinbarbullish, style = shape.labelup, location = location.belowbar, color = color.green, text = 'L', textcolor = color.white, size = size.tiny)
plotshape(Pinbarbearish, style = shape.labeldown, location = location.abovebar, color = color.red, text = 'S', textcolor = color.white, size = size.tiny)
if Pinbarbullish
alert('Pin Bar dao chieu tang', alert.freq_once_per_bar_close)
if Pinbarbearish
alert('Pin Bar dao chieu giam', alert.freq_once_per_bar_close)
//===dieu kien tin hieu===
buySignal = bullishCandle and oversold and volumeSpike and nearSupport
sellSignal = bearishCandle and overbought and volumeSpike and nearResistance
//Canh bao nag cao
if buySignal
alert('Tin hieu MUA manh:Nen dao chieu tai vung ho tro kem RSI thap & Volume lon(LONG)', alert.freq_once_per_bar_close)
if sellSignal
alert('Tin hieu BAN manh:Nen dao chieu tai vung khang cu kem RSI cao & Volume lon(SHORT)', alert.freq_once_per_bar_close)
//===Hien canh bao===
alertcondition(buySignal, title = 'Tin hieu MUA', message = 'Nen dao chieu TANG tai vung ho tro(RSI thap + Volume lon)')
alertcondition(sellSignal, title = 'Tin hieu BAN', message = 'Nen dao chieu GIAM tai vung ho(RSI cao + Volume lon)')
plotshape(buySignal, style = shape.triangleup, location = location.belowbar, color = color.green, text = 'Long', textcolor = color.white)
plotshape(sellSignal, style = shape.triangledown, location = location.abovebar, color = color.red, text = 'Short', textcolor = color.white)
//Pin Bar ket hop volume lon & RSI qua mua / qua ban
isStrongBullPin = close > open and high - close > 2 * (close - open) and volume > volAvg * volMultiplier and rsi < rsiOversold
isStrongBearPin = open > close and close - low > 2 * (open - close) and volume > volAvg * volMultiplier and rsi > rsiOverbought
plotshape(isStrongBullPin, title = 'Canh bao Pinbar MUA manh', location = location.belowbar, color = color.green, style = shape.labelup, text = "Pb Mua", textcolor = color.white)
plotshape(isStrongBearPin, title = 'Canh bao Pinbar BAN manh', location = location.abovebar, color = color.red, style = shape.labeldown, text = 'Pb Ban', textcolor = color.white)
alertcondition(isStrongBullPin, title = 'Canh bao PinBar MUA manh', message = 'Phat hien PinBar MUA manh(vol cao + RSI qua ban)')
alertcondition(isStrongBearPin, title = 'Canh bao PInBar BAN manh', message = 'Phat hien PinBar BAN manh(vol cao+ RSI qua mua)')
if isStrongBullPin
alert('Pin Bar tin hieu mua:Phat hien PinBar MUA manh(vol cao + RSI qua ban)', alert.freq_once_per_bar_close)
if isStrongBearPin
alert('Pin Bar tin hieu ban:Phat hien PinBar BAN manh(vol cao+ RSI qua mua)', alert.freq_once_per_bar_close)
//================================================================
bool pv2_sv = input.bool (true, title='Plot 2nd order pivots')
bool msb_sv = input.bool (true, title='Plot MSB lines')
bool box_sv = input.bool (true, title='Plot Orderblocks')
bool m_sv = input.bool (true, title='Plot Breakerblocks')
bool range_sv = input.bool (true, title='Plot Range')
bool range_eq_sv = input.bool (true, title='Plot Range 0.5 Line')
bool range_q_sv = input.bool (true, title='Plot Range 0.25 and 0.75 Lines')
bool log_sv = input.bool (true, title='Use Log Scale')
bool msb_a_sv = input.bool (true, title='Alert MSB')
bool ob_a_sv = input.bool (true, title='Alert Orderblock test')
bool bb_a_sv = input.bool (true, title='Alert Breakerblock test')
bool r_a_sv = input.bool (true, title='Alert New Range')
bool rt_a_sv = input.bool (true, title='Alert Range test')
color u_s = input.color (color.new(color.red,90), title='Untested Supply Color')
color t_s = input.color (color.new(color.red,70), title='Tested Supply Color')
color u_d = input.color (color.new(color.green,90), title='Untested Demand Color')
color t_d = input.color (color.new(color.green,70), title='Tested Demand Color')
color u_b = input.color ( color.new(color.blue,90), title='Untested Breaker Color')
color t_b = input.color (color.new(color.blue, 70), title='Tested Breaker Color')
var float pvh1_price = array.new_float (30, na) // high
var int pvh1_time = array.new_int (30, na)
var float pvl1_price = array.new_float (30, na) // low
var int pvl1_time = array.new_int (30, na)
var float pvh2_price = array.new_float (10, na) // higher high
var int pvh2_time = array.new_int (10, na)
var float pvl2_price = array.new_float (10, na) // lower low
var int pvl2_time = array.new_int (10, na)
var float htcmrll_price = na // high that created most recent ll
var int htcmrll_time = na
var float ltcmrhh_price = na // low that created most recent hh
var int ltcmrhh_time = na
var box long_boxes = array.new_box() // orderblocks
var box short_boxes = array.new_box()
var box m_long_boxes = array.new_box() // breakerblocks
var box m_short_boxes = array.new_box()
var line bull_bos_lines = array.new_line() // MSB lines
var line bear_bos_lines = array.new_line()
var line range_h_lines = array.new_line() // Range lines
var line range_25_lines = array.new_line()
var line range_m_lines = array.new_line()
var line range_75_lines = array.new_line()
var line range_l_lines = array.new_line()
var label la_ph2 = array.new_label() // 2nd order pivots
var label la_pl2 = array.new_label()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
var int temp_time = na
var float last_range_h = na
var float last_range_l = na
var line range_m = na
var line range_25 = na
var line range_75 = na
var float box_top = na
var float box_bottom = na
var int h_a_time = 0
var int l_a_time = 0
var int mh_a_time = 0
var int ml_a_time = 0
var int rh_a_time = 0
var int rl_a_time = 0
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
bool new_ph_2nd = false
bool new_pl_2nd = false
string alert = na
if barstate.isconfirmed
if pvh
array.pop(pvh1_price)
array.pop(pvh1_time)
array.unshift(pvh1_price, pv1_high)
array.unshift(pvh1_time, pv1_time)
if array.size(pvh1_price) > 2
temp_pv_0 := array.get(pvh1_price, 0)
temp_pv_1 := array.get(pvh1_price, 1)
temp_pv_2 := array.get(pvh1_price, 2)
if temp_pv_0 < temp_pv_1 and temp_pv_1 > temp_pv_2
array.pop(pvh2_price)
array.pop(pvh2_time)
array.unshift(pvh2_price, temp_pv_1)
array.unshift(pvh2_time, array.get(pvh1_time, 1))
new_ph_2nd := true
if temp_pv_1 > array.get(pvh2_price, 1)
for i = 0 to array.size(pvl2_time) - 1 by 1
temp_ltcmrhh_time = array.get(pvl2_time, i)
if temp_ltcmrhh_time < array.get(pvh2_time, 0)
ltcmrhh_price := array.get(pvl2_price, i)
ltcmrhh_time := temp_ltcmrhh_time
break
if temp_pv_0 < ltcmrhh_price
if msb_sv
array.push(bear_bos_lines, line.new(x1=ltcmrhh_time, y1=ltcmrhh_price, x2=bar_index, y2=ltcmrhh_price, color=color.rgb(11, 238, 18), width=3))
box_top := array.get(pvh2_price, 0)
box_bottom := math.max(low , low )
array.push(short_boxes, box.new(left=array.get(pvh2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_s : na ,border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bearish MSB @ ' + str.tostring(ltcmrhh_price) + ' ' + 'New Supply Zone : '+ str.tostring(box_top) + ' - ' + str.tostring(box_bottom) + ' '
ltcmrhh_price := na
if pvl
array.pop(pvl1_price)
array.pop(pvl1_time)
array.unshift(pvl1_price, pv1_low)
array.unshift(pvl1_time, pv1_time)
if array.size(pvl1_price) > 2
temp_pv_0 := array.get(pvl1_price, 0)
temp_pv_1 := array.get(pvl1_price, 1)
temp_pv_2 := array.get(pvl1_price, 2)
if temp_pv_0 > temp_pv_1 and temp_pv_1 < temp_pv_2
array.pop(pvl2_price)
array.pop(pvl2_time)
array.unshift(pvl2_price, temp_pv_1)
array.unshift(pvl2_time, array.get(pvl1_time, 1))
new_pl_2nd := true
if temp_pv_1 < array.get(pvl2_price, 1)
for i = 0 to array.size(pvh2_time) - 1 by 1
temp_htcmrll_time = array.get(pvh2_time, i)
if temp_htcmrll_time < array.get(pvl2_time, 0)
htcmrll_price := array.get(pvh2_price, i)
htcmrll_time := temp_htcmrll_time
break
if temp_pv_0 > htcmrll_price
if msb_sv
array.push(bull_bos_lines, line.new(x1=htcmrll_time, y1=htcmrll_price, x2=bar_index, y2=htcmrll_price, color=color.rgb(236, 5, 5), width=3))
box_top := math.min(high , high )
box_bottom := array.get(pvl2_price, 0)
array.push(long_boxes, box.new(left=array.get(pvl2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_d : na, border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bullish MSB @ ' + str.tostring(htcmrll_price) + ' ' + 'New Demand Zone : '+ str.tostring(box_bottom) + ' - ' + str.tostring(box_top) + ' '
htcmrll_price := na
if array.size(short_boxes) > 0
for i = array.size(short_boxes) - 1 to 0 by 1
tbox = array.get(short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
if box_sv
box.set_bgcolor(tbox, t_s)
if ob_a_sv and close < bottom
if array.get(pvh1_time, 0) != h_a_time
h_a_time := array.get(pvh1_time, 0)
alert := alert + 'Supply Zone Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
if m_sv
box.set_bgcolor(tbox, u_b)
array.push(m_long_boxes, tbox)
else
box.delete(tbox)
array.remove(short_boxes, i)
if msb_sv
line.delete(array.get(bear_bos_lines, i))
array.remove(bear_bos_lines, i)
if array.size(long_boxes) > 0
for i = array.size(long_boxes) - 1 to 0 by 1
lbox = array.get(long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
if box_sv
box.set_bgcolor(lbox, t_d)
if ob_a_sv and close > top
if array.get(pvl1_time, 0) != l_a_time
l_a_time := array.get(pvl1_time, 0)
alert := alert + 'Demand Zone Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
if m_sv
box.set_bgcolor(lbox, u_b)
array.push(m_short_boxes, lbox)
else
box.delete(lbox)
array.remove(long_boxes, i)
if msb_sv
line.delete(array.get(bull_bos_lines, i))
array.remove(bull_bos_lines, i)
if array.size(m_short_boxes) > 0
for i = array.size(m_short_boxes) - 1 to 0 by 1
tbox = array.get(m_short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
box.set_bgcolor(tbox, t_b)
if bb_a_sv and close < bottom
if array.get(pvh1_time, 0) != mh_a_time
mh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Breakerblock Test Up @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
box.delete(tbox)
array.remove(m_short_boxes, i)
if array.size(m_long_boxes) > 0
for i = array.size(m_long_boxes) - 1 to 0 by 1
lbox = array.get(m_long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
box.set_bgcolor(lbox, t_b)
if bb_a_sv and close > top
if array.get(pvl1_time, 0) != ml_a_time
ml_a_time := array.get(pvl1_time, 0)
alert := alert + 'Breakerblock Test Down @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
box.delete(lbox)
array.remove(m_long_boxes, i)
if range_sv and (new_ph_2nd or new_pl_2nd) and (array.get(pvh2_price, 0) < array.get(pvh2_price, 1) and array.get(pvl2_price, 0) > array.get(pvl2_price, 1) and array.get(pvh2_price, 0) > array.get(pvl2_price, 1) and array.get(pvl2_price, 0) < array.get(pvh2_price, 1)) and (array.get(pvl2_price, 1) > nz(last_range_h) or na(last_range_l)? true : (array.get(pvh2_price, 1) < last_range_l))
temp_time := math.min(array.get(pvh2_time, 1), array.get(pvl2_time, 1))
last_range_h := array.get(pvh2_price, 1)
last_range_l := array.get(pvl2_price, 1)
temp_pv_0 := log_sv ? math.exp((math.log(last_range_h) + math.log(last_range_l))/2) : (last_range_h + last_range_l)/2
temp_pv_1 := log_sv ? math.exp((math.log(last_range_h) + math.log(temp_pv_0))/2) : (last_range_h + temp_pv_0)/2
temp_pv_2 := log_sv ? math.exp((math.log(last_range_l) + math.log(temp_pv_0))/2) : (last_range_l + temp_pv_0)/2
array.push(range_h_lines, line.new(x1=temp_time, y1=last_range_h, x2=bar_index, y2=last_range_h, color= color.white, width=2, extend=extend.right))
array.push(range_l_lines, line.new(x1=temp_time, y1=last_range_l, x2=bar_index, y2=last_range_l, color= color.white, width=2, extend=extend.right))
if range_eq_sv
array.push(range_m_lines, line.new(x1=temp_time, y1=temp_pv_0, x2=bar_index, y2=temp_pv_0, color= color.rgb(246, 6, 6), width=2, extend=extend.right))
if range_q_sv
array.push(range_25_lines, line.new(x1=temp_time, y1=temp_pv_1, x2=bar_index, y2=temp_pv_1, style=line.style_dashed, color=color.rgb(1, 54, 249), width=2, extend=extend.right))
array.push(range_75_lines, line.new(x1=temp_time, y1=temp_pv_2, x2=bar_index, y2=temp_pv_2, style=line.style_dashed, color=color.rgb(1, 54, 249), width=2, extend=extend.right))
if r_a_sv
alert := alert + 'New Range : ' + str.tostring(last_range_h) + ' - ' + str.tostring(last_range_l) + '. Mean = ' + str.tostring(temp_pv_0) + ' '
if array.size(range_h_lines) > 0
for i = array.size(range_h_lines) - 1 to 0 by 1
range_h = array.get(range_h_lines, i)
top = line.get_y1(range_h)
range_l = array.get(range_l_lines, i)
bottom = line.get_y1(range_l)
temp_time := line.get_x1(range_h)
if array.get(pvh1_price, 0) > top
if rt_a_sv and close < top
if array.get(pvh1_time, 0) != rh_a_time
rh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Range High Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' '
if array.get(pvl1_price, 0) < bottom
if rt_a_sv and close > bottom
if array.get(pvl1_time, 0) != rl_a_time
rl_a_time := array.get(pvl1_time, 0)
alert := alert + 'Range Low Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' '
if range_eq_sv
range_m := array.get(range_m_lines, i)
if range_q_sv
range_25 := array.get(range_25_lines, i)
range_75 := array.get(range_75_lines, i)
if array.get(pvh1_price, 0) < bottom or array.get(pvl1_price, 0) > top
line.delete(range_h)
array.remove(range_h_lines, i)
line.delete(range_l)
array.remove(range_l_lines, i)
if range_eq_sv
line.delete(range_m)
array.remove(range_m_lines, i)
if range_q_sv
line.delete(range_25)
array.remove(range_25_lines, i)
line.delete(range_75)
array.remove(range_75_lines, i)
last_range_h := na
last_range_l := na
if pv2_sv
if new_ph_2nd
array.push(la_ph2, label.new(x = array.get(pvh2_time, 0), y = array.get(pvh2_price, 0), xloc = xloc.bar_index, style = label.style_label_down, color = #770000FF, size = size.tiny))
if new_pl_2nd
array.push(la_pl2, label.new(x = array.get(pvl2_time, 0), y = array.get(pvl2_price, 0), xloc = xloc.bar_index, style = label.style_label_up, color = #007700FF, size = size.tiny))
alert := not na(alert) ? (alert + 'Current price = ' + str.tostring(close) + ' ') : na
exec = not na(alert) ? true : false
//if exec==true
//alert(alert, alert.freq_once_per_bar_close)
//xac dinh dieu kien khoi luong lon
// mau cay nen mua
buyCandle = close > open and volumeSpike ? color.rgb(4, 128, 8) : na
// mau cay nen ban
sellCandle = close < open and volumeSpike ? color.rgb(147, 23, 230) : na
// ve nen tuy chinh
plotcandle(open, high, low, close, color = buyCandle, title = "Buy Candle")
plotcandle(open, high, low, close, color = sellCandle, title = "Sell Candle")
//plot(close)
//=== Lọc pin bar intraday ===
isIntraday = timeframe.multiplier >= 15 and timeframe.multiplier <= 60 // M15 đến H1
//isPinBar = math.abs(close - open) / math.abs(high - low) < 0.2
volSpike = volume > ta.sma(volume, 20) * 1.5
//rsi = ta.rsi(close, 14)
rsiExtreme = rsi < 30 or rsi > 70
//nearSupport = math.abs(low - ta.lowest(low, 20)) < syminfo.mintick * 100
//nearResistance = math.abs(high - ta.highest(high, 20)) < syminfo.mintick * 100
validBullPin = isPinBar and close > open and high - close > 2 * (close - open) and volSpike and rsi < 30 and nearSupport and isIntraday
validBearPin = isPinBar and open > close and close - low > 2 * (open - close) and volSpike and rsi > 70 and nearResistance and isIntraday
plotshape(validBullPin, location = location.belowbar, style = shape.labelup, color = color.green, text = "PB M15-H1")
plotshape(validBearPin, location = location.abovebar, style = shape.labeldown, color = color.red, text = "PB M15-H1")
alertcondition(validBullPin, title = "Pin Bar MUA intraday", message = "Phát hiện Pin Bar MUA mạnh (M15-H1)")
if validBullPin
alert("Pin bar MUA intraday : Phát hiện Pin Bar MUA mạnh (M15-H1)", alert.freq_once_per_bar_close)
alertcondition(validBearPin, title = "Pin Bar BÁN intraday", message = "Phát hiện Pin Bar BÁN mạnh (M15-H1)")
if validBearPin
alert("Pin bar BAN Intrday : Phát hiện Pin Bar BÁN mạnh (M15-H1)", alert.freq_once_per_bar_close)
//=======- Dùng H1 để xác định xu hướng, M15 để vào lệnh.
//Nếu pin bar xuất hiện ở H1, bạn có thể chờ xác nhận phá đỉnh/đáy ở M15 để vào lệnh.
//Kết hợp thêm EMA hoặc vùng cung cầu để tăng độ tin cậy
//====================================
trendUp = ema34 > ema89
trendDow = ema34 < ema89
//tin hieu vao lenh
enterLong = validBullPin and close > high and trendUp
enterShort = validBearPin and close < low and trendDow
plotshape(enterLong, location = location.belowbar, style = shape.triangleup, color = color.lime, text = "Long", textcolor = color.white)
plotshape(enterShort, location = location.abovebar, style = shape.triangledown, color = color.fuchsia, text = "Short", textcolor = color.white)
if enterLong
alert("Vao lenh Long: Pin Bar + Pha dinh + EMA xac nhan", alert.freq_once_per_bar_close)
if enterShort
alert("Vao lenh Short: Pin Bar + Pha day + EMA xac nhan", alert.freq_once_per_bar_close)
//==================================================================================
// === Hiển thị tín hiệu Cạn cung ===
//plotshape(supplyDryUp, title = 'Cạn cung', location = location.belowbar, color = color.yellow, style = shape.circle, size = size.small)
alertcondition(supplyDryUp, title = 'Cảnh báo cạn cung', message = 'Phát hiện dấu hiệu cạn cung: khối lượng thấp + giá đi ngang + biên độ hẹp')
// === Kết hợp với tín hiệu mua/bán để tăng độ tin cậy ===
buySignalCC = buySignal and supplyDryUp
sellSignalCC = sellSignal and supplyDryUp
plotshape(buySignalCC, title = 'Mua + Cạn cung', location = location.belowbar, color = color.lime, style = shape.triangleup, text = 'Long CC', textcolor = color.white)
plotshape(sellSignalCC, title = 'Bán + Cạn cung', location = location.abovebar, color = color.fuchsia, style = shape.triangledown, text = 'Short CC', textcolor = color.white)
alertcondition(buySignalCC, title = 'Mua mạnh + Cạn cung', message = 'Tín hiệu MUA mạnh kết hợp dấu hiệu cạn cung')
alertcondition(sellSignalCC, title = 'Bán mạnh + Cạn cung', message = 'Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cung')
if buySignalCC
alert('Mua mạnh + Cạn cung : Tín hiệu MUA mạnh kết hợp dấu hiệu cạn cung', alert.freq_once_per_bar_close)
if sellSignalCC
alert('Bán mạnh + Cạn cung : Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cung', alert.freq_once_per_bar_close)
// === Hiển thị tín hiệu Cạn cầu ===
//plotshape(demandDryUp, title = 'Cạn cầu', location = location.abovebar, color = color.orange, style = shape.circle, size = size.small)
alertcondition(demandDryUp, title = 'Cảnh báo cạn cầu', message = 'Phát hiện dấu hiệu cạn cầu: khối lượng thấp + giá không tăng + biên độ hẹp')
// === Kết hợp với tín hiệu bán để tăng độ tin cậy ===
sellSignalCD = sellSignal and demandDryUp
plotshape(sellSignalCD, title = 'Bán + Cạn cầu', location = location.abovebar, color = color.red, style = shape.triangledown, text = 'Short CCầu', textcolor = color.white)
alertcondition(sellSignalCD, title = 'Bán mạnh + Cạn cầu', message = 'Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cầu')
if sellSignalCD
alert('Bán mạnh + Cạn cầu : Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cầu', alert.freq_once_per_bar_close)
//====================================================
ICT SMC By VIPIN | Volume OB + BOS, CHoCH, FVG, Sweep VTTitle:
Smart Money Concepts Pro – OB, FVG, BOS, CHoCH & Liquidity Sweep
Description:
This indicator is built on Smart Money Concepts (SMC) and is designed to help traders analyze market structure in depth. It identifies institutional trading levels, potential reversal points, and high-probability trade setups using advanced price action techniques.
Key Features:
1. Order Blocks (OB) – Detects and marks bullish and bearish order blocks to identify possible reversal and continuation zones.
2. Fair Value Gaps (FVG) – Highlights price imbalances that often attract price retracements.
3. Break of Structure (BOS) – Marks structural breaks that confirm trend continuation.
4. Change of Character (CHoCH) – Signals early signs of trend reversal.
5. Liquidity Sweep – Highlights buy-side and sell-side liquidity grabs to identify stop hunts and false breakouts.
6. Custom Styling & Filters – Users can customize colors, sizes, and filter settings for better clarity.
How It Works:
• The indicator automatically detects market structure (HH, HL, LH, LL) and identifies BOS and CHoCH based on price movement.
• Order Blocks are filtered using past price action and volume confluence to show only significant zones.
• Fair Value Gaps and Liquidity Sweeps are detected with a smart logic system for improved accuracy.
How to Use:
• Use higher timeframes (H1, H4, Daily) to determine the main trend and lower timeframes (M15, M5) for entries.
• Combine Order Blocks and FVGs for strong confluence.
• Wait for BOS/CHoCH confirmations along with liquidity sweep signals before entering trades.
Disclaimer:
This tool is for chart analysis assistance only. Always conduct your own research and apply proper risk management before trading.
Reversal Strategy (RSI & Volume & Automantic support resistance)// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © RoseZero
//@version=6
indicator('Chien luoc dao chieu manh(RSI + Volume + Ho tro auto)', overlay = true)
//===Tham so nguoi dung===
rsiOversold = input.int(30, 'Nguong RSI qua ban')
rsiOverbought = input.int(70, 'Nguong RSI qua mua')
rsiLow = input.int(35, 'Nguong qua ban')
rsiHigh = input.int(55, 'Nguong qua mua')
volMultiplier = input.float(1.5, 'nguong khoi luong tang (so voi TB)')
mult = input.float(1.5, 'Nguong nhan do lon nen', step = 0.1)
supportLength = input.int(20, 'Do dai vung ho tro')
resistLength = input.int(20, 'Do dai vung khang cu')
length = input.int(20, 'So nen trung binh')
volume_threshold = input.float(1.2, title = 'Nguong volume dao chieu')
fastEMA = input.int(21, title = 'EMA nhanh')
slowEMA = input.int(55, title = 'EMA cham')
depth = input.int(3, title = 'Pivot Depth')
rsiLen = input.int(14, title = 'RSI Length')
//==============================================================================
// === Dấu hiệu Cạn Cung ===
lowVolMultiplier = input.float(0.5, title = 'Ngưỡng khối lượng thấp (Cạn cung)')
lowRangeMultiplier = input.float(0.7, title = 'Ngưỡng biên độ giá thấp (Cạn cung)')
avgVolCC = ta.sma(volume, 20)
avgRangeCC = ta.sma(high - low, 20)
isLowVolume = volume < avgVolCC * lowVolMultiplier
isNarrowRange = (high - low) < avgRangeCC * lowRangeMultiplier
isSideways = math.abs(close - close ) < avgRangeCC * 0.3
supplyDryUp = isLowVolume and isNarrowRange and isSideways
// === Dấu hiệu Cạn Cầu ===
lowVolMultiplier2 = input.float(0.5, title = 'Ngưỡng khối lượng thấp (Cạn cầu)')
lowRangeMultiplier2 = input.float(0.7, title = 'Ngưỡng biên độ giá thấp (Cạn cầu)')
avgVolCD = ta.sma(volume, 20)
avgRangeCD = ta.sma(high - low, 20)
isLowVolumeCD = volume < avgVolCD * lowVolMultiplier2
isNarrowRangeCD = (high - low) < avgRangeCD * lowRangeMultiplier2
isWeakDemand = close <= close or close - close < avgRangeCD * 0.2
demandDryUp = isLowVolumeCD and isNarrowRangeCD and isWeakDemand
//=====================================================================================
ema34 = ta.ema(close, 34)
ema89 = ta.ema(close, 89)
volAvg = ta.sma(volume, 20)
plot(ema34, color = color.green, title = 'EMA 34')
plot(ema89, color = color.orange, title = 'EMA 89')
emaUp = ta.crossover(ema34, ema89)
emaDow = ta.crossunder(ema34, ema89)
alertcondition(emaUp, title = 'EMA34 cat len tren EMA89', message = 'EMA34 cat len tren EMA89 xu huong gia di len')
alertcondition(emaDow, title = 'EMA34 cat xuong duoi EMA89', message = 'EMA34 cat xuong duoi EMA*9 xu huong gia di xuong')
// dieu kien pha len ema va nguoc lai============================================================================================================
breakoutEma = close < ema34 and close < ema89 and close > ema34 and close > ema89
breakdownEma = close > ema34 and close > ema89 and close < ema34 and close < ema89
//dieu kien test lai EMA sau break
retestUpEma = breakoutEma and close < ema34 * 1.02 and close > ema89 * 0.98
retestDownEma = breakdownEma and close > ema34 * 0.98 and close < ema89 * 1.02
//canh bao gia test lai cum ema
alertcondition(retestUpEma, title = 'Canh bao test lai EMA gia tang', message = 'Gia dang test lai cum EMA khi gia tang')
alertcondition(retestDownEma, title = 'Canh bao test lai EMA gia giam', message = 'Gia dang test lai cum EMA khi gia giam')
//Tinh toan co bao Pivot
pivotHigh = ta.pivothigh(high, depth, depth)
pivotLow = ta.pivotlow(low, depth, depth)
ema = ta.ema(close, fastEMA)
ma = ta.sma(close, slowEMA)
rsii = ta.rsi(close, rsiLen)
//Volume Breakout check
volStrong = volume > ta.sma(volume, 20) * volume_threshold
//Mo hinh nen : Pinbar, Engulfing, Doji
isPinBar = math.abs(close - open) / math.abs(high - low) < 0.2
isBullEngulfing = close > open and open < close and close > open
isBearishEngulfing = close < open and open > close and close < open
isDoji = math.abs(close - open) / math.abs(high - low) < 0.1
//Dao chieu tang manh va giam manh
candlePattern = isPinBar or isBullEngulfing or isDoji
candlePattern2 = isPinBar or isBearishEngulfing or isDoji
priceCondition = close > ema and close > ma and rsii < 30 and volStrong
priceCondition2 = close < ema and close < ma and rsii > 70 and volStrong
bullishSignal = not na(pivotLow) and candlePattern and priceCondition and volStrong
if bullishSignal
alert('Dao chieu tang manh: Xuat hien nen dao chieu Tang(PInBar, BullishEngulf, Doji)', alert.freq_once_per_bar_close)
bearishSignal = not na(pivotHigh) and candlePattern2 and priceCondition2 and volStrong
if bearishSignal
alert('Dao chieu giam manh: Xuat hien nen dao chieu Giam(PinBar, BearishEngul, Doji)', alert.freq_once_per_bar_close)
//EMA & Trend
emaFast = ta.ema(close, fastEMA)
emaSlow = ta.ema(close, slowEMA)
plot(emaFast, title = 'EMA nhanh', color = color.blue)
plot(emaSlow, 'EMA cham', color = color.purple)
//===Ho tro tu dong===
supportZone = ta.lowest(low, supportLength)
resistZone = ta.highest(high, resistLength)
nearSupport = math.abs(low - supportZone) < syminfo.mintick * 100
nearResistance = math.abs(high - resistZone) < syminfo.mintick * 100
plot(supportZone, 'Ho tro', color = color.gray)
plot(resistZone, 'Khang cu', color = color.orange)
//===Mo hinh nen dao chieu tang & giam===
//Bullish: Hammer, Engulfing, piercing
body = math.abs(close - open)
avgbody = ta.sma(body, length)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
isHammerUp = lowerWick > 2 * body and upperWick < body and close > open
//engulfingUp = close < open and close > open and close > open and open < close
piercingUp = close > open and open < close and close > (open + close ) / 2
bullishCandle = isHammerUp or isBullEngulfing or piercingUp
//Bearish: Inverted Hammer, Bearish Engulfing, Dark cloud Cover
isHammerDow = upperWick > 2 * body and lowerWick < body and close < open
//engulfingDow = close > open and close < open and close < open and open > close
darkCloud = close < open and open > close and close < (open + close ) / 2
bearishCandle = isHammerDow or isBearishEngulfing or darkCloud
//========================================================================
//===Chi bao RSI & Volume===
rsi = ta.rsi(close, 14)
oversold = rsi < rsiOversold
overbought = rsi > rsiOverbought
avgVol = ta.sma(volume, 20)
volumeSpike = volume > avgVol * volMultiplier
rsiLL = rsi < rsiLow
rsiHH = rsi > rsiHigh
// nen rut chan 50%
fibo50=high/2+low/2
Pinbarbullish=close>fibo50 and open>fibo50 and volumeSpike and rsiLL // and close ta.ema(close,89)
plotshape(Pinbarbullish, style = shape.labelup, location = location.belowbar, color = color.green, text = 'L', textcolor = color.white, size = size.tiny)
plotshape(Pinbarbearish, style = shape.labeldown, location = location.abovebar, color = color.red, text = 'S', textcolor = color.white, size = size.tiny)
if Pinbarbullish
alert('Pin Bar dao chieu tang', alert.freq_once_per_bar_close)
if Pinbarbearish
alert('Pin Bar dao chieu giam', alert.freq_once_per_bar_close)
//===dieu kien tin hieu===
buySignal = bullishCandle and oversold and volumeSpike and nearSupport
sellSignal = bearishCandle and overbought and volumeSpike and nearResistance
//Canh bao nag cao
if buySignal
alert('Tin hieu MUA manh:Nen dao chieu tai vung ho tro kem RSI thap & Volume lon(LONG)', alert.freq_once_per_bar_close)
if sellSignal
alert('Tin hieu BAN manh:Nen dao chieu tai vung khang cu kem RSI cao & Volume lon(SHORT)', alert.freq_once_per_bar_close)
//===Hien canh bao===
alertcondition(buySignal, title = 'Tin hieu MUA', message = 'Nen dao chieu TANG tai vung ho tro(RSI thap + Volume lon)')
alertcondition(sellSignal, title = 'Tin hieu BAN', message = 'Nen dao chieu GIAM tai vung ho(RSI cao + Volume lon)')
plotshape(buySignal, style = shape.triangleup, location = location.belowbar, color = color.green, text = 'Long', textcolor = color.white)
plotshape(sellSignal, style = shape.triangledown, location = location.abovebar, color = color.red, text = 'Short', textcolor = color.white)
//Pin Bar ket hop volume lon & RSI qua mua / qua ban
isStrongBullPin = close > open and high - close > 2 * (close - open) and volume > volAvg * volMultiplier and rsi < rsiOversold
isStrongBearPin = open > close and close - low > 2 * (open - close) and volume > volAvg * volMultiplier and rsi > rsiOverbought
plotshape(isStrongBullPin, title = 'Canh bao Pinbar MUA manh', location = location.belowbar, color = color.green, style = shape.labelup, text = "Pb Mua", textcolor = color.white)
plotshape(isStrongBearPin, title = 'Canh bao Pinbar BAN manh', location = location.abovebar, color = color.red, style = shape.labeldown, text = 'Pb Ban', textcolor = color.white)
alertcondition(isStrongBullPin, title = 'Canh bao PinBar MUA manh', message = 'Phat hien PinBar MUA manh(vol cao + RSI qua ban)')
alertcondition(isStrongBearPin, title = 'Canh bao PInBar BAN manh', message = 'Phat hien PinBar BAN manh(vol cao+ RSI qua mua)')
if isStrongBullPin
alert('Pin Bar tin hieu mua:Phat hien PinBar MUA manh(vol cao + RSI qua ban)', alert.freq_once_per_bar_close)
if isStrongBearPin
alert('Pin Bar tin hieu ban:Phat hien PinBar BAN manh(vol cao+ RSI qua mua)', alert.freq_once_per_bar_close)
//================================================================
bool pv2_sv = input.bool (true, title='Plot 2nd order pivots')
bool msb_sv = input.bool (true, title='Plot MSB lines')
bool box_sv = input.bool (true, title='Plot Orderblocks')
bool m_sv = input.bool (true, title='Plot Breakerblocks')
bool range_sv = input.bool (true, title='Plot Range')
bool range_eq_sv = input.bool (true, title='Plot Range 0.5 Line')
bool range_q_sv = input.bool (true, title='Plot Range 0.25 and 0.75 Lines')
bool log_sv = input.bool (true, title='Use Log Scale')
bool msb_a_sv = input.bool (true, title='Alert MSB')
bool ob_a_sv = input.bool (true, title='Alert Orderblock test')
bool bb_a_sv = input.bool (true, title='Alert Breakerblock test')
bool r_a_sv = input.bool (true, title='Alert New Range')
bool rt_a_sv = input.bool (true, title='Alert Range test')
color u_s = input.color (color.new(color.red,90), title='Untested Supply Color')
color t_s = input.color (color.new(color.red,70), title='Tested Supply Color')
color u_d = input.color (color.new(color.green,90), title='Untested Demand Color')
color t_d = input.color (color.new(color.green,70), title='Tested Demand Color')
color u_b = input.color ( color.new(color.blue,90), title='Untested Breaker Color')
color t_b = input.color (color.new(color.blue, 70), title='Tested Breaker Color')
var float pvh1_price = array.new_float (30, na) // high
var int pvh1_time = array.new_int (30, na)
var float pvl1_price = array.new_float (30, na) // low
var int pvl1_time = array.new_int (30, na)
var float pvh2_price = array.new_float (10, na) // higher high
var int pvh2_time = array.new_int (10, na)
var float pvl2_price = array.new_float (10, na) // lower low
var int pvl2_time = array.new_int (10, na)
var float htcmrll_price = na // high that created most recent ll
var int htcmrll_time = na
var float ltcmrhh_price = na // low that created most recent hh
var int ltcmrhh_time = na
var box long_boxes = array.new_box() // orderblocks
var box short_boxes = array.new_box()
var box m_long_boxes = array.new_box() // breakerblocks
var box m_short_boxes = array.new_box()
var line bull_bos_lines = array.new_line() // MSB lines
var line bear_bos_lines = array.new_line()
var line range_h_lines = array.new_line() // Range lines
var line range_25_lines = array.new_line()
var line range_m_lines = array.new_line()
var line range_75_lines = array.new_line()
var line range_l_lines = array.new_line()
var label la_ph2 = array.new_label() // 2nd order pivots
var label la_pl2 = array.new_label()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
var int temp_time = na
var float last_range_h = na
var float last_range_l = na
var line range_m = na
var line range_25 = na
var line range_75 = na
var float box_top = na
var float box_bottom = na
var int h_a_time = 0
var int l_a_time = 0
var int mh_a_time = 0
var int ml_a_time = 0
var int rh_a_time = 0
var int rl_a_time = 0
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
bool new_ph_2nd = false
bool new_pl_2nd = false
string alert = na
if barstate.isconfirmed
if pvh
array.pop(pvh1_price)
array.pop(pvh1_time)
array.unshift(pvh1_price, pv1_high)
array.unshift(pvh1_time, pv1_time)
if array.size(pvh1_price) > 2
temp_pv_0 := array.get(pvh1_price, 0)
temp_pv_1 := array.get(pvh1_price, 1)
temp_pv_2 := array.get(pvh1_price, 2)
if temp_pv_0 < temp_pv_1 and temp_pv_1 > temp_pv_2
array.pop(pvh2_price)
array.pop(pvh2_time)
array.unshift(pvh2_price, temp_pv_1)
array.unshift(pvh2_time, array.get(pvh1_time, 1))
new_ph_2nd := true
if temp_pv_1 > array.get(pvh2_price, 1)
for i = 0 to array.size(pvl2_time) - 1 by 1
temp_ltcmrhh_time = array.get(pvl2_time, i)
if temp_ltcmrhh_time < array.get(pvh2_time, 0)
ltcmrhh_price := array.get(pvl2_price, i)
ltcmrhh_time := temp_ltcmrhh_time
break
if temp_pv_0 < ltcmrhh_price
if msb_sv
array.push(bear_bos_lines, line.new(x1=ltcmrhh_time, y1=ltcmrhh_price, x2=bar_index, y2=ltcmrhh_price, color=color.rgb(11, 238, 18), width=3))
box_top := array.get(pvh2_price, 0)
box_bottom := math.max(low , low )
array.push(short_boxes, box.new(left=array.get(pvh2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_s : na ,border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bearish MSB @ ' + str.tostring(ltcmrhh_price) + ' ' + 'New Supply Zone : '+ str.tostring(box_top) + ' - ' + str.tostring(box_bottom) + ' '
ltcmrhh_price := na
if pvl
array.pop(pvl1_price)
array.pop(pvl1_time)
array.unshift(pvl1_price, pv1_low)
array.unshift(pvl1_time, pv1_time)
if array.size(pvl1_price) > 2
temp_pv_0 := array.get(pvl1_price, 0)
temp_pv_1 := array.get(pvl1_price, 1)
temp_pv_2 := array.get(pvl1_price, 2)
if temp_pv_0 > temp_pv_1 and temp_pv_1 < temp_pv_2
array.pop(pvl2_price)
array.pop(pvl2_time)
array.unshift(pvl2_price, temp_pv_1)
array.unshift(pvl2_time, array.get(pvl1_time, 1))
new_pl_2nd := true
if temp_pv_1 < array.get(pvl2_price, 1)
for i = 0 to array.size(pvh2_time) - 1 by 1
temp_htcmrll_time = array.get(pvh2_time, i)
if temp_htcmrll_time < array.get(pvl2_time, 0)
htcmrll_price := array.get(pvh2_price, i)
htcmrll_time := temp_htcmrll_time
break
if temp_pv_0 > htcmrll_price
if msb_sv
array.push(bull_bos_lines, line.new(x1=htcmrll_time, y1=htcmrll_price, x2=bar_index, y2=htcmrll_price, color=color.rgb(236, 5, 5), width=3))
box_top := math.min(high , high )
box_bottom := array.get(pvl2_price, 0)
array.push(long_boxes, box.new(left=array.get(pvl2_time, 0), top=box_top, right=bar_index, bottom=box_bottom, bgcolor= box_sv ? u_d : na, border_color=na, extend=extend.right))
if msb_a_sv
alert := alert + 'Bullish MSB @ ' + str.tostring(htcmrll_price) + ' ' + 'New Demand Zone : '+ str.tostring(box_bottom) + ' - ' + str.tostring(box_top) + ' '
htcmrll_price := na
if array.size(short_boxes) > 0
for i = array.size(short_boxes) - 1 to 0 by 1
tbox = array.get(short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
if box_sv
box.set_bgcolor(tbox, t_s)
if ob_a_sv and close < bottom
if array.get(pvh1_time, 0) != h_a_time
h_a_time := array.get(pvh1_time, 0)
alert := alert + 'Supply Zone Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
if m_sv
box.set_bgcolor(tbox, u_b)
array.push(m_long_boxes, tbox)
else
box.delete(tbox)
array.remove(short_boxes, i)
if msb_sv
line.delete(array.get(bear_bos_lines, i))
array.remove(bear_bos_lines, i)
if array.size(long_boxes) > 0
for i = array.size(long_boxes) - 1 to 0 by 1
lbox = array.get(long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
if box_sv
box.set_bgcolor(lbox, t_d)
if ob_a_sv and close > top
if array.get(pvl1_time, 0) != l_a_time
l_a_time := array.get(pvl1_time, 0)
alert := alert + 'Demand Zone Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
if m_sv
box.set_bgcolor(lbox, u_b)
array.push(m_short_boxes, lbox)
else
box.delete(lbox)
array.remove(long_boxes, i)
if msb_sv
line.delete(array.get(bull_bos_lines, i))
array.remove(bull_bos_lines, i)
if array.size(m_short_boxes) > 0
for i = array.size(m_short_boxes) - 1 to 0 by 1
tbox = array.get(m_short_boxes, i)
top = box.get_top(tbox)
bottom = box.get_bottom(tbox)
ago = box.get_left(tbox)
if array.get(pvh1_price, 0) > bottom
box.set_bgcolor(tbox, t_b)
if bb_a_sv and close < bottom
if array.get(pvh1_time, 0) != mh_a_time
mh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Breakerblock Test Up @ ' + str.tostring(array.get(pvh1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvl1_price, 0) > top
box.delete(tbox)
array.remove(m_short_boxes, i)
if array.size(m_long_boxes) > 0
for i = array.size(m_long_boxes) - 1 to 0 by 1
lbox = array.get(m_long_boxes, i)
top = box.get_top(lbox)
bottom = box.get_bottom(lbox)
ago = box.get_left(lbox)
if array.get(pvl1_price, 0) < top
box.set_bgcolor(lbox, t_b)
if bb_a_sv and close > top
if array.get(pvl1_time, 0) != ml_a_time
ml_a_time := array.get(pvl1_time, 0)
alert := alert + 'Breakerblock Test Down @ ' + str.tostring(array.get(pvl1_price, 0)) + ' (age = ' + str.tostring(bar_index-ago) + ' bars) '
if array.get(pvh1_price, 0) < bottom
box.delete(lbox)
array.remove(m_long_boxes, i)
if range_sv and (new_ph_2nd or new_pl_2nd) and (array.get(pvh2_price, 0) < array.get(pvh2_price, 1) and array.get(pvl2_price, 0) > array.get(pvl2_price, 1) and array.get(pvh2_price, 0) > array.get(pvl2_price, 1) and array.get(pvl2_price, 0) < array.get(pvh2_price, 1)) and (array.get(pvl2_price, 1) > nz(last_range_h) or na(last_range_l)? true : (array.get(pvh2_price, 1) < last_range_l))
temp_time := math.min(array.get(pvh2_time, 1), array.get(pvl2_time, 1))
last_range_h := array.get(pvh2_price, 1)
last_range_l := array.get(pvl2_price, 1)
temp_pv_0 := log_sv ? math.exp((math.log(last_range_h) + math.log(last_range_l))/2) : (last_range_h + last_range_l)/2
temp_pv_1 := log_sv ? math.exp((math.log(last_range_h) + math.log(temp_pv_0))/2) : (last_range_h + temp_pv_0)/2
temp_pv_2 := log_sv ? math.exp((math.log(last_range_l) + math.log(temp_pv_0))/2) : (last_range_l + temp_pv_0)/2
array.push(range_h_lines, line.new(x1=temp_time, y1=last_range_h, x2=bar_index, y2=last_range_h, color= color.white, width=2, extend=extend.right))
array.push(range_l_lines, line.new(x1=temp_time, y1=last_range_l, x2=bar_index, y2=last_range_l, color= color.white, width=2, extend=extend.right))
if range_eq_sv
array.push(range_m_lines, line.new(x1=temp_time, y1=temp_pv_0, x2=bar_index, y2=temp_pv_0, color= color.rgb(246, 6, 6), width=2, extend=extend.right))
if range_q_sv
array.push(range_25_lines, line.new(x1=temp_time, y1=temp_pv_1, x2=bar_index, y2=temp_pv_1, style=line.style_dashed, color=color.rgb(1, 54, 249), width=2, extend=extend.right))
array.push(range_75_lines, line.new(x1=temp_time, y1=temp_pv_2, x2=bar_index, y2=temp_pv_2, style=line.style_dashed, color=color.rgb(1, 54, 249), width=2, extend=extend.right))
if r_a_sv
alert := alert + 'New Range : ' + str.tostring(last_range_h) + ' - ' + str.tostring(last_range_l) + '. Mean = ' + str.tostring(temp_pv_0) + ' '
if array.size(range_h_lines) > 0
for i = array.size(range_h_lines) - 1 to 0 by 1
range_h = array.get(range_h_lines, i)
top = line.get_y1(range_h)
range_l = array.get(range_l_lines, i)
bottom = line.get_y1(range_l)
temp_time := line.get_x1(range_h)
if array.get(pvh1_price, 0) > top
if rt_a_sv and close < top
if array.get(pvh1_time, 0) != rh_a_time
rh_a_time := array.get(pvh1_time, 0)
alert := alert + 'Range High Test @ ' + str.tostring(array.get(pvh1_price, 0)) + ' '
if array.get(pvl1_price, 0) < bottom
if rt_a_sv and close > bottom
if array.get(pvl1_time, 0) != rl_a_time
rl_a_time := array.get(pvl1_time, 0)
alert := alert + 'Range Low Test @ ' + str.tostring(array.get(pvl1_price, 0)) + ' '
if range_eq_sv
range_m := array.get(range_m_lines, i)
if range_q_sv
range_25 := array.get(range_25_lines, i)
range_75 := array.get(range_75_lines, i)
if array.get(pvh1_price, 0) < bottom or array.get(pvl1_price, 0) > top
line.delete(range_h)
array.remove(range_h_lines, i)
line.delete(range_l)
array.remove(range_l_lines, i)
if range_eq_sv
line.delete(range_m)
array.remove(range_m_lines, i)
if range_q_sv
line.delete(range_25)
array.remove(range_25_lines, i)
line.delete(range_75)
array.remove(range_75_lines, i)
last_range_h := na
last_range_l := na
if pv2_sv
if new_ph_2nd
array.push(la_ph2, label.new(x = array.get(pvh2_time, 0), y = array.get(pvh2_price, 0), xloc = xloc.bar_index, style = label.style_label_down, color = #770000FF, size = size.tiny))
if new_pl_2nd
array.push(la_pl2, label.new(x = array.get(pvl2_time, 0), y = array.get(pvl2_price, 0), xloc = xloc.bar_index, style = label.style_label_up, color = #007700FF, size = size.tiny))
alert := not na(alert) ? (alert + 'Current price = ' + str.tostring(close) + ' ') : na
exec = not na(alert) ? true : false
//if exec==true
//alert(alert, alert.freq_once_per_bar_close)
//xac dinh dieu kien khoi luong lon
// mau cay nen mua
buyCandle = close > open and volumeSpike ? color.rgb(4, 128, 8) : na
// mau cay nen ban
sellCandle = close < open and volumeSpike ? color.rgb(147, 23, 230) : na
// ve nen tuy chinh
plotcandle(open, high, low, close, color = buyCandle, title = "Buy Candle")
plotcandle(open, high, low, close, color = sellCandle, title = "Sell Candle")
//plot(close)
//=== Lọc pin bar intraday ===
isIntraday = timeframe.multiplier >= 15 and timeframe.multiplier <= 60 // M15 đến H1
//isPinBar = math.abs(close - open) / math.abs(high - low) < 0.2
volSpike = volume > ta.sma(volume, 20) * 1.5
//rsi = ta.rsi(close, 14)
rsiExtreme = rsi < 30 or rsi > 70
//nearSupport = math.abs(low - ta.lowest(low, 20)) < syminfo.mintick * 100
//nearResistance = math.abs(high - ta.highest(high, 20)) < syminfo.mintick * 100
validBullPin = isPinBar and close > open and high - close > 2 * (close - open) and volSpike and rsi < 30 and nearSupport and isIntraday
validBearPin = isPinBar and open > close and close - low > 2 * (open - close) and volSpike and rsi > 70 and nearResistance and isIntraday
plotshape(validBullPin, location = location.belowbar, style = shape.labelup, color = color.green, text = "PB M15-H1")
plotshape(validBearPin, location = location.abovebar, style = shape.labeldown, color = color.red, text = "PB M15-H1")
alertcondition(validBullPin, title = "Pin Bar MUA intraday", message = "Phát hiện Pin Bar MUA mạnh (M15-H1)")
if validBullPin
alert("Pin bar MUA intraday : Phát hiện Pin Bar MUA mạnh (M15-H1)", alert.freq_once_per_bar_close)
alertcondition(validBearPin, title = "Pin Bar BÁN intraday", message = "Phát hiện Pin Bar BÁN mạnh (M15-H1)")
if validBearPin
alert("Pin bar BAN Intrday : Phát hiện Pin Bar BÁN mạnh (M15-H1)", alert.freq_once_per_bar_close)
//=======- Dùng H1 để xác định xu hướng, M15 để vào lệnh.
//Nếu pin bar xuất hiện ở H1, bạn có thể chờ xác nhận phá đỉnh/đáy ở M15 để vào lệnh.
//Kết hợp thêm EMA hoặc vùng cung cầu để tăng độ tin cậy
//====================================
trendUp = ema34 > ema89
trendDow = ema34 < ema89
//tin hieu vao lenh
enterLong = validBullPin and close > high and trendUp
enterShort = validBearPin and close < low and trendDow
plotshape(enterLong, location = location.belowbar, style = shape.triangleup, color = color.lime, text = "Long", textcolor = color.white)
plotshape(enterShort, location = location.abovebar, style = shape.triangledown, color = color.fuchsia, text = "Short", textcolor = color.white)
if enterLong
alert("Vao lenh Long: Pin Bar + Pha dinh + EMA xac nhan", alert.freq_once_per_bar_close)
if enterShort
alert("Vao lenh Short: Pin Bar + Pha day + EMA xac nhan", alert.freq_once_per_bar_close)
//==================================================================================
// === Hiển thị tín hiệu Cạn cung ===
//plotshape(supplyDryUp, title = 'Cạn cung', location = location.belowbar, color = color.yellow, style = shape.circle, size = size.small)
alertcondition(supplyDryUp, title = 'Cảnh báo cạn cung', message = 'Phát hiện dấu hiệu cạn cung: khối lượng thấp + giá đi ngang + biên độ hẹp')
// === Kết hợp với tín hiệu mua/bán để tăng độ tin cậy ===
buySignalCC = buySignal and supplyDryUp
sellSignalCC = sellSignal and supplyDryUp
plotshape(buySignalCC, title = 'Mua + Cạn cung', location = location.belowbar, color = color.lime, style = shape.triangleup, text = 'Long CC', textcolor = color.white)
plotshape(sellSignalCC, title = 'Bán + Cạn cung', location = location.abovebar, color = color.fuchsia, style = shape.triangledown, text = 'Short CC', textcolor = color.white)
alertcondition(buySignalCC, title = 'Mua mạnh + Cạn cung', message = 'Tín hiệu MUA mạnh kết hợp dấu hiệu cạn cung')
alertcondition(sellSignalCC, title = 'Bán mạnh + Cạn cung', message = 'Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cung')
if buySignalCC
alert('Mua mạnh + Cạn cung : Tín hiệu MUA mạnh kết hợp dấu hiệu cạn cung', alert.freq_once_per_bar_close)
if sellSignalCC
alert('Bán mạnh + Cạn cung : Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cung', alert.freq_once_per_bar_close)
// === Hiển thị tín hiệu Cạn cầu ===
//plotshape(demandDryUp, title = 'Cạn cầu', location = location.abovebar, color = color.orange, style = shape.circle, size = size.small)
alertcondition(demandDryUp, title = 'Cảnh báo cạn cầu', message = 'Phát hiện dấu hiệu cạn cầu: khối lượng thấp + giá không tăng + biên độ hẹp')
// === Kết hợp với tín hiệu bán để tăng độ tin cậy ===
sellSignalCD = sellSignal and demandDryUp
plotshape(sellSignalCD, title = 'Bán + Cạn cầu', location = location.abovebar, color = color.red, style = shape.triangledown, text = 'Short CCầu', textcolor = color.white)
alertcondition(sellSignalCD, title = 'Bán mạnh + Cạn cầu', message = 'Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cầu')
if sellSignalCD
alert('Bán mạnh + Cạn cầu : Tín hiệu BÁN mạnh kết hợp dấu hiệu cạn cầu', alert.freq_once_per_bar_close)
//====================================================
3-Phase ORB Logic: Break, Retest, ConfirmWhat it is
A state-driven Opening Range framework that sequences Break → Retest → Confirm . It does not just draw ORB lines or tag any breakout; it tracks explicit state transitions with timing and tolerance to filter noise.
How it works (method & originality)
Break: After your ORB window, a valid break requires the prior close to be inside the range and the new close to be outside the ORB high/low (prevents slow drift).
Retest (configurable): Price must revisit the ORB edge within a tolerance band you define by % of the ORB range or a fixed price . Controls include Retest Side (Inside / Outside / Either), Proximity (Touch / Near), Basis (Close / Wick), and optional Cap Outside (limit far-outside closes). Retest must occur within a Max Bars window; same-bar Break→Retest is optional.
Confirm: A later bar must break beyond the max/min of the break + retest reference within Max Bars (or the same bar if enabled). Confirmation can be based on Wick , Close (same-bar only) , or Close (always) for stricter behavior.
Engine details: Per-bar state resets, explicit bar indexing for Break/Retest/Confirm, dual tolerance modes (percent or price), inside/outside/either logic, selectable wick/close handling, optional same-bar paths, and projected ORB lines. This is a sequence-and-tolerance framework, not a simple ORB level plotter.
Inputs
Session: ORB Session window
Tolerance: Mode (Percent or Price) + value
Retest controls: Retest Side (Inside/Outside/Either), Proximity (Touch/Near), Basis (Close/Wick), Cap Outside (on/off)
Timing: Max Bars for Retest, Max Bars for Confirm, Allow same-bar Break→Retest, Allow same-bar Retest→Confirm
Confirmation: Confirm Basis (Wick / Close same-bar only / Close always)
Display: Plot shapes or hide markers; ORB line projection length (bars)
Presets: Classic ORB (Outside • Touch • Close • 20%), Inside Touch (Close • 10%), Either Near (Wick • 15%), or Custom
How to use
Set the ORB session (e.g., 09:30–09:45).
Choose a Preset or use Custom and configure: Tolerance Mode/value, Retest Side/Proximity/Basis, optional Cap Outside.
Set Max Bars for Retest/Confirm and pick Confirm Basis (Wick or Close).
After a Break, wait for a valid Retest within your tolerance window, then a Confirm within the allowed bars.
Act after Confirm (or enable same-bar options if you allow them).
(Optional) Enable alerts for Break / Retest / Confirm; extend ORB lines forward for context.
Marker legend
Triangle = Break , X = Retest , Circle = Confirm (Up = long side, Down = short side.)
When signals reset or expire
Retest timeout: If Retest doesn’t occur within Max Bars , the sequence resets to Break-wait.
Confirm timeout: If Confirm doesn’t occur within Max Bars after Retest, the sequence resets.
Invalidation: With Inside retest, a move too far back inside (beyond tolerance) resets. With Outside retest and Cap Outside ON, a move too far outside (beyond tolerance) resets.
Re-entry into the range during the sequence can reset depending on your side/tolerance settings.
Non-repainting behavior
Logic evaluates bar-by-bar with explicit state resets. For stricter confirmation, select Confirm Basis = Close (always) .
Practical notes
Works on any timeframe. Match Percent tolerance to instrument volatility or use Price for fixed-tick products. Alerts are provided for each phase. The screenshot shows a full Break → Retest → Confirm sequence with only this script applied.
Bearish Breakaway-Publish-FVG concept
This indicator tracks the intraday RTH (Regular Trading Hours) high in the bearish direction to identify breakaway candles based on the Fair Value Gap (FVG) and gap breakout concept. By default, the session runs from 9:30 AM to 5:00 PM EST, but the start time can be adjusted to track other sessions such as ETH beginning at 6:00 PM.
At the start of the session, the first candle is always considered the initial intraday high. This candle becomes the anchor, and the indicator continuously updates it whenever a new intraday high is made. A bearish breakaway occurs when a candle’s high is lower than the low of the current anchor candle, creating a gap between them. This first breakaway candle is marked with a red arrow. After the first breakaway, the indicator continues to look for additional breakaways in the bearish direction, each based on the most recent breakaway candle.
If a new intraday high is formed after a breakaway candle has appeared, the anchor is reset to this new high, all previous breakaway markers are removed, and the search starts over. The high and low of the most recent breakaway candle are drawn as horizontal rays, which can act as potential resistance or support depending on the trader’s bias.
You can backtest this indicator using TradingView’s Bar Replay feature to watch the resetting process as new intraday highs are made. Because the first candle of the session is always the first intraday high, the reset behavior is easy to observe in replay mode.
Timeframe recommendations: This tool works best on 1-minute, 5-minute, 15-minute, and 30-minute charts.
Trading tips:
• At the market open, always identify the first bearish breakaway candle.
• Once the intraday high stabilizes, a bearish run may follow — the first breakaway candle often marks the start of this move.
• To trade reversals from a bearish trend, watch for a bullish breakaway candle using the bullish companion indicator.
• If the daily trend is bullish, you will often see the intraday high reset many times — this is a sign to favor bullish trades.
• If trading reversals against the prevailing trend, use the breakaway candle as your signal for potential entry.
Bullish Breakaway-Publish
This indicator tracks the intraday RTH (Regular Trading Hours) low in the bullish direction to identify breakaway candles based on the Fair Value Gap (FVG) and gap breakout concept. By default, the session runs from 9:30 AM to 5:00 PM EST, but the start time can be adjusted to track other sessions such as ETH beginning at 6:00 PM.
At the start of the session, the first candle is always considered the initial intraday low. This candle becomes the anchor, and the indicator continuously updates it whenever a new intraday low is made. A bullish breakaway occurs when a candle’s low is higher than the high of the current anchor candle, creating a gap between them. This first breakaway candle is marked with a green arrow. After the first breakaway, the indicator continues to look for additional breakaways in the bullish direction, each based on the most recent breakaway candle.
If a new intraday low is formed after a breakaway candle has appeared, the anchor is reset to this new low, all previous breakaway markers are removed, and the search starts over. The high and low of the most recent breakaway candle are drawn as horizontal rays, which can act as potential support or resistance depending on the trader’s bias.
You can backtest this indicator using TradingView’s Bar Replay feature to watch the resetting process as new intraday lows are made. Because the first candle of the session is always the first intraday low, the reset behavior is easy to observe in replay mode.
Timeframe recommendations: This tool works best on 1-minute, 5-minute, 15-minute, and 30-minute charts.
Trading tips:
• At the market open, always identify the first breakaway candle.
• Once the intraday low stabilizes, a bullish run may follow — the first breakaway candle often marks the start of this move.
• To trade reversals from a bullish trend, watch for a bearish breakaway candle using the bearish companion indicator.
• If the daily trend is bearish, you will often see the intraday low reset many times — this is a sign to favor bearish trades.
• If trading reversals against the prevailing trend, use the breakaway candle as your signal for potential entry.
You should always trade in the daily trend direction and this indicator will give you the footprint of the daily trend as they are the breakaway candle.
SESSIONS Golden Team TradingView wants indicator descriptions to be:
Ad-free (no brand promotion, contact info, Telegram, etc.)
Self-contained (fully explains the script without requiring external links or references)
Detailed but neutral (explain what it does, how it works in general terms, and how to use it).
Here’s a compliant rewrite for your SESSIONS Golden Team indicator that should avoid bans:
SESSIONS — Multi-Session Forex Box & Range Analysis
This indicator displays the major Forex market sessions — London, New York, Tokyo, Sydney, and Frankfurt — directly on the chart. Each session is shown as a customizable colored box with optional Fibonacci levels and opening range markers.
It also calculates and displays the average pip range of each session over a user-defined number of past days, allowing traders to analyze volatility patterns for each trading period.
Key Features:
Configurable session times and time zones
Individual on/off toggle for each session
Custom colors, box transparency, and border styles
Optional Opening Range and Fibonacci retracement levels for each session
Average pip range table for quick volatility reference
Works on any intraday timeframe
How It Works:
The script identifies the start and end times of each session based on user settings.
A box is drawn around the high/low of the session period.
At the end of each session, the pip range is recorded, and an average is calculated over the last N sessions (default: 20).
The results are displayed in a statistics table showing average pips and whether the session is currently active.
Suggested Use:
Identify high-volatility sessions for breakout trading
Filter trades to active trading hours
Study historical volatility to refine entry timing
AutoPilot Alpha:AI 趨勢進出場系統🎯 Product Name
AutoPilot Alpha: AI Trend Entry/Exit System — Ultimate Pro Edition
🚀 Product Positioning
An advanced AI-powered trading toolkit designed for modern traders who demand precision, automation, and visual clarity.
Perfect for intraday, crypto, and leveraged trading.
🔧 Key Features — Ultimate Pro Edition
🧠 1. AI Trend Engine (High-Frequency HTF Logic)
Multi-timeframe trend analysis using EMA + RSI + MACD
Instantly adaptive background color showing Bullish / Bearish / Sideways zones
Smart trend-only mode for higher signal accuracy
📈 2. Visualized Multi-Level TP/SL Zones
Auto-calculates up to 5 Take-Profit and Stop-Loss levels upon each entry
Crystal-clear labels directly on the chart
Ideal for scalping, day trading, or risk-managed swing entries
⚡ 3. Signal Cooldown Mechanism
Prevents overtrading and false signals during sideways markets
Customizable cooldown bars between trades
📊 4. Auto Support/Resistance Trendlines (ZigZag Based)
Automatically detects recent swing highs/lows
Draws smart dynamic trendlines to highlight structure zones and breakouts
🧩 5. Fully Customizable Filters
Enable or disable filters such as:
MACD Trend Filter
Volume Spike Filter
Candlestick Body Confirmation
Ideal for users seeking signal refinement
📌 6. EMA200 Long-Term Bias Indicator
Visual reference for macro trend alignment
Customizable width and color
🌐 Bilingual UI — International Ready
All parameters and labels available in both English and Chinese
Designed for global traders of any background
📈 Compatible Markets
✅ Crypto (BTC, ETH, SOL, BNB, and futures pairs)
✅ Forex, Gold, Indices, CFDs
✅ Any asset with strong technical behavior
🚀 產品定位|Product Positioning
AI 輔助自動交易 + 多空共振分析 + TP/SL 可視化 + 自動化支撐阻力偵測
An AI-enhanced trading system combining automatic signals, trend detection, and visualized TP/SL zones.
🔥 Ultimate Pro 專屬功能|Exclusive Features
🧠 AI 趨勢引擎(高頻更新版)
多周期 EMA + RSI + MACD 全面共振分析
背景即時變色提示市場趨勢:多頭、空頭、盤整
High-frequency HTF trend detection via EMA + RSI + MACD combo
📈 進場即顯示 TP/SL 多段視覺標記
自動計算 1~5 段獲利點與風控點,貼圖即見
Smart visual tagging of Take-Profit / Stop-Loss zones for every entry
⚡ 冷卻時間邏輯(避免重複進出)
有效減少盤整來回假訊號干擾
Cooldown logic reduces overtrading and false triggers
📊 支撐壓力趨勢線(ZigZag 自動畫線)
自動偵測高點/低點並繪製結構轉折線
Auto trendlines via pivot detection for key S/R levels
🧩 多重濾網自訂(全可開關)
MACD 趨勢濾網、成交量異動、K棒結構等
Flexible filter toggles: MACD, volume spike, structure confirmation
📌 EMA200 長期趨勢指標(可自訂色/寬度)
搭配進出場信號,提供大方向參考
EMA200 reference for long-term direction confidence
聯絡我:yoyoman868@gmail.com
Double EMA & SMAThis indicator plots two Exponential Moving Averages (EMAs) and one Simple Moving Average (SMA) directly on the price chart to help identify market trends and momentum shifts.
By default, it displays:
• EMA 1 (10-period) – short-term trend
• EMA 2 (20-period) – medium-term trend
• SMA (50-period) – broader trend baseline
The combination allows traders to quickly spot trend direction, potential reversal points, and areas of dynamic support or resistance. Suitable for scalping, swing trading, and longer-term analysis across any market.
PBR Strategy Assistant Gold.D FingerGold.D Finger Strategy. This indicator gives an overview of my first strategies with several confluences. I just wanted to test what it would look like in this format, but it does not exactly match the one I actually use.
EMA band 12/60/150/200EMA band consisting of 12/60/150/200
Specifically for Indian stock market, can be used for other trading scripts after testing.
Best use case : on Daily TF.
Bull run entry criteria, Not bear market or Bottom catching.
📱 Mobile EMA + Trendline Bias (edegrano)📱 Mobile EMA + Trendline Bias (edegrano) — User Manual
What It Does
This indicator helps you spot strong bullish or bearish trends by combining:
EMA Bias: Using the relationship between EMA 50 and EMA 200 on your chosen timeframe.
Trendline Slope Bias: Using linear regression trendlines on fixed 1-minute, 3-minute, and 5-minute charts.
Signal Dots: Visual buy/sell signals limited to the first 3 occurrences after the last opposite signal to avoid noise.
Summary Table: Shows the current trend bias and final suggestion.
EMA Plots: Shows EMA 50, EMA 100, and EMA 200 lines on your chart.
Tag Label: Displays a small signature tag “📱 edegrano Mobile” on the chart.
Inputs
Input Name Description Default Notes
Custom EMA Timeframe (userTF) Timeframe used to calculate EMAs "1" (1 min) Choose your preferred timeframe (e.g., 1, 3, 5, 15, 60 minutes, etc.)
Show EMAs on Chart (showEMA) Toggle EMA lines visibility true Show or hide EMA 50, 100, and 200 lines
Linear Regression Length (regLen) Length of bars used in regression 20 Adjusts sensitivity of regression trendlines (lower = more responsive)
Show EMA Bias Row (showRowEMA50) Show/hide EMA bias row in the table true Display the EMA 50 > EMA 200 bias status in table
Show Trendline Bias Row (showRowTrend) Show/hide trendline slope row in table true Display the trendline slope bias status in table
How to Use
Set Your Timeframe:
Choose the timeframe for EMA calculations (userTF) depending on your trading style.
Scalpers might use 1-5 minute charts.
Day traders might choose 5-30 minutes.
Swing traders could go 1 hour or more.
Watch the EMA Lines:
EMA 50 (blue), EMA 100 (black), and EMA 200 (red) are plotted on your chart.
These lines help you visualize trend direction and momentum.
Understand the Bias Conditions:
EMA Bias:
Bullish: EMA 50 > EMA 200
Bearish: EMA 50 < EMA 200
Trendline Slope Bias:
Calculated on fixed 1m, 3m, and 5m charts.
Bullish if slope of all 3 regression lines is up (current value > previous).
Bearish if slope of all 3 regression lines is down.
Look for Signal Dots:
Green (lime) dots below bars: Strong Buy signals (first 3 occurrences only after last sell).
Red dots above bars: Strong Sell signals (first 3 occurrences only after last buy).
This limitation helps reduce noise from too many signals.
Check the Table (Bottom Left):
Shows EMA bias and trendline slope status.
Displays overall final suggestion:
Strong Buy 💎
Strong Sell 💎
Mixed / Neutral
Tag Label:
A small label "📱 edegrano Mobile" appears on the chart for easy identification.
Tips & Best Practices
Adjust Regression Length (regLen):
Lower values (e.g., 15-20) react faster but may generate false signals.
Higher values (30-50) smooth noise but react slower — better for longer-term trades.
Combine with Other Indicators:
Use volume, candlestick patterns, or support/resistance to confirm signals.
Don’t Trade Against the Signal:
Avoid entering buy trades during a “Strong Sell” phase and vice versa.
Monitor Multiple Timeframes:
Consider confirming trends on higher timeframes.
Parameter Suggestions by Trading Style
Style EMA Timeframe Regression Length (regLen)
Scalping 1 min 15 - 20
Day Trading 5 - 15 min 20 - 30
Swing Trading 1 hour or higher 30 - 50
Position Trading 4 hour, Daily, Weekly 50 - 100
📱 Mobile EMA + Trendline Bias (edegrano)📱 Mobile EMA + Trendline Bias (edegrano) — User Manual
Purpose
This indicator provides a simplified, mobile-friendly overview of trend bias using EMA and multi-timeframe regression trendline confluences, plus plots EMA lines and a small info table on the chart.
Inputs Explained
Input Name Description
Custom EMA Timeframe The timeframe on which the EMA 50 and EMA 200 calculations are based (e.g., 1, 3, 5 minutes). This lets you choose which timeframe to analyze EMA trend bias.
Show EMAs on Chart Toggle to show or hide EMA 50 (blue) and EMA 200 (red) lines on your chart.
Regression Length The length (number of bars) used for calculating the linear regression trendlines on fixed 1m, 3m, and 5m timeframes. Lower values make trendlines more reactive, higher values smooth out noise.
Show EMA 50 Bias Row Show or hide the EMA 50 vs EMA 200 bias row in the info table.
Show Trendline Slope Row Show or hide the multi-timeframe trendline slope bias row in the info table.
What It Shows
EMA Lines: EMA 50 (blue) and EMA 200 (red) based on your selected timeframe.
Trendline Slopes: Using linear regression on 1-minute, 3-minute, and 5-minute charts to gauge short-term trend direction.
Info Table (Bottom Left):
EMA 50 > EMA 200 status on your selected timeframe (Bullish/Bearish)
Trendline slope bias combining the 3 fixed timeframes (Bullish/Bearish/Neutral)
Final Suggestion showing overall bias:
Strong Buy 💎 if both EMA and trendline biases are bullish
Strong Sell 💎 if both are bearish
Mixed / Neutral otherwise
Tag on Chart Corner: Displays “📱 edegrano Mobile” label for quick identification.
How To Use
Set the Custom EMA Timeframe:
Choose a timeframe that fits your trading style (e.g., 1m for scalping, 5m for day trading).
Adjust Regression Length:
For faster signals, lower the regression length (e.g., 15).
For smoother, less noisy signals, increase it (e.g., 30 or higher).
Toggle EMA Lines Display:
Show or hide EMA lines based on your preference for chart clarity.
Use the Info Table:
Quickly glance at EMA and trendline bias across timeframes for confluence confirmation.
Interpret the Final Suggestion:
Follow “Strong Buy” or “Strong Sell” signals for potential entry points. If “Mixed / Neutral,” wait for stronger confirmation.
Suggested Parameters by Trading Style
Style EMA Timeframe Regression Length Notes
Scalping 1 min 15-20 Responsive, fast reaction to price
Day Trading 3-5 min 20-30 Balanced sensitivity
Swing Trading 15-30 min 30-50 Smoother trend detection
Position Trading 1 hr+ 50-100 Very smooth, low noise
Tips
Combine this indicator with volume or other indicators for stronger confirmation.
Use the EMA lines on chart visually to confirm trend direction.
The info table updates in real-time, making it easy for quick decisions on mobile.
Adjust inputs and observe how the final suggestion changes to tune for your asset and timeframe.
Key Box Zone Finder — ATR + EMA200 Filter//@version=5
indicator("Key Box Zone Finder — ATR + EMA200 Filter", overlay=true, max_lines_count=500, max_boxes_count=100, max_labels_count=500)
// ---------- Inputs ----------
len = input.int(60, "Box Length (bars)", minval=10)
maxWidthPct = input.float(0.6, "Max Box Width %", step=0.05)
edgeTolPct = input.float(0.08, "Edge tolerance %", step=0.01)
bins = input.int(8, "Bins inside box", minval=3, maxval=20)
extendBars = input.int(120, "Extend right (bars)", minval=0)
showTouches = input.bool(true, "Show edge touches")
showSubZone = input.bool(true, "Show densest sub-zone")
boxColor = input.color(color.new(color.teal, 85), "Box fill")
subBoxColor = input.color(color.new(color.orange, 75), "Sub-zone fill")
edgeLineColor = input.color(color.new(color.teal, 0), "Edge line color")
midLineColor = input.color(color.new(color.gray, 0), "Mid line color")
// فیلترها
atrLen = input.int(14, "ATR Length", minval=1)
atrMaxMult = input.float(0.5, "ATR Max % of Close", step=0.01)
emaLen = input.int(200, "EMA Length", minval=1)
emaDistancePct = input.float(0.5, "Max Distance % from EMA", step=0.1)
// ---------- Core calc ----------
hi = ta.highest(high, len)
lo = ta.lowest(low, len)
boxRange = hi - lo
boxRangePct = boxRange / math.max(close, 1e-6) * 100.0
isBoxWidth = boxRangePct <= maxWidthPct
// شمارش برخوردها
edgeTolHi = hi * (1 - edgeTolPct/100.0)
edgeTolLo = lo * (1 + edgeTolPct/100.0)
touchUpper = 0
touchLower = 0
for j = 0 to len - 1
touchUpper += (high >= edgeTolHi) ? 1 : 0
touchLower += (low <= edgeTolLo) ? 1 : 0
// ---------- ATR filter ----------
atrValue = ta.atr(atrLen)
atrCondition = (atrValue / close) * 100 <= atrMaxMult
// ---------- EMA200 filter ----------
emaValue = ta.ema(close, emaLen)
emaCondition = math.abs(close - emaValue) / close * 100 <= emaDistancePct
// ---------- Final filter ----------
isValidBox = isBoxWidth and atrCondition and emaCondition
// ---------- Draw main box ----------
var box bMain = na
var line lTop = na
var line lBot = na
var line lMid = na
var label labU = na
var label labL = na
if barstate.islast and isValidBox
if not na(bMain)
box.delete(bMain)
if not na(lTop)
line.delete(lTop)
if not na(lBot)
line.delete(lBot)
if not na(lMid)
line.delete(lMid)
if not na(labU)
label.delete(labU)
if not na(labL)
label.delete(labL)
left = bar_index - len + 1
right = bar_index + extendBars
bMain := box.new(left, hi, bar_index, lo, bgcolor=boxColor, border_color=edgeLineColor)
box.set_extend(bMain, extend.right)
lTop := line.new(left, hi, right, hi, extend=extend.right, color=edgeLineColor, width=1)
lBot := line.new(left, lo, right, lo, extend=extend.right, color=edgeLineColor, width=1)
mid = (hi + lo) / 2.0
lMid := line.new(left, mid, right, mid, extend=extend.right, color=midLineColor, style=line.style_dotted)
if showTouches
labU := label.new(bar_index, hi, "▲ touches: " + str.tostring(touchUpper), textcolor=color.white, color=color.new(color.teal, 0), style=label.style_label_down, size=size.tiny)
labL := label.new(bar_index, lo, "▼ touches: " + str.tostring(touchLower), textcolor=color.white, color=color.new(color.teal, 0), style=label.style_label_up, size=size.tiny)
// ---------- Densest sub-zone ----------
var box bSub = na
if barstate.islast and isValidBox and showSubZone and boxRange > 0
step = boxRange / bins
maxCount = -1
bestIdx = 0
for i = 0 to bins - 1
binLo = lo + step * i
binHi = binLo + step
cIn = 0
for j = 0 to len - 1
c = close
cIn += (c >= binLo and c <= binHi) ? 1 : 0
if cIn > maxCount
maxCount := cIn
bestIdx := i
subLo = lo + step * bestIdx
subHi = subLo + step
if not na(bSub)
box.delete(bSub)
bSub := box.new(bar_index - len + 1, subHi, bar_index, subLo, bgcolor=subBoxColor, border_color=color.new(color.orange, 0))
box.set_extend(bSub, extend.right)
label.new(bar_index, subHi, "Dense zone", style=label.style_label_down, textcolor=color.white, color=color.new(color.orange, 0), size=size.tiny)
// ---------- Alerts ----------
alertcondition(isValidBox, title="Valid Box Detected", message="Consolidation box detected with ATR & EMA filter")
Volume Profile (Simple)Simple Volume Profile (Simple)
Master the Market's Structure with a Clear View of Volume
by mercaderoaurum
The Simple Volume Profile (Simple) indicator removes the guesswork by showing you exactly where the most significant trading activity has occurred. By visualizing the Point of Control (POC) and Value Area (VA) for today and yesterday, you can instantly identify the price levels that matter most, giving you a critical edge in your intraday trading.
This tool is specifically optimized for day trading SPY on a 1-minute chart, but it's fully customizable for any symbol or timeframe.
Key Features
Multi-Day Analysis: Automatically plots the volume profiles for the current and previous trading sessions, allowing you to see how today's market is reacting to yesterday's key levels.
Automatic Key Level Plotting: Instantly see the most important levels from each session:
Point of Control (POC): The single price level with the highest traded volume, acting as a powerful magnet for price.
Value Area High (VAH): The upper boundary of the area where 50% of the volume was traded. It often acts as resistance.
Value Area Low (VAL): The lower boundary of the 50% value area, often acting as support.
Extended Levels: The POC, VAH, and VAL from previous sessions are automatically extended into the current day, providing a clear map of potential support and resistance zones.
Customizable Sessions: While optimized for the US stock market, you can define any session time and time zone, making it a versatile tool for forex, crypto, and futures traders.
Core Trading Strategies
The Simple Volume Profile helps you understand market context. Instead of trading blind, you can now make decisions based on where the market has shown the most interest.
1. Identifying Support and Resistance
This is the most direct way to use the indicator. The extended lines from the previous day are your roadmap for the current session.
Previous Day's POC (pPOC): This is the most significant level. Watch for price to react strongly here. It can act as powerful support if approached from above or strong resistance if approached from below.
Previous Day's VAH (pVAH): Expect this level to act as initial resistance. A clean break above pVAH can signal a strong bullish trend.
Previous Day's VAL (pVAL): Expect this level to act as initial support. A firm break below pVAL can indicate a strong bearish trend.
Example Strategy: If SPY opens and rallies up to the previous day's VAH and stalls, this is a high-probability area to look for a short entry, with a stop loss just above the level.
2. The "Open-Drive" Rejection
How the market opens in relation to the previous day's value area is a powerful tell.
Open Above Yesterday's Value Area: If the market opens above the pVAH, it signals strength. The first pullback to test the pVAH is often a key long entry point. The level is expected to flip from resistance to support.
Open Below Yesterday's Value Area: If the market opens below the pVAL, it signals weakness. The first rally to test the pVAL is a potential short entry, as the level is likely to act as new resistance.
3. Fading the Extremes
When price pushes far outside the previous day's value area, it can become overextended.
Reversal at Highs: If price rallies significantly above the pVAH and then starts to lose momentum (e.g., forming bearish divergence on RSI or a topping pattern), it could be an opportunity to short the market, targeting a move back toward the pVAH or pPOC.
Reversal at Lows: Conversely, if price drops far below the pVAL and shows signs of bottoming, it can be a good opportunity to look for a long entry, targeting a reversion back to the value area.
Recommended Settings (SPY Intraday)
These settings are the default and are optimized for scalping or day trading SPY on a 1-minute chart.
Value Area (%): 50%. This creates a tighter, more sensitive value area, perfect for identifying the most critical intraday zones.
Number of Rows: 1000. This high resolution is essential for a low-volatility instrument like SPY, ensuring that the profile is detailed and the levels are precise.
Session Time: 0400-1800 in America/New_York. This captures the full pre-market and core session, which is crucial for understanding the day's complete volume story.
Ready to trade with an edge? Add the Simple Volume Profile (Multi-Day) to your chart now and see the market in a new light!
💎💎💎 We are the Masters- by edegrano-Donna-Leah 2How to Use the "💎💎💎 We are the Masters" Script
1. Set Your Timeframes
EMA Timeframes (emaTF1, emaTF2, emaTF3):
Choose 3 different chart timeframes on which you want to analyze the EMA bias. These timeframes will determine how the script evaluates the market trend via EMAs.
Trendline Timeframes (tf1, tf2, tf3):
Choose 3 timeframes for the linear regression trendlines. These smooth out price action and indicate the trend slope.
2. Set Linear Regression Length (regLen)
This controls the length (number of bars) the linear regression trendline uses to calculate the trend.
Smaller values make the trendline more sensitive; higher values smooth out noise but react slower.
3. Interpret the Output
EMA Bias per Timeframe:
Bullish if EMA 50 > EMA 200 on that timeframe.
Bearish if EMA 50 < EMA 200.
Trendline Slope per Timeframe:
Bullish if current regression value > previous regression value (price is trending up).
Bearish if current regression value ≤ previous regression value.
Special Buy Signal:
When all 3 EMA biases are bullish AND all 3 trendline slopes are bullish → Strong Buy Signal (blue dot below bar).
Special Sell Signal:
When all 3 EMA biases are bearish AND all 3 trendline slopes are bearish → Strong Sell Signal (red dot above bar).
EMA Crosses:
The script plots vertical lines and labels on the current timeframe when EMA 50 crosses above (bullish) or below (bearish) EMA 200.
Information Table:
Shows EMA bias and trendline slope status for all timeframes, last EMA cross info, and final overall suggestion.
4. How to Use in Trading
Confirm Trend: Use the EMA bias and trendline slope confluences to confirm the overall trend across multiple timeframes.
Trade Entry: Consider entering long when the special buy signal appears; enter short when the special sell signal appears.
EMA Crosses: Use crosses as secondary confirmation or to detect early momentum shifts.
Trendline Slope: Helps confirm if the price is gaining or losing strength on different timeframes.
Monitor Table: Quickly glance to understand current market bias and confluence.
Suggested Parameters for Different Trading Styles
Style EMA Timeframes Trendline Timeframes Linear Regression Length (regLen)
Scalping 1 min, 3 min, 5 min 1 min, 3 min, 5 min 15 - 20 (responsive, fast)
Day Trading 5 min, 15 min, 30 min 5 min, 15 min, 30 min 20 - 30 (balanced responsiveness)
Swing Trading 1 hr, 4 hr, Daily 1 hr, 4 hr, Daily 30 - 50 (smoother, slower trend)
Position Trading 4 hr, Daily, Weekly 4 hr, Daily, Weekly 50 - 100 (very smooth)
Tips
When using short timeframes, keep the regression length smaller for quicker reaction to price changes.
For longer timeframes, increase regression length to reduce noise and false signals.
Use this script alongside volume or other indicators to improve entry quality.
Avoid trading against the overall confluence bias (e.g., don’t enter longs if final suggestion is “Strong Bearish”).
SM Trap Detector – Liquidity Sweeps & Institutional ReversalsOverview:
This script is designed to help traders detect Smart Money traps, liquidity grabs, and false breakouts with high precision.
Inspired by institutional trading logic (SMC, ICT, Wyckoff), this tool combines:
🟦 Liquidity Zone Mapping – Detects stop hunt targets near highs/lows
🚨 Trap Candle Detection – Identifies fakeouts using wick + volume logic
✅ Reversal Confirmation – Entry signals based on real market structure
🧭 Dashboard Panel – Always see the last trap type, price, and confirmation
🔔 Real-Time Alerts – Stay notified of traps and entry points
🧠 Logic Breakdown:
Trap Candle = Large wick, small body, volume spike, and sweep of a liquidity zone
Confirmed Entry = Reversal price action following the trap (engulfing-style)
📈 Best Used On:
Markets: Crypto, Forex, Stocks
Timeframes: No limitation but works best on 1H, 4H, Daily
🛠 Suggested Use:
Trade only confirmed entries for best results
Place stops beyond wick highs/lows
Target previous structure or use RR-based exits
📊 Backtest Tip:
Use alerts + replay mode to manually validate past traps.
Note: Please backtest before using it for entry.
Mouse Indicator Private V2.0The "Mouse Indicator Private" is a powerful Pine Script tool designed for XAU/USD (Gold) trading on the 1-minute (M1) timeframe. It incorporates a sophisticated set of conditions to identify potential trading opportunities, focusing on specific candlestick patterns and volume dynamics, combined with advanced capital management features.
Detector Mecha Profunda M20This indicator identifies a high-probability "Deep Wick Pattern" based on candlestick structure and volume analysis, filtered by the 20-period simple moving average (SMA). A buy signal is generated when the candle has a long lower wick, closes above the previous low, shows bullish structure, and is confirmed by increasing volume — all while the price is trading above the 20 SMA. A sell signal appears under the opposite conditions: a long upper wick, bearish candle closing below the previous high, with increased volume, and price trading below the 20 SMA. This tool helps traders spot potential reversals or continuations with added confirmation from trend direction and volume.
Detector Mecha Profunda M20This indicator identifies a high-probability "Deep Wick Pattern" based on candlestick structure and volume analysis, filtered by the 20-period simple moving average (SMA). A buy signal is generated when the candle has a long lower wick, closes above the previous low, shows bullish structure, and is confirmed by increasing volume — all while the price is trading above the 20 SMA. A sell signal appears under the opposite conditions: a long upper wick, bearish candle closing below the previous high, with increased volume, and price trading below the 20 SMA. This tool helps traders spot potential reversals or continuations with added confirmation from trend direction and volume.