BBMA By K1M4K-ID- Final Validated Re-Entry//@version=6
indicator("BBMA By K1M4K-ID- Final Validated Re-Entry", overlay=true, max_labels_count=500)
// === INPUT BB ===
lengthBB = input.int(20, title="BB Period")
devBB = input.float(2.0, title="Deviation")
src = input.source(close, title="Source")
bbColorMid = input.color(color.purple, title="Mid BB Color")
bbColorTop = input.color(color.purple, title="Top BB Color")
bbColorLow = input.color(color.purple, title="Low BB Color")
showFill = input.bool(true, title="Show BB Fill")
showReEntrySignals = input.bool(true, "Show Re-Entry Signals (✅)")
showSignalTable = input.bool(true, "Show Signal Table")
// === BB CALCULATION ===
basis = ta.sma(src, lengthBB)
dev = devBB * ta.stdev(src, lengthBB)
topBB = basis + dev
lowBB = basis - dev
// === PLOT BB ===
pMid = plot(basis, title="Mid BB", color=bbColorMid, linewidth=2)
pTop = plot(topBB, title="Top BB", color=bbColorTop, linewidth=2)
pLow = plot(lowBB, title="Low BB", color=bbColorLow, linewidth=2)
fill(pTop, pLow, color=showFill ? color.new(color.purple, 85) : na, title="BB Fill")
// === INPUT MA SETTING ===
ma_func(source, length) => ta.wma(source, length)
// === MA HIGH/LOW ===
ma5_high = ma_func(high, 5)
ma10_high = ma_func(high, 10)
ma5_low = ma_func(low, 5)
ma10_low = ma_func(low, 10)
// === PLOT MA ===
p_ma5_high = plot(ma5_high, title="MA 5 High", color=color.green, linewidth=2)
p_ma10_high = plot(ma10_high, title="MA 10 High", color=color.green, linewidth=2)
fill(p_ma5_high, p_ma10_high, color=color.new(color.green, 85), title="MA High Fill")
p_ma5_low = plot(ma5_low, title="MA 5 Low", color=color.red, linewidth=2)
p_ma10_low = plot(ma10_low, title="MA 10 Low", color=color.red, linewidth=2)
fill(p_ma5_low, p_ma10_low, color=color.new(color.red, 85), title="MA Low Fill")
// === EMA 50 ===
ema50 = ta.ema(close, 50)
plot(ema50, title="EMA 50", color=color.blue, linewidth=3)
// === CSA KUKUH (LOGIKA ASLI LU - TIDAK DIUBAH) ===
var bool hasCsaBuy = false
var bool hasCsaSell = false
isCsaKukuhBuy = close > ma5_high and close > ma10_high and close > basis
isCsaKukuhSell = close < ma5_low and close < ma10_low and close < basis
if isCsaKukuhBuy and not hasCsaBuy
hasCsaBuy := true
hasCsaSell := false
else if isCsaKukuhSell and not hasCsaSell
hasCsaSell := true
hasCsaBuy := false
showCsaBuy = isCsaKukuhBuy and not hasCsaBuy
showCsaSell = isCsaKukuhSell and not hasCsaSell
plotshape(showCsaBuy, title="CSA Kukuh Buy First", location=location.belowbar, color=color.green, style=shape.labelup, text="CSAK", textcolor=color.white, size=size.small)
plotshape(showCsaSell, title="CSA Kukuh Sell First", location=location.abovebar, color=color.red, style=shape.labeldown, text="CSAK", textcolor=color.white, size=size.small)
// === CSM (HANYA SAAT KELUAR DARI DALAM BB) ===
wasInsideBB = (close >= lowBB and close <= topBB )
csmBuySignal = wasInsideBB and close > topBB
csmSellSignal = wasInsideBB and close < lowBB
plotshape(csmBuySignal, title="CSM Buy", location=location.abovebar, color=color.green, style=shape.triangleup, text="CSM", size=size.tiny)
plotshape(csmSellSignal, title="CSM Sell", location=location.belowbar, color=color.red, style=shape.triangledown, text="CSM", size=size.tiny)
// === CSA (BREAKOUT TANPA MELEWATI MID BB) ===
isCsaBuy = close > ma5_high and close > ma10_high and close <= basis
isCsaSell = close < ma5_low and close < ma10_low and close >= basis
plotshape(isCsaBuy, title="CSA Buy", location=location.belowbar, color=color.new(color.green, 60), style=shape.circle, text="CSA", size=size.tiny)
plotshape(isCsaSell, title="CSA Sell", location=location.abovebar, color=color.new(color.red, 60), style=shape.circle, text="CSA", size=size.tiny)
// === EXTREME ===
basis_ext = ta.sma(close, 20)
dev_ext = 2 * ta.stdev(close, 20)
isExtremeBuy() => ta.wma(low, 5) < basis_ext - dev_ext
isExtremeSell() => ta.wma(high, 5) > basis_ext + dev_ext
plotshape(isExtremeBuy(), title="Extreme Buy", location=location.belowbar, color=color.green, style=shape.labelup, text="E", size=size.tiny, textcolor=color.white)
plotshape(isExtremeSell(), title="Extreme Sell", location=location.abovebar, color=color.red, style=shape.labeldown, text="E", size=size.tiny, textcolor=color.white)
// === ZZL MA ===
isZzlBuy = (ma5_high > basis and ma10_high > basis and ma5_low > basis and ma10_low > basis and
(ma5_high <= basis or ma10_high <= basis or ma5_low <= basis or ma10_low <= basis))
isZzlSell = (ma5_high < basis and ma10_high < basis and ma5_low < basis and ma10_low < basis and
(ma5_high >= basis or ma10_high >= basis or ma5_low >= basis or ma10_low >= basis))
var bool zzlBuyShown = false
var bool zzlSellShown = false
if isZzlBuy and not zzlBuyShown
label.new(bar_index, low, "Z", style=label.style_label_up, color=color.green, textcolor=color.white)
zzlBuyShown := true
if not isZzlBuy
zzlBuyShown := false
if isZzlSell and not zzlSellShown
label.new(bar_index, high, "Z", style=label.style_label_down, color=color.red, textcolor=color.white)
zzlSellShown := true
if not isZzlSell
zzlSellShown := false
// ===========================================
// === VALIDASI + RE-ENTRY (H4 & H1) ===
// ===========================================
// --- Ambil data ---
= request.security(syminfo.tickerid, "240", )
wasInside_h4 = request.security(syminfo.tickerid, "240", (close >= (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB) ) and close <= (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB) )))
csmBuy_h4 = wasInside_h4 and request.security(syminfo.tickerid, "240", close > (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB)))
csmSell_h4 = wasInside_h4 and request.security(syminfo.tickerid, "240", close < (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB)))
csakBuy_h4 = close_h4 > ma5h_h4 and close_h4 > ma10h_h4 and close_h4 > basis_h4
csakSell_h4 = close_h4 < ma5l_h4 and close_h4 < ma10l_h4 and close_h4 < basis_h4
csaBuy_h4 = close_h4 > ma5h_h4 and close_h4 > ma10h_h4 and close_h4 <= basis_h4
csaSell_h4 = close_h4 < ma5l_h4 and close_h4 < ma10l_h4 and close_h4 >= basis_h4
csmBuy_h1 = request.security(syminfo.tickerid, "60", (close >= (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB) ) and close <= (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB) )) and close > (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB)))
csmSell_h1 = request.security(syminfo.tickerid, "60", (close >= (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB) ) and close <= (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB) )) and close < (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB)))
csakBuy_h1 = request.security(syminfo.tickerid, "60", close > ta.wma(high,5) and close > ta.wma(high,10) and close > ta.sma(close, lengthBB))
csakSell_h1 = request.security(syminfo.tickerid, "60", close < ta.wma(low,5) and close < ta.wma(low,10) and close < ta.sma(close, lengthBB))
csaBuy_h1 = request.security(syminfo.tickerid, "60", close > ta.wma(high,5) and close > ta.wma(high,10) and close <= ta.sma(close, lengthBB))
csaSell_h1 = request.security(syminfo.tickerid, "60", close < ta.wma(low,5) and close < ta.wma(low,10) and close >= ta.sma(close, lengthBB))
csmBuy_m15 = request.security(syminfo.tickerid, "15", close > (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB)))
csmSell_m15 = request.security(syminfo.tickerid, "15", close < (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB)))
csakBuy_d = request.security(syminfo.tickerid, "D", close > ta.wma(high,5) and close > ta.wma(high,10) and close > ta.sma(close, lengthBB))
csakSell_d = request.security(syminfo.tickerid, "D", close < ta.wma(low,5) and close < ta.wma(low,10) and close < ta.sma(close, lengthBB))
csaBuy_d = request.security(syminfo.tickerid, "D", close > ta.wma(high,5) and close > ta.wma(high,10) and close <= ta.sma(close, lengthBB))
csaSell_d = request.security(syminfo.tickerid, "D", close < ta.wma(low,5) and close < ta.wma(low,10) and close >= ta.sma(close, lengthBB))
// --- Validasi ---
validCsakH4Buy = csakBuy_h4 and ta.highest(csmBuy_h1 ? 1 : 0, 4) == 1
validCsakH4Sell = csakSell_h4 and ta.highest(csmSell_h1 ? 1 : 0, 4) == 1
validCsakH1Buy = csakBuy_h1 and ta.highest(csmBuy_m15 ? 1 : 0, 4) == 1
validCsakH1Sell = csakSell_h1 and ta.highest(csmSell_m15 ? 1 : 0, 4) == 1
validCsmH1Buy = csmBuy_h1 and (csaBuy_h4 or csakBuy_h4) and ta.highest(csmBuy_m15 ? 1 : 0, 4) == 1
validCsmH1Sell = csmSell_h1 and (csaSell_h4 or csakSell_h4) and ta.highest(csmSell_m15 ? 1 : 0, 4) == 1
validCsmH4Buy = csmBuy_h4 and (csaBuy_d or csakBuy_d) and ta.highest(csmBuy_h1 or csmSell_h1 ? 1 : 0, 4) == 1
validCsmH4Sell = csmSell_h4 and (csaSell_d or csakSell_d) and ta.highest(csmBuy_h1 or csmSell_h1 ? 1 : 0, 4) == 1
// --- Re-Entry Area ---
inReEntryBuy = low <= math.max(ma5_low, ma10_low)
inReEntrySell = high >= math.min(ma5_high, ma10_high)
// --- Flag Valid + Hit Detection ---
var bool vCsakH4B = false, vCsakH4S = false
var bool vCsakH1B = false, vCsakH1S = false
var bool vCsmH4B = false, vCsmH4S = false
var bool vCsmH1B = false, vCsmH1S = false
var bool hitCsakH4B = false, hitCsakH4S = false
var bool hitCsakH1B = false, hitCsakH1S = false
var bool hitCsmH4B = false, hitCsmH4S = false
var bool hitCsmH1B = false, hitCsmH1S = false
// Reset hit setiap candle
hitCsakH4B := false
hitCsakH4S := false
hitCsakH1B := false
hitCsakH1S := false
hitCsmH4B := false
hitCsmH4S := false
hitCsmH1B := false
hitCsmH1S := false
// Aktifkan flag saat valid
vCsakH4B := validCsakH4Buy ? true : vCsakH4B
vCsakH4S := validCsakH4Sell ? true : vCsakH4S
vCsakH1B := validCsakH1Buy ? true : vCsakH1B
vCsakH1S := validCsakH1Sell ? true : vCsakH1S
vCsmH4B := validCsmH4Buy ? true : vCsmH4B
vCsmH4S := validCsmH4Sell ? true : vCsmH4S
vCsmH1B := validCsmH1Buy ? true : vCsmH1B
vCsmH1S := validCsmH1Sell ? true : vCsmH1S
// Deteksi & reset saat re-entry
if vCsakH4B and inReEntryBuy
hitCsakH4B := true
vCsakH4B := false
if vCsakH4S and inReEntrySell
hitCsakH4S := true
vCsakH4S := false
if vCsakH1B and inReEntryBuy
hitCsakH1B := true
vCsakH1B := false
if vCsakH1S and inReEntrySell
hitCsakH1S := true
vCsakH1S := false
if vCsmH4B and inReEntryBuy
hitCsmH4B := true
vCsmH4B := false
if vCsmH4S and inReEntrySell
hitCsmH4S := true
vCsmH4S := false
if vCsmH1B and inReEntryBuy
hitCsmH1B := true
vCsmH1B := false
if vCsmH1S and inReEntrySell
hitCsmH1S := true
vCsmH1S := false
// --- Plot Re-Entry ---
//plotshape(showReEntrySignals and hitCsakH4B, location=location.belowbar, color=color.teal, style=shape.labelup, text="✅", size=size.normal)
//plotshape(showReEntrySignals and hitCsakH4S, location=location.abovebar, color=color.orange, style=shape.labeldown, text="✅", size=size.normal)
//plotshape(showReEntrySignals and hitCsakH1B, location=location.belowbar, color=color.green, style=shape.labelup, text="✅", size=size.small)
//plotshape(showReEntrySignals and hitCsakH1S, location=location.abovebar, color=color.red, style=shape.labeldown, text="✅", size=size.small)
//plotshape(showReEntrySignals and hitCsmH1B, location=location.belowbar, color=color.green, style=shape.labelup, text="✅ CSM", size=size.tiny)
//plotshape(showReEntrySignals and hitCsmH1S, location=location.abovebar, color=color.red, style=shape.labeldown, text="✅ CSM", size=size.tiny)
//plotshape(showReEntrySignals and hitCsmH4B, location=location.belowbar, color=color.teal, style=shape.labelup, text="✅ CSM", size=size.tiny)
//plotshape(showReEntrySignals and hitCsmH4S, location=location.abovebar, color=color.orange, style=shape.labeldown, text="✅ CSM", size=size.tiny)
// ===========================================
// === TABEL SIGNAL H1 & H4 (FINAL) ===
// ===========================================
var table sigTable = table.new(position.top_right, 4, 5, border_width=1)
if barstate.islast and showSignalTable
table.cell(sigTable, 0, 0, "TF", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 0, "Signal", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 2, 0, "Status", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 3, 0, "Re-Entry", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 0, 1, "H4", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 1, "CSAK Buy", text_color=color.green, bgcolor=color.new(color.green, 90))
table.cell(sigTable, 2, 1, vCsakH4B ? "✅ Valid" : "-", text_color=vCsakH4B ? color.green : color.gray, bgcolor=color.new(vCsakH4B ? color.green : color.gray, 90))
table.cell(sigTable, 3, 1, hitCsakH4B ? "✅ Hit" : "-", text_color=hitCsakH4B ? color.teal : color.gray, bgcolor=color.new(hitCsakH4B ? color.teal : color.gray, 90))
table.cell(sigTable, 0, 2, "H4", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 2, "CSAK Sell", text_color=color.red, bgcolor=color.new(color.red, 90))
table.cell(sigTable, 2, 2, vCsakH4S ? "✅ Valid" : "-", text_color=vCsakH4S ? color.red : color.gray, bgcolor=color.new(vCsakH4S ? color.red : color.gray, 90))
table.cell(sigTable, 3, 2, hitCsakH4S ? "✅ Hit" : "-", text_color=hitCsakH4S ? color.orange : color.gray, bgcolor=color.new(hitCsakH4S ? color.orange : color.gray, 90))
table.cell(sigTable, 0, 3, "H1", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 3, "CSM Buy", text_color=color.green, bgcolor=color.new(color.green, 90))
table.cell(sigTable, 2, 3, vCsmH1B ? "✅ Valid" : "-", text_color=vCsmH1B ? color.green : color.gray, bgcolor=color.new(vCsmH1B ? color.green : color.gray, 90))
table.cell(sigTable, 3, 3, hitCsmH1B ? "✅ Hit" : "-", text_color=hitCsmH1B ? color.teal : color.gray, bgcolor=color.new(hitCsmH1B ? color.teal : color.gray, 90))
table.cell(sigTable, 0, 4, "H1", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 4, "CSM Sell", text_color=color.red, bgcolor=color.new(color.red, 90))
table.cell(sigTable, 2, 4, vCsmH1S ? "✅ Valid" : "-", text_color=vCsmH1S ? color.red : color.gray, bgcolor=color.new(vCsmH1S ? color.red : color.gray, 90))
table.cell(sigTable, 3, 4, hitCsmH1S ? "✅ Hit" : "-", text_color=hitCsmH1S ? color.orange : color.gray, bgcolor=color.new(hitCsmH1S ? color.orange : color.gray, 90))
Candlestick analysis
SWING ATR BasedWhat does this indicator do?
1. It identifies Market Swings The script monitors price action to detect when a trend changes direction.
It uses ATR (Average True Range) to measure volatility, ensuring it doesn't get tricked by small, insignificant price movements.
To validate a change in direction (from bullish to bearish, or vice versa), it waits for the price to cover a specific distance (defined by the kRange parameter) and requires at least two significant candles.
2. It plots Support and Resistance zones As soon as a new high or low point is confirmed:
In Green (Bull): It draws a support line at the level of the last low.
In Red (Bear): It draws a resistance line at the level of the last high.
Auto-Cleaning: If the price breaks through a support line, the line turns gray and stops. The script only keeps active (unbroken) levels on the screen.
3. It calculates an "SGE Score" (Market State) This is the "brain" of the script. It assigns a rating to the current trend:
+2 (Bullish): The price has broken a resistance.
-2 (Bearish): The price has broken a support.
0 (Neutral): The market is indecisive (for example, after a break that contradicts the previous one).
Key Feature: This score has a "one-candle delay." It waits for the next candle to close before confirming a score change, which helps avoid reacting too quickly to false alerts.
4. It simplifies visual reading To keep your chart clean and readable:
It only highlights the 3 levels closest to the current price (those most likely to be hit soon).
It colors the chart candles directly: Green if the score is +2, Red if the score is -2, and Gray if it is neutral.
5. Dashboard In the top-right corner of your screen, it displays a permanent summary:
The current score (-2, 0, or 2).
The number of active supports and resistances.
Summary: This is a "smart" trend detector. Instead of just looking at whether the price is going up or down, it waits for the price to break important structural levels (confirmed by volatility) to tell you: "Caution, the structure has just shifted from bullish to bearish."
Recommended Settings:
kRange: 1.3 / 1.4
ATR Mult: 0.3 to 0.5
Script created with Claude AI.
Order Blocks & Breaker Blocks Destek DirencOrder Blocks & Breaker Blocks Destek Direnc Al Sat Bölgeleri
Smart Floors & Ceilings [RSI + Volume] - MarcDuckMarks floors and ceilings based off of RSI and Volume
Magnitude of Price DiscoveryThis script is a simple attempt to show the magnitude of price discovery
Before we discuss how it works we need to discuss our terms.
Universal Truth of Price #1 - Price only trades in 3 distinct ways
Scenario 1 - Inside bar to previous range, consolidation.
Scenario 2 - Trending bar up or down, HH + HL to previous bar or LL + LH to previous bar
Scenario 3 - Outside bar, Higher highs AND lower lows to previous bar. Also known as a broadening formation.
If you are interested in the 2nd universal truth my indicator 'Timeframe Continuity Bars' discusses it there.
Given one of the 3 scenarios price can trade in is a broadening formation it proves that price discovery occurs as a series of new highs and new lows.
Notice the scenario 3 marked by SimpleStratNumbers
This scenario 3 is a broadening formation on the 1min and on the 30min basis.
Given this is true we know if price rejects the broadening highs it is attempting to make new lows to the broadening range
So, what this indicator does is it uses previous swing highs and swing lows and it shows you when price reclaims them and gives you a target.
The target of this indicator is guaranteed to be hit if the 2nd universal truth of price is in your favor.
This means if we reclaim a previous high to the downside. At the time of all known participation groups selling we know the magnitude of this selling would be the other side of the range
So it's simple, the solid line shows you the reclaimed level.
The dotted line shows you the magnitude.
Full timeframe continuity tells you when it is FOR SURE going to your target price via MTF analysis of the aggressiveness of the buyers/sellers.
However timeframe continuity is subject to change every 60min, every day, every week, and every month! That's the risk you take when trading.
Here's one example for you.
NASDAQ:AAPL monthly made a new low and changed to green this was your evidence price is attempting to take the other side of the range.
NASDAQ:AAPL monthly opened green again and re-confirmed the upside which meant the other side
of the range was still for certain going to be taken out.
After being taken out, breakout traders buy the highs and any shorts in aapl are forced to cover.
BOOM!
This indicator is likely to be updated in the near future to align entries on multiple timeframes.
Nothing spoken here is financial advice and it is ONLY what we know to be true about price action.
DayTradeMind Combined High Win Rate StrategyThe DayTradeMind Combined High Win Rate Strategy is a trend-following system that relies on confluence—the idea that a trade signal is stronger when multiple independent indicators agree. Instead of entering on a single indicator's whim, it uses a "voting" system to qualify entries and a strict risk-to-reward ratio to manage exits.Here is a breakdown of the three main layers of this strategy:1. The Voting Engine (Confluence Model)The strategy tracks four indicators and assigns a "point" for a bullish or bearish bias. It requires a minimum number of points (set by minConfirmations, usually 2/4) before it even considers a trade.IndicatorBullish Condition (1 point)Bearish Condition (1 point)PurposeMACDMACD Line > Signal LineMACD Line < Signal LineMeasures short-term momentum.DonchianPrice > 20-period MedianPrice < 20-period MedianIdentifies price relative to recent range.SuperTrendPrice above trend linePrice below trend lineFilters for the "Macro" trend direction.%B (Bollinger)Price in lower-mid range (0.2–0.5)Price in upper-mid range (0.5–0.8)Prevents buying when overextended.2. The Entry TriggerHaving enough "votes" (confirmations) isn't enough to enter. The strategy waits for a trigger event to ensure you aren't entering a stale trend. An entry only occurs if the minimum confirmations are met AND one of the following happens on the current bar:MACD Cross: The MACD line crosses over the signal line.Structural Break: The price crosses over the Donchian Middle (Median) line.This "Confirmation + Trigger" approach is designed to catch the start of a momentum push rather than buying a flat market.3. Mathematical Risk ManagementThe performance you see in your backtest (like the 46.86% return) is largely driven by the 2:1 Reward-to-Risk (RR) Ratio.Stop Loss (SL): Fixed at 2% below entry.Take Profit (TP): Fixed at 4% above entry.By aiming for a target twice as large as the risk, the strategy can remain profitable even with a win rate as low as 35%–40%. Mathematically, your winning trades compensate for more than two losing trades.Visualizing the SystemTriangles: Small green (up) and red (down) triangles appear on your chart only when the Votes + Trigger align perfectly.Background Shading: Faint green or red bands show you exactly when the "Confluence" is active. If the background is gray, the indicators are in conflict.Dashboard: The table in the top-right summarizes the current "score" for each indicator, letting you know how close you are to a potential trade signal.
Anhnga4.0 - Filter ToggleINPUTS:
1.5 0.8 (OR 1.6 0.5/0.6)
BE=0.45
1
MAs: 35 135
7
This Pine Script code defines a trading strategy named **"Anhnga4.0 - Filter Toggle"**. It is a trend-following strategy that uses momentum oscillators and moving averages to identify entries, while featuring a specific "Overextension Filter" to avoid buying at the top or selling at the bottom.
Here is a breakdown of how the script works:
---
## 1. Core Trading Logic (The Entry)
The strategy looks for a "perfect storm" of three factors before entering a trade:
* **Momentum (WaveTrend):** It uses the WaveTrend oscillator (`wt1` and `wt2`).
* **Long:** A bullish crossover happens while the oscillator is below the zero line (oversold).
* **Short:** A bearish crossunder happens while the oscillator is above the zero line (overbought).
* **Trend Confirmation:** The price must be on the "correct" side of three different lines: the 20-period Moving Average (BB Basis), the 50-period SMA, and the 200-period SMA.
* **The Window:** You don't have to enter exactly on the cross. The `Signal Window` allows the trade to trigger up to 4 bars after the momentum cross, provided the trend filters align.
## 2. The "Overextension" Filter
This is a unique feature of this script. It calculates the distance between the current price and the **50-period Moving Average**.
* If the price is too far away from the MA (defined by the **ATR Limit**), the script assumes the move is "exhausted."
* If `Enable Overextension Filter?` is on, the strategy will skip these trades to avoid "chasing the pump."
* **Visual Cue:** The chart background turns **purple** when the price is considered overextended.
---
## 3. Risk Management & Exit Strategy
The script manages trades dynamically using Bollinger Bands and Risk:Reward ratios:
| Feature | Description |
| --- | --- |
| **Stop Loss (SL)** | Set at the **Lower Bollinger Band** for Longs and **Upper Band** for Shorts. |
| **Take Profit (TP)** | Calculated based on your **RR Ratio** (default is 2.0). If your risk is $10, it sets the target at $20 profit. |
| **Breakeven** | A "protection" feature. Once the price moves in your favor by a certain amount (the `Breakeven Trigger`), the script moves the Stop Loss to your entry price to ensure a "risk-free" trade. |
---
## 4. Visual Elements on the Chart
* **Green Lines:** Your target price (TP).
* **Red Lines:** Your initial Stop Loss.
* **Yellow Lines:** Indicates the Stop Loss has been moved to **Breakeven**.
* **Purple Background:** High alert—price is overextended; trades are likely being filtered out.
---
## Summary of Settings
* **BB Multiplier:** Controls how wide your initial stop loss is.
* **ATR Limit:** Controls how sensitive the "Overextension" filter is (higher = more trades allowed; lower = stricter filtering).
* **Breakeven Trigger:** Set to 1.0 by default, meaning once you are "1R" (profit equals initial risk) in profit, the stop moves to entry.
EMA Scalping RR 1:2//@version=5
indicator("EMA RR 1:2 Scalping (24H + Fixed SL)", overlay=true, max_labels_count=200, max_lines_count=200)
// ===== INPUT =====
fastLen = input.int(9, "Fast EMA")
slowLen = input.int(21, "Slow EMA")
rr = input.float(2.0, "Risk Reward", step=0.1)
atrLen = input.int(14, "ATR Length")
slATR = input.float(1.0, "SL = ATR x", step=0.1)
adxLen = input.int(14, "ADX Length")
minADX = input.int(20, "Min ADX")
bodyATR = input.float(0.5, "Big Candle vs ATR", step=0.1)
// ===== EMA =====
emaFast = ta.ema(close, fastLen)
emaSlow = ta.ema(close, slowLen)
plot(emaFast, color=color.orange, linewidth=2)
plot(emaSlow, color=color.blue, linewidth=2)
// ===== ATR & CANDLE =====
atrVal = ta.atr(atrLen)
bigBody = math.abs(close - open) >= atrVal * bodyATR
// ===== MANUAL ADX =====
upMove = high - high
downMove = low - low
plusDM = (upMove > downMove and upMove > 0) ? upMove : 0
minusDM = (downMove > upMove and downMove > 0) ? downMove : 0
trur = ta.rma(ta.tr(true), adxLen)
plusDI = 100 * ta.rma(plusDM, adxLen) / trur
minusDI = 100 * ta.rma(minusDM, adxLen) / trur
dx = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)
adx = ta.rma(dx, adxLen)
trendOK = adx >= minADX
// ===== SIGNAL =====
buySignal =
trendOK and bigBody and
emaFast > emaSlow and close > emaFast and close <= emaFast
sellSignal =
trendOK and bigBody and
emaFast < emaSlow and close < emaFast and close >= emaFast
// ===== BUY =====
if buySignal
entry = close
sl = entry - atrVal * slATR
tp = entry + (entry - sl) * rr
label.new(bar_index, low,
"BUY Entry: " + str.tostring(entry) +
" SL: " + str.tostring(sl) +
" TP: " + str.tostring(tp),
style=label.style_label_up,
color=color.green,
textcolor=color.white)
line.new(bar_index, entry, bar_index+12, entry)
line.new(bar_index, sl, bar_index+12, sl, color=color.red)
line.new(bar_index, tp, bar_index+12, tp, color=color.green)
// ===== SELL =====
if sellSignal
entry = close
sl = entry + atrVal * slATR
tp = entry - (sl - entry) * rr
label.new(bar_index, high,
"SELL Entry: " + str.tostring(entry) +
" SL: " + str.tostring(sl) +
" TP: " + str.tostring(tp),
style=label.style_label_down,
color=color.red,
textcolor=color.white)
line.new(bar_index, entry, bar_index+12, entry)
line.new(bar_index, sl, bar_index+12, sl, color=color.red)
line.new(bar_index, tp, bar_index+12, tp, color=color.green)
Trend Double Pullback [Stable 20]v1.0Trend Double Pullback Trend Double Pullback Trend Double Pullback Trend Double Pullback Trend Double Pullback Trend Double
Al Sat Alpha Hunter System [MTF + Risk Manager]çok güzel yerlerden al sat komutu çıkıyor ve bunu size ücretsiz vermek istedim sizde faydalanın
The Charlie Method - EnhancedThe Charlie Method is a precision-engineered 15-minute confirmation tool built for disciplined traders who wait for price to come to them.
It identifies only true bullish and bearish engulfing candles, visually marking them at the moment of confirmation and delivering immediate alerts.
No repainting. No noise. No distractions.
This method is best applied at key levels, liquidity zones, and session extremes, where confirmation matters most.
Trade less. Confirm more. Execute with intent.
Market State Engine V2# Market State Engine
**Deterministic Confidence-Scoring System for TradingView**
A professional-grade PineScript v5 indicator that scores market conditions from 0-100, helping traders identify high-quality trading opportunities through systematic structure analysis, VWAP positioning, order flow dynamics, and time-based context.
---
## 🎯 Overview
The **Market State Engine** is not a trading bot—it's a **noise-reduction and opportunity-ranking system** designed to filter market conditions and surface only the highest-quality setups.
Instead of blindly taking every signal, this indicator:
- ✅ **Scores** market conditions objectively (0-100 scale)
- ✅ **Filters** out low-probability setups automatically
- ✅ **Classifies** opportunities into A, A+, and A++ grades
- ✅ **Alerts** only on confirmed structure shifts with supporting context
- ✅ **Keeps the human in control** - provides intelligence, not automation
### Philosophy: Reduce Noise. Enforce Discipline. Surface Quality.
---
## 🚀 Key Features
- **Deterministic Scoring** - No black boxes, fully explainable logic
- **Multi-Factor Analysis** - Combines 4 independent market state components
- **Structure-First Approach** - Only alerts on confirmed pivot breaks
- **VWAP Mean Reversion Logic** - Directional filtering based on VWAP zones
- **Order Flow Proxy** - CVD divergence and confirmation detection
- **Session-Aware Scoring** - Prioritizes high-volume New York sessions
- **Alert De-Duplication** - One alert per unique structure shift
- **Zero Repainting** - Uses confirmed pivots only (left=2, right=2)
- **Fully Configurable** - All parameters exposed as inputs
- **Visual Feedback** - VWAP bands, setup labels, and real-time score panel
---
## 📊 Scoring System (0-100)
The Market State Engine evaluates **four independent components**, each contributing up to **25 points** for a maximum total score of **100**.
### 🎯 Component Breakdown
| Component | Max Points | Description |
|-----------|------------|-------------|
| **VWAP Context** | 25 | Measures price deviation from session VWAP |
| **Structure Shift** | 25 | Confirms pivot breakout (HARD GATE) |
| **CVD Alignment** | 25 | Detects order flow divergence/confirmation |
| **Time-of-Day** | 25 | Identifies high-probability trading sessions |
---
### 1️⃣ VWAP Context (Max 25 Points)
**Purpose:** Identifies extreme price deviations from fair value for mean-reversion opportunities.
VWAP (Volume-Weighted Average Price) is calculated session-anchored to New York market time, with standard deviation bands creating zones of opportunity.
#### Band Structure:
- **1st Band**: ±1σ from VWAP (fair value zone)
- **2nd Band**: ±2σ from VWAP (moderate deviation)
- **3rd Band**: ±3σ from VWAP (extreme deviation)
#### Scoring Logic (Exclusive):
```
Price in 3rd VWAP Band (>2σ and ≤3σ) → +25 points
Price in 2nd VWAP Band (>1σ and ≤2σ) → +15 points
Otherwise (inside 1σ or beyond 3σ) → 0 points
```
**Key Insight:** The further price stretches from VWAP, the higher the probability of mean reversion.
---
### 2️⃣ Structure Shift (Max 25 Points) — **HARD GATE**
**Purpose:** Confirms momentum shift through confirmed pivot breakouts.
⚠️ **CRITICAL:** Structure shift is **mandatory**. If no valid structure shift occurs, the **total score becomes 0** regardless of other factors.
#### Detection Method:
Uses TradingView's `ta.pivothigh()` and `ta.pivotlow()` functions with **locked parameters**:
- **Left bars**: 2
- **Right bars**: 2
- **Source**: Configurable (Wick or Body)
- **Break confirmation**: Candle close only
#### Bullish Structure Shift:
- ✅ Prior swing high exists (confirmed pivot)
- ✅ Current candle **closes above** swing high + tick buffer
- ✅ Must occur in VWAP 2nd or 3rd band
- ✅ **VWAP Filter**: Price must be **at or below VWAP** (lower bands)
#### Bearish Structure Shift:
- ✅ Prior swing low exists (confirmed pivot)
- ✅ Current candle **closes below** swing low - tick buffer
- ✅ Must occur in VWAP 2nd or 3rd band
- ✅ **VWAP Filter**: Price must be **at or above VWAP** (upper bands)
#### Scoring:
```
Valid structure shift → +25 points
No structure shift → Total score = 0
```
**Tick Buffer:** Default 5 ticks (configurable) - prevents false breaks from minor price noise.
---
### 3️⃣ CVD Alignment (Max 25 Points)
**Purpose:** Detects institutional order flow through volume delta analysis.
CVD (Cumulative Volume Delta) is a proxy for order flow:
```
Close > Open → +Volume (buying pressure)
Close < Open → -Volume (selling pressure)
```
#### Scoring Logic:
| Condition | Points | Description |
|-----------|--------|-------------|
| **Divergence** | +25 | Price makes higher high + CVD makes lower high (bearish)Price makes lower low + CVD makes higher low (bullish) |
| **Confirmation** | +20 | Price and CVD both make higher highs or lower lows |
| **Neutral** | 0 | No clear divergence or confirmation |
**Lookback Window:** Last 20 bars (configurable) - prevents stale divergences.
**Key Insight:** Divergences suggest weakening momentum, while confirmations validate the trend.
---
### 4️⃣ Time-of-Day Context (Max 25 Points)
**Purpose:** Prioritizes high-volume, high-volatility New York sessions.
#### Scored Sessions (America/New_York timezone):
| Session | Time Range (NY) | Points | Description |
|---------|-----------------|--------|-------------|
| **Pre-Market** | 03:00 - 04:00 | +25 | Early liquidity injection |
| **Market Open** | 09:30 - 11:30 | +25 | Highest volume period |
| **Off-Hours** | All other times | 0 | Lower probability setups |
**Key Insight:** Structure shifts during active sessions have higher follow-through probability.
---
## 🏆 Setup Classification
Setups are graded based on total score thresholds (configurable):
| Grade | Score Range | Typical Components | Quality Level |
|-------|-------------|-------------------|---------------|
| **A++ Setup** | ≥90 | All 4 factors aligned(VWAP 3rd band + Structure + CVD + Session) | Premium - Rare |
| **A+ Setup** | ≥75 | Structure + VWAP + CVD or Session(3 of 4 factors) | High - Select |
| **A Setup** | ≥60 | Structure + VWAP + Session(Minimum viable setup) | Good - Regular |
| **No Grade** | <60 | Insufficient confluence | Filtered out |
**Default Thresholds:**
- A Setup: 60 points
- A+ Setup: 75 points
- A++ Setup: 90 points
---
## 📥 Installation
### Step 1: Download the Indicator
Download the `market_state_engine.pine` file from this repository.
### Step 2: Add to TradingView
1. Open (www.tradingview.com)
2. Open the **Pine Editor** (bottom panel)
3. Click **"New"** → **"Blank indicator"**
4. Delete all default code
5. Paste the contents of `market_state_engine.pine`
6. Click **"Add to Chart"**
### Step 3: Configure for Your Symbol
1. Click the **gear icon** next to the indicator name
2. Adjust **Tick Size** for your instrument:
- ES futures: `0.25`
- NQ futures: `0.25`
- Stocks: `0.01`
3. Save settings
---
## ⚙️ Configuration
### Symbol Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| **Tick Size** | 0.25 | Minimum price movement for your symbol |
| **Tick Buffer Count** | 5 | Ticks beyond swing for valid break |
### VWAP Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| **VWAP Band 1 (σ)** | 1.0 | 1st standard deviation multiplier |
| **VWAP Band 2 (σ)** | 2.0 | 2nd standard deviation multiplier |
| **VWAP Band 3 (σ)** | 3.0 | 3rd standard deviation multiplier |
### Session Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| **Session 1** | 0300-0400 | Pre-market window (NY time) |
| **Session 2** | 0930-1130 | Market open window (NY time) |
### Score Thresholds
| Parameter | Default | Description |
|-----------|---------|-------------|
| **A Setup Threshold** | 60 | Minimum score for A grade |
| **A+ Setup Threshold** | 75 | Minimum score for A+ grade |
| **A++ Setup Threshold** | 90 | Minimum score for A++ grade |
### CVD Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| **CVD Divergence Lookback** | 20 | Maximum bars for divergence detection |
### Swing Settings
| Parameter | Default | Options | Description |
|-----------|---------|---------|-------------|
| **Swing Detection Method** | Wick | Wick / Body | Use high/low or open/close for pivots |
### Visual Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| **Show VWAP Bands** | ✅ | Display VWAP and standard deviation bands |
| **Show Setup Labels** | ✅ | Display setup markers on chart |
| **Show Score Panel** | ✅ | Display real-time score breakdown |
---
## 📖 How to Use
### Step 1: Apply to 1-Minute Chart
⚠️ **The indicator is locked to 1-minute timeframe** - do not use on other timeframes.
### Step 2: Understand the Visual Signals
#### Setup Labels
- **Green Triangle (▲)** - Bullish (Long) setup detected
- **Red Triangle (▼)** - Bearish (Short) setup detected
- Label shows **Grade** (A/A+/A++) and **Total Score**
#### VWAP Bands
- **Yellow Line** - Session VWAP (fair value)
- **Blue Bands** - ±1σ (fair value zone)
- **Purple Bands** - ±2σ (moderate deviation)
- **Red Bands** - ±3σ (extreme deviation)
#### Score Panel (Top Right)
Real-time breakdown of all four components:
```
Component Score
VWAP Zone 15/25
Structure 25/25
CVD 20/25
Session 25/25
TOTAL 85/100 (A+)
```
### Step 3: Interpret Signals
#### Valid Long Setup:
✅ Green triangle below candle
✅ Price in **lower VWAP bands** (below VWAP)
✅ Structure shift breaks swing high
✅ Score ≥60
#### Valid Short Setup:
✅ Red triangle above candle
✅ Price in **upper VWAP bands** (above VWAP)
✅ Structure shift breaks swing low
✅ Score ≥60
### Step 4: Set Up Alerts (See Alert Conditions section)
---
## 🚦 Signal Filters (VWAP Zone Logic)
The indicator uses **directional VWAP filtering** to prevent counter-trend signals:
### Long Signals (Green)
**Only allowed when price is AT or BELOW VWAP**
- ✅ Lower 2nd band (-2σ to -1σ)
- ✅ Lower 3rd band (-3σ to -2σ)
- ✅ At VWAP exactly
- ❌ **BLOCKED** in upper bands (above VWAP)
**Logic:** Longs when price is stretched below fair value (mean reversion)
### Short Signals (Red)
**Only allowed when price is AT or ABOVE VWAP**
- ✅ Upper 2nd band (+1σ to +2σ)
- ✅ Upper 3rd band (+2σ to +3σ)
- ✅ At VWAP exactly
- ❌ **BLOCKED** in lower bands (below VWAP)
**Logic:** Shorts when price is stretched above fair value (mean reversion)
---
## 🎨 Visual Elements
### Chart Overlays
| Element | Color | Description |
|---------|-------|-------------|
| **VWAP Line** | Yellow | Session-anchored fair value |
| **±1σ Bands** | Blue | Fair value zone (no score) |
| **±2σ Bands** | Purple | Moderate deviation (15 pts) |
| **±3σ Bands** | Red | Extreme deviation (25 pts) |
| **Swing Highs** | Red ▼ | Confirmed pivot highs |
| **Swing Lows** | Green ▲ | Confirmed pivot lows |
| **Session Background** | Light Green | Active high-value session |
### Setup Labels
**Bullish Setup:**
```
A+
▲ 75
```
Green label below candle, shows grade and score
**Bearish Setup:**
```
A++
▼ 90
```
Red label above candle, shows grade and score
### Score Panel
Real-time table in top-right corner:
- Individual component scores (0-25 each)
- Total score (0-100)
- Current setup grade (A/A+/A++)
- Updates in real-time as market conditions change
---
## 🔔 Alert Conditions
### Setting Up Alerts
#### Method 1: Built-in Alert Conditions
1. Click **"Create Alert"** in TradingView
2. Select **Market State Engine** as condition
3. Choose alert type:
- **Bullish Setup** - Long signals only
- **Bearish Setup** - Short signals only
- **Any Setup** - All signals
4. Set to **"Once Per Bar Close"**
5. Configure notification method (app, email, webhook)
#### Method 2: Custom Alert Message
Alert messages include full breakdown:
```
A+ Setup Detected (Score: 85)
Components: VWAP(25) + Structure(25) + CVD(20) + Time(15)
CVD State: Confirmation
Direction: Long
Timeframe: 1m
```
### Alert Behavior
✅ **One alert per unique pivot break** - no spam
✅ **Fires on candle close only** - no repainting
✅ **Minimum score filter** - only A grade or higher (≥60)
✅ **Direction-specific** - separate bullish/bearish conditions
⚠️ **No cooldown between different pivots** - multiple alerts per session allowed if different swing levels break
---
## 🔧 Technical Details
### Timeframe Lock
- **Required**: 1-minute chart only
- **Reason**: Scoring model calibrated for 1m micro-structure
- **Future**: Multi-timeframe support planned for v2
### Timezone Configuration
- **Hard-coded**: `America/New_York`
- **Session Detection**: Uses TradingView's native session functions
- **Consistency**: All time-based logic uses NY timezone
### Swing Detection Parameters
**Locked to specification:**
- `ta.pivothigh(source, left=2, right=2)`
- `ta.pivotlow(source, left=2, right=2)`
**Implications:**
- Pivots confirmed 2 bars after formation
- No repainting - historical pivots don't move
- 4-bar minimum swing structure (2 left + pivot + 2 right)
### VWAP Calculation
- **Type**: Session-anchored (resets daily)
- **Source**: Typical price `(high + low + close) / 3`
- **Weighting**: Volume-weighted
- **Standard Deviation**: True population standard deviation
### CVD Proxy Formula
```pine
barDelta = close > open ? volume : close < open ? -volume : 0
CVD = cumulative sum of barDelta (session-reset)
```
### Performance Limits
- **Max Labels**: 500 (TradingView limit)
- **Max Bars Back**: 500
- **Memory**: Lightweight - uses only essential variables
---
## 💡 Best Practices
### 1. **Use as a Filter, Not a Strategy**
❌ Don't: Blindly take every signal
✅ Do: Use score as confluence for your existing analysis
### 2. **Higher Grades = Better Probability**
- **A Setups (60-74)**: Regular opportunities, still require discretion
- **A+ Setups (75-89)**: High-quality, multiple factors aligned
- **A++ Setups (90-100)**: Rare premium opportunities, strongest edge
### 3. **Respect the VWAP Zone Filter**
The indicator **automatically blocks**:
- Longs in upper VWAP bands (counter-trend)
- Shorts in lower VWAP bands (counter-trend)
Trust this logic - it enforces mean reversion discipline.
### 4. **Monitor the Score Panel**
Watch which components are scoring to understand **why** a setup formed:
- Missing CVD score? → No order flow confirmation
- Missing Time score? → Outside high-volume sessions
- Low VWAP score? → Weak deviation from fair value
### 5. **Combine with Risk Management**
The indicator provides **opportunity scoring**, not position sizing:
- Use stop losses based on swing structure
- Scale position size with setup grade (larger on A++, smaller on A)
- Set profit targets at VWAP or opposing band
### 6. **Session Awareness**
Prioritize signals during **active sessions**:
- **03:00-04:00 NY**: Pre-market momentum
- **09:30-11:30 NY**: Highest volume, tightest spreads
Off-hours signals (0 time score) are lower probability but still valid if other factors strong.
### 7. **Understand the Hard Gate**
If **no structure shift** occurs:
- Total score = 0
- No alerts fire
- Other components irrelevant
**Why?** Structure shift confirms momentum change - without it, there's no tradable opportunity.
### 8. **Avoid Over-Optimization**
Default settings are well-calibrated:
- Don't chase "perfect" parameters
- Test changes on historical data before live use
- Document any modifications
### 9. **Leverage Alert De-Duplication**
The indicator prevents spam automatically:
- One alert per unique swing break
- New swing levels = new alerts
- No need to manually filter notifications
### 10. **Supplement with Price Action**
Use the indicator alongside:
- Support/resistance levels
- Order flow footprint charts
- Volume profile
- Market internals (breadth, TICK, etc.)
---
## 📚 Example Scenarios
### Example 1: A++ Premium Setup (Score: 95)
```
Price: In lower 3rd VWAP band (-2.8σ) → VWAP: 25 pts
Structure: Close breaks swing high → Structure: 25 pts
CVD: Price LL + CVD HL (bullish div) → CVD: 25 pts
Time: 10:15 AM NY (market open) → Time: 25 pts
Direction: LONG (price below VWAP) → Valid
Grade: A++ (95/100)
```
**Interpretation:** All factors aligned - premium mean-reversion long opportunity.
---
### Example 2: A+ Strong Setup (Score: 80)
```
Price: In upper 2nd VWAP band (+1.5σ) → VWAP: 15 pts
Structure: Close breaks swing low → Structure: 25 pts
CVD: Price HH + CVD LH (bearish div) → CVD: 25 pts
Time: 2:00 PM NY (off-hours) → Time: 0 pts
Direction: SHORT (price above VWAP) → Valid
Grade: A+ (65/100)
```
**Interpretation:** Strong setup despite off-hours, bearish divergence adds confidence.
---
### Example 3: Filtered Setup (Score: 0)
```
Price: In upper 3rd VWAP band (+2.5σ) → VWAP: 25 pts (if allowed)
Structure: Close breaks swing high → Structure: BLOCKED
CVD: Price HH + CVD HH (confirmation) → CVD: 20 pts (if allowed)
Time: 10:00 AM NY → Time: 25 pts (if allowed)
Direction: LONG (price ABOVE VWAP) → ❌ INVALID ZONE
Grade: None (0/100) - NO ALERT
```
**Interpretation:** VWAP filter blocked long signal in upper band - prevents counter-trend trade.
---
## 🛠️ Troubleshooting
### No Signals Appearing
- ✅ Verify you're on **1-minute chart**
- ✅ Check **Tick Size** matches your symbol
- ✅ Ensure **VWAP Bands** are visible
- ✅ Wait for confirmed pivots (requires at least 5 bars of history)
### Alerts Not Firing
- ✅ Confirm alert is set to **"Once Per Bar Close"**
- ✅ Check score threshold (must be ≥60 by default)
- ✅ Verify VWAP zone filter isn't blocking signals
- ✅ Check that structure shift is actually occurring
### Score Always Zero
- ✅ No structure shift detected (hard gate active)
- ✅ Price may not be in valid VWAP zone (2nd or 3rd band)
- ✅ Insufficient swing history (wait for pivots to form)
### Too Many/Too Few Signals
**Too many signals:**
- Increase **A Setup Threshold** (e.g., 70 instead of 60)
- Increase **Tick Buffer Count** (reduces false breaks)
**Too few signals:**
- Decrease **A Setup Threshold** (e.g., 50 instead of 60)
- Decrease **Tick Buffer Count** (more sensitive to breaks)
---
## 📜 License
This indicator is provided under the **Mozilla Public License 2.0**.
---
## 🤝 Credits
Developed as a professional trading tool for systematic opportunity identification.
**Philosophy:** Reduce noise. Enforce discipline. Keep the human in control.
---
## 📞 Support
For questions, issues, or feature requests, please consult:
1. This README documentation
2. The specification document (`pinescript_market_state_engine_spec.docx`)
3. Inline code comments in `market_state_engine.pine`
---
## 🔄 Version History
**v1.0** (Current)
- Initial release
- 4-component scoring model (VWAP + Structure + CVD + Time)
- VWAP zone directional filtering
- Alert de-duplication
- Configurable inputs
- Real-time score panel
- Session-aware logic
---
## 🎓 Understanding the Numbers
### Quick Reference Card
| Score Range | Grade | Quality | Typical Use |
|-------------|-------|---------|-------------|
| 90-100 | A++ | Premium | Highest conviction trades |
| 75-89 | A+ | High | Strong probability setups |
| 60-74 | A | Good | Acceptable with discretion |
| 0-59 | None | Filtered | Skip or wait for confluence |
### Component Contribution Examples
**Minimum A Setup (60 points):**
- Structure (25) + VWAP 3rd band (25) + Time (25) = 75 ✅
**Typical A+ Setup (75 points):**
- Structure (25) + VWAP 2nd band (15) + CVD confirm (20) + Time (25) = 85 ✅
**Maximum A++ Setup (100 points):**
- Structure (25) + VWAP 3rd band (25) + CVD divergence (25) + Time (25) = 100 ✅
---
## 🎯 Final Reminder
**This is NOT a trading bot.**
**This is NOT financial advice.**
**This is a decision-support tool.**
Always:
- ✅ Use proper risk management
- ✅ Understand the logic before trading
- ✅ Backtest on your symbols
- ✅ Keep the human in control
**Happy Trading! 📈**
Prop Firm EMA RSI Pullback (HTF Bias)by ShuvoHigher Timeframe (HTF) Bias — The Boss Sets the Rules
Purpose:
You don’t fight institutions. You follow their footprints.
Logic:
Use a Higher Timeframe (usually H4 or D1)
Apply:
EMA 200 (trend ruler)
Optional: EMA 50 for confirmation
Bias Rules:
Bullish Bias
Price above EMA 200
EMA 200 sloping up
Bearish Bias
Price below EMA 200
EMA 200 sloping down
🚫 If price is chopping around EMA 200 → NO TRADE
Prop firms love discipline, not gamblers.
XAUUSD Pro Swing Strategy (RR 1:2)//@version=5
strategy("XAUUSD Pro Swing Strategy (RR 1:2)", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=2)
// ===== INPUTS =====
emaFastLen = input.int(20, "Fast EMA")
emaMidLen = input.int(50, "Mid EMA")
emaTrendLen = input.int(200, "Trend EMA (HTF)")
rsiLen = input.int(14, "RSI Length")
atrLen = input.int(14, "ATR Length")
atrSLMult = input.float(1.5, "ATR SL Multiplier")
rr = input.float(2.0, "Risk Reward")
// ===== HTF TREND =====
htfEMA = request.security(syminfo.tickerid, "D", ta.ema(close, emaTrendLen))
// ===== INDICATORS =====
emaFast = ta.ema(close, emaFastLen)
emaMid = ta.ema(close, emaMidLen)
rsi = ta.rsi(close, rsiLen)
atr = ta.atr(atrLen)
// ===== TREND CONDITIONS =====
bullTrend = close > htfEMA and emaFast > emaMid
bearTrend = close < htfEMA and emaFast < emaMid
// ===== ENTRY CONDITIONS =====
buyCond = bullTrend and ta.crossover(emaFast, emaMid) and rsi > 55
sellCond = bearTrend and ta.crossunder(emaFast, emaMid) and rsi < 45
// ===== SL & TP =====
buySL = close - atr * atrSLMult
buyTP = close + (atr * atrSLMult * rr)
sellSL = close + atr * atrSLMult
sellTP = close - (atr * atrSLMult * rr)
// ===== ORDERS =====
if buyCond
strategy.entry("BUY", strategy.long)
strategy.exit("BUY EXIT", "BUY", stop=buySL, limit=buyTP)
if sellCond
strategy.entry("SELL", strategy.short)
strategy.exit("SELL EXIT", "SELL", stop=sellSL, limit=sellTP)
// ===== PLOTS =====
plot(emaFast, color=color.orange)
plot(emaMid, color=color.blue)
plot(htfEMA, color=color.red, linewidth=2)
plotshape(buyCond, style=shape.labelup, text="BUY", color=color.green, location=location.belowbar)
plotshape(sellCond, style=shape.labeldown, text="SELL", color=color.red, location=location.abovebar)
WatchmenThe Watchmen Indicator tracks potential market maker breakeven zones using dynamic open/close ranges (no wicks in Fib calc). It expands the range until the 50% level is breached by the full candle range, then resets. Green = long/down setups (buy retrace), Red = short/up setups (sell retrace). Uses only open/close for levels, high/low for breaches. Ideal for mean-reversion in trends.
DkS Market Structure Breakout Strategy Crypto & ForexDkS Market Structure Breakout Strategy Crypto & Forex
🔍 Overview
DkSPro – Universal Market Analysis is a structure-based trading strategy designed for Crypto and Forex markets, focused on trend alignment, breakout confirmation, and volume validation.
This strategy is built to filter low-quality trades, avoid ranging conditions, and reduce false breakouts by requiring multiple layers of confirmation before any trade is executed.
It is intended for scalping and intraday trading, prioritizing consistency and risk control over trade frequency.
🧠 Strategy Logic (How It Works)
DkSPro follows a sequential decision process, not a single-indicator signal:
Trend Bias (EMA Structure)
A fast and slow EMA define the directional bias.
Long trades are only allowed during bullish EMA alignment.
Short trades are only allowed during bearish EMA alignment.
This prevents counter-trend and ranging-market entries.
Market Structure & Breakout Validation
The strategy identifies recent swing highs and lows.
Trades are triggered only after a confirmed breakout of structure, not during consolidation.
This avoids early entries and false momentum moves.
Volume Confirmation
Volume must exceed its moving average by a defined multiplier.
This ensures participation and filters out low-liquidity breakouts.
Volume thresholds adapt depending on the selected trading mode.
Momentum Confirmation (RSI)
RSI is used strictly as a momentum filter, not as a standalone signal.
It confirms that price movement aligns with the breakout direction.
Risk Management (Mandatory)
Every position includes a predefined Stop Loss and Take Profit.
Position sizing is based on a fixed percentage of equity, keeping risk per trade within sustainable limits.
All conditions must align simultaneously; otherwise, no trade is executed.
⚙️ Trading Modes
SAFE Mode
Stronger volume and RSI thresholds
Fewer trades, higher selectivity
Designed for risk control and consistency
AGGRESSIVE Mode
Slightly relaxed filters
Higher trade frequency during strong momentum
Intended for experienced users only
📊 Markets & Assets
This strategy has been actively used and tested on:
🟢 Crypto (Binance / Binance.US)
SOL-USDT
XRP-USDT
Other high-liquidity pairs (BTC, ETH)
Crypto mode benefits from stronger volume confirmation to adapt to higher volatility.
🔵 Forex
Major pairs such as EURUSD, GBPUSD, USDJPY
Optimized for liquid markets with lower relative volume
The same structural logic applies to both markets, with volume behavior naturally adapting to each asset class.
⏱ Recommended Timeframes
Crypto: 5m – 15m
Forex: 15m – 1H
Lower timeframes (1m) are not recommended due to noise and unreliable volume behavior.
🧪 Backtesting & Settings Transparency
Default strategy properties are intentionally conservative to reflect realistic conditions:
Initial capital: $20,000
Position size: 2% of equity
Commission: 0.08%
Slippage: 1 tick
Fixed Stop Loss and Take Profit on every trade
Backtests should be performed on sufficient historical data (ideally 6–12 months) to ensure a statistically meaningful sample size (100+ trades).
📈 Originality & Usefulness
DkSPro is not a simple indicator mashup.
Each component serves a specific role in a layered confirmation system:
EMAs define direction
Structure defines timing
Volume validates participation
RSI confirms momentum
Risk management controls exposure
Removing any layer significantly reduces signal quality. The strategy is designed as a complete decision framework, not a signal generator.
⚠️ Important Notes
This script is an analysis and execution tool, not financial advice.
Market conditions change, and no strategy performs well in all environments.
Users are encouraged to backtest, forward test, and adjust position sizing according to their own risk tolerance.
🧩 Version Notice
This publication represents a consolidated and refined version of an internal experimental script.
No parallel or duplicate versions are intended.
All future improvements will be released exclusively using TradingView’s Update feature.
🇪🇸 Descripción en Español (Resumen)
DkSPro es una estrategia basada en estructura de mercado, diseñada para Crypto y Forex, que combina tendencia, ruptura de estructura, volumen y control de riesgo.
Solo opera cuando todas las condiciones se alinean, evitando rangos, falsas rupturas y sobreoperar.
Ha sido utilizada en Binance con pares como SOL-USDT y XRP-USDT, así como en Forex, siempre con gestión de riesgo fija y condiciones realistas.
High-volume buy and sell signals with OB and FVGBuy and sell signals on ob
Pivot Point Usage: Instead of detecting each candle of an opposite color, the script uses `ta.pivothigh/low`. This means it only marks a Pivot Point if the price has actually made a significant high or low relative to the 10 preceding and following candles.
Dynamic Cleanup (Mitigation): As soon as the price returns to "fill" the area (depending on your choice: simple contact or close), the box disappears from the chart. This keeps your view clean and focused on the remaining untouched areas.
Period Setting: You can increase the "Detection Period" (e.g., from 10 to 20) in the settings to filter out even more noise and keep only the major areas.
How to use it?
Chotkiy Rasklad 1.5Chotkiy Rasklad v1.5
Chotkiy Rasklad v1.5 is a professional-grade Multi-Timeframe (MTF) market scanner designed for precision day trading and scalping.
Unlike standard indicators that lag, this system focuses on Confluence . It visualizes the alignment of Price Action, Institutional Trend Filters, and Volatility across 6 timeframes simultaneously (1m to Daily).
New in v1.5: Integration of the ADX Color Engine to visually identify trend strength and "Overheated" (Parabolic) states instantly.
🚀 CORE FEATURES
MTF Dashboard: A real-time heads-up display monitoring 1m, 5m, 15m, 1h, 4h, and 1D timeframes. Trend Confluence Algorithm: Signals are generated only when Heikin Ashi structure aligns with SMA 200, EMA 200, and VWAP. ADX Volatility Engine: Color-coded ADX cells to filter out chop and highlight extreme momentum. Session Awareness: Automatically flags the "Opening Mess" and specific trading sessions to provide context. No Repainting: All logic is based on confirmed candle states and real-time data.
📊 STRATEGY LOGIC
The system uses a strict "Waterfall" logic. A BUY or SELL signal in the "ACTION" row is only generated if ALL the following conditions are met:
1. Institutional Filters (The Bias) To ensure we trade with the "Smart Money," the script checks three key levels: Long Condition: Price > SMA 200 AND Price > EMA 200 AND Price > VWAP. Short Condition: Price < SMA 200 AND Price < EMA 200 AND Price < VWAP.
2. Momentum & Structure (The Trigger) Candle Structure: Requires a sequence of 3 consecutive Heikin Ashi candles (Green for Long, Red for Short) with valid step-up/step-down structures. HARSI Filter: Uses Heikin Ashi RSI to confirm momentum direction (> 50 for Bulls, < 50 for Bears).
3. ADX Volatility Engine (The Safety) The Dashboard displays the raw ADX value with specific background colors to guide your decision: Gray (< 20): NO TRADE ZONE. The market is choppy/consolidating. Signals here are likely fakeouts. Yellow (20 - 25): Waking Up. Volatility is increasing; a trend may be starting. Bright Green (26 - 50): PRIME ZONE. Strong, healthy trend. The best probability for entry. Sky Blue (> 50): EXTREME / PARABOLIC. The trend is overheated. Be cautious of "V-Shape" reversals or exhaustion.
🎯 HOW TO READ THE DASHBOARD
The Dashboard is located in the top-right corner.
Scan the "ACTION" Row: Look for a column (e.g., 5m or 15m) that says BUY (Green) or SELL (Red). If it says WAIT (Gray), the filters do not align.
Verify with ADX: Is the ADX cell below it Green or Yellow? Good. Is it Gray ? Skip the trade. Is it Sky Blue ? Tighten your stop-loss immediately.
Check Higher Timeframes: If you are scalping the 5m, ensure the 15m and 1h columns are also colored in your direction.
⚙️ SETTINGS
Global Filters: Custom lengths for SMA and EMA (Default: 200). HARSI Settings: Sensitivity of the momentum filter. Time Settings: Define your local Opening/Morning/Evening sessions for the "TIME" row status. Dashboard: Toggle visibility, change size (Tiny/Small/Normal), and adjust vertical/horizontal offsets.
⚠️ DISCLAIMER This tool is for educational and informational purposes only. It does not constitute financial advice. Trading involves significant risk. Always manage your risk appropriately. Past performance is not indicative of future results.
© 2026 Sergei Seivach
Neeson Volatility Adaptive Tracker ProVolatility Adaptive Tracker Pro: A Comprehensive Multi-Method Trading System
Executive Summary
The Volatility Adaptive Tracker Pro (VAT Pro) represents a sophisticated fusion of proven technical analysis methodologies with innovative adaptations, creating a unique multi-signal trading system. Unlike single-purpose indicators, VAT Pro combines multiple analytical approaches into a unified framework that addresses the complex realities of modern financial markets. This system is designed for traders who recognize that no single method consistently outperforms, and that market conditions require adaptive, multi-faceted approaches.
Original Innovations: What Sets VAT Pro Apart
1. Hybrid Volatility Measurement System
Most volatility indicators fall into two categories: those based on standard deviation (like Bollinger Bands) or those based on average true range (ATR). VAT Pro introduces a third approach: a weighted volatility measurement system that gives greater importance to recent price movements while maintaining sensitivity to overall market conditions. This creates a dynamic volatility assessment that adapts more responsively to changing market environments than conventional methods.
2. Dual-Layer Signal Architecture
While most indicators generate single-type signals, VAT Pro implements a tiered signaling system that distinguishes between:
Primary trend-following signals (based on price crossing adaptive volatility bands)
Secondary volume-confirmed signals (requiring both price movement and exceptional volume)
This dual-layer approach recognizes that not all market moves have equal significance, and that volume confirmation often signals more substantial moves worthy of special attention.
3. State-Based Logic with Memory
Conventional indicators typically generate signals independently on each bar. VAT Pro introduces persistent state tracking that maintains awareness of whether the market is currently in a bullish, bearish, or neutral condition. This prevents signal redundancy, reduces false signals, and provides valuable context for interpreting current market conditions.
What VAT Pro Does: Comprehensive Market Analysis
Primary Functions
Trend Identification: Detects transitions between bullish and bearish market conditions using multiple confirmation criteria.
Volume Analysis: Identifies exceptional trading activity that often precedes or confirms significant price movements.
Volatility Assessment: Continuously measures market volatility and adjusts sensitivity parameters accordingly.
Visual Context Provision: Uses color-coded price bars, trend lines, and clear signal markers to provide immediate visual feedback.
Multi-Timeframe Compatibility: Functions effectively across various trading timeframes from intraday to positional trading.
Implementation Methodology: The Technical Framework
Core Analytical Approaches
Among the hundreds of available technical analysis methods, VAT Pro specifically implements and integrates:
A. Adaptive Volatility Channel System
This approach modifies the traditional volatility channel concept by:
Using weighted moving averages for volatility calculation rather than simple or exponential averages
Implementing asymmetric response to upward versus downward volatility
Maintaining dynamic channel width that adjusts based on recent market conditions
The system falls within the broader category of volatility-adjusted trend following but introduces unique adaptations that improve responsiveness while maintaining stability.
B. Volume-Price Confirmation Method
Within volume analysis, VAT Pro specifically employs:
Threshold-based volume spike detection (volume exceeding moving average by specified multiples)
Price-direction confirmation (requiring price movement in the expected direction)
Contextual filtering (only considering volume signals in specific market conditions)
This represents a specific implementation within the volume confirmation family of methods, distinguished by its customizable thresholds and filtering logic.
C. Trailing Stop with Adaptive Positioning
The system implements a specific variant of trailing stop methodology characterized by:
State-dependent positioning (different logic for trending versus ranging markets)
Volatility-adjusted distance (stop levels adapt to current market conditions)
Memory of previous positions (the system "remembers" previous trend states)
This approach represents an advanced form of trailing stop placement that combines elements of volatility adjustment with trend state awareness.
Calculation Philosophy: The Core Principles
1. Weighted Response Philosophy
VAT Pro operates on the principle that recent market action should have greater influence than distant history, but not to the exclusion of broader context. This is implemented through custom weighting algorithms that balance responsiveness with stability.
2. Multi-Factor Confirmation Principle
The system is built on the premise that multiple confirming factors (price action, volume, volatility) provide more reliable signals than single-factor approaches. This represents a practical implementation of convergence/divergence analysis across different market dimensions.
3. State Transition Logic
Rather than viewing each bar in isolation, VAT Pro analyzes sequences of price action to determine market states and state transitions. This recognizes that markets often move through identifiable phases (accumulation, trending, distribution, ranging) that require different analytical approaches.
4. Adaptive Sensitivity
The system automatically adjusts its sensitivity based on current market volatility, becoming more responsive in low-volatility conditions and more stable in high-volatility environments. This represents a practical implementation of volatility-adjusted trading logic.
Practical Application: How to Use VAT Pro
Initial Setup and Configuration
Parameter Customization: Begin with default settings, then adjust based on:
Your trading instrument's typical volatility characteristics
Your preferred trading timeframe
Your risk tolerance and trading style
Visual Configuration: Customize colors and display settings to match your charting preferences while maintaining clear signal visibility.
Trading Methodology Integration
VAT Pro supports multiple trading approaches:
For Trend Following:
Use primary signals when confirmed by overall market direction
Employ the adaptive line as a dynamic trailing stop
Monitor state transitions for trend continuation or reversal clues
For Breakout Trading:
Watch for high-volume signals at key price levels
Use volatility bands to identify potential breakout ranges
Employ volume confirmation to distinguish genuine breakouts from false moves
For Position Management:
Utilize the color-coded bar system for immediate trend awareness
Monitor multiple signal types for confirmation or warning signs
Adjust position sizes based on signal strength and market state
Signal Interpretation Framework
Primary Signal Interpretation:
Bullish signals suggest potential long opportunities
Bearish signals indicate potential short opportunities
Signal clustering often indicates stronger moves
Volume Signal Significance:
High-volume buy signals often precede sustained upward moves
High-volume sell signals frequently indicate distribution or panic selling
Volume signals without price confirmation require caution
Contextual Analysis:
Consider market state when interpreting signals
Evaluate signal strength based on recent volatility
Monitor multiple timeframes for confirmation
Performance Characteristics and Best Practices
Optimal Market Conditions
VAT Pro performs best in markets exhibiting:
Clear trending characteristics (for trend-following signals)
Occasional volatility expansions (for volume signals)
Reasonable liquidity (for accurate volume analysis)
Risk Management Integration
Use signal strength to adjust position sizing
Employ the adaptive line for stop-loss placement
Consider market state when determining risk levels
Complementary Tools
For best results, combine VAT Pro with:
Support and resistance analysis
Longer-term trend assessment
Fundamental analysis (for longer timeframes)
Market structure analysis
Conclusion: A Modern Multi-Method Approach
The Volatility Adaptive Tracker Pro represents a significant advancement in technical analysis tools by intelligently combining multiple proven methodologies into a coherent, adaptive system. Its original innovations in weighted volatility measurement, dual-layer signaling, and state-based logic address common limitations of conventional indicators while maintaining practical usability.
By specifically implementing adaptive volatility channels, volume-price confirmation, and state-aware trailing stops, VAT Pro provides traders with a comprehensive toolkit that adapts to changing market conditions while maintaining methodological rigor. This multi-method approach recognizes the complex reality of financial markets while providing clear, actionable signals based on sound technical principles.
Whether used as a primary trading system or as a confirming component within a broader strategy, VAT Pro offers sophisticated analytical capabilities in an accessible, visually intuitive format that supports informed trading decisions across various market conditions and timeframes.
Previous Day Range MarkerThis indicator highlights the high and low of the last confirmed candle on the current timeframe and optionally displays the range of the previous trading day (Daily) on lower timeframes.
It also calculates and shows the candle range in percent, helping traders quickly assess volatility and higher-timeframe context.
All levels are plotted forward into the future and can be individually enabled or disabled.
XAUUSD Bullish Continuation StrategyThis strategy is designed for trading Gold (XAUUSD) on the M15 timeframe using a bullish continuation and breakout structure.
It identifies strong uptrend conditions using EMA trend confirmation and enters buy positions on either a breakout above resistance or a retest of the breakout zone. The strategy follows a disciplined risk-management model with a fixed stop loss and multiple take-profit targets for partial profit scaling.
Core Features:
• Trend confirmation using EMA 20 & EMA 50
• Breakout and retest buy entries
• Strong momentum continuation logic
• Fixed stop-loss protection
• Multi take-profit scaling (TP1, TP2, TP3)
• Backtest-ready TradingView strategy
Best Market Conditions:
Works best during strong bullish sessions (London & New York) when gold shows high volatility and directional momentum.
Recommended Timeframe:
M15 (can be optimized for M5–M30)






















