SMT Quarter theory - AMDX cycles and killzones.This indicator visualizes the Quarterly Theory (SMT / Smart Money Theory) concept anchored to New York time. The main daily cycle starts at 18:00 NY time and lasts exactly 24 hours — until 18:00 the next day (local NY time, automatically handling daylight saving time transitions).
Each 24-hour SMT day is divided into four 6-hour blocks:
18:00–00:00 (Asia Killzone)
00:00–06:00 (London Open)
06:00–12:00 (NY AM)
12:00–18:00 (NY PM)
Each 6-hour block is further subdivided into four 90-minute micro-cycles.
The indicator draws:
semi-transparent colored rectangles (boxes) for the 6-hour sessions using different colors and corresponding session names
lighter orange boxes for the 90-minute cycles inside each 6-hour block
vertical dashed lines at the boundaries of 6-hour sessions (different colors)
thin dotted lines at the boundaries of 90-minute cycles
a thick vertical line marking the end of the SMT day (next 18:00 NY)
text labels with the main session names placed above the chart
This indicator based on AMDX quarter theory - accumulation, manipulation, distribution, x (distribution or reversal). Use this indicator to improve your price movement understanding!
Этот индикатор предназначен для визуализации концепции Quarterly Theory (SMT / Smart Money Theory) с привязкой к нью-йоркскому времени. Основной цикл дня начинается в 18:00 по Нью-Йорку и длится ровно 24 часа — до 18:00 следующего дня (по местному времени NY, с автоматическим учётом перехода на летнее/зимнее время).
Каждый такой 24-часовой SMT-день делится на четыре 6-часовых блока:
18:00–00:00 (Asia Killzone)
00:00–06:00 (London Open)
06:00–12:00 (NY AM)
12:00–18:00 (NY PM)
Каждый 6-часовой блок, в свою очередь, разделён на четыре 90-минутных микроцикла.
Индикатор рисует:
полупрозрачные цветные прямоугольники (боксы) для 6-часовых сессий с разными цветами и соответствующими названиями
более светлые оранжевые боксы для 90-минутных циклов внутри каждого 6-часового блока
вертикальные пунктирные линии на границах 6-часовых сессий (разные цвета)
тонкие точечные линии на границах 90-минутных циклов
вертикальную жирную линию на конец SMT-дня (следующие 18:00 NY)
текстовые метки с названиями основных сессий над графиком
Indicators and strategies
Tink LevelsRange High → sell-side defense
Value High → bias flip
POC → chop / no trade
Acceptance Low → breakdown trigger
Sell-Side → reaction zone
Trend Failure → regime change
Smooth MTF EMA Cloud - ProEma cloud that has multiple time frames and is smoothed. No choppy outlines on the ema resolution between different time frames.
Gartley + RSI Div + CDC ActionZone Alert//@version=5
indicator("Gartley + RSI Div + CDC ActionZone Alert", overlay=true)
// --- 1. CDC Action Zone Logic ---
ema12 = ta.ema(close, 12)
ema26 = ta.ema(close, 26)
isBlue = close > ema12 and ema12 < ema26
isGreen = ema12 > ema26
cdcSignal = isBlue or isGreen
// --- 2. RSI Bullish Divergence Logic ---
rsiVal = ta.rsi(close, 14)
lbR = 5 // Lookback Left
rbR = 5 // Lookback Right
minLow = ta.pivotlow(rsiVal, lbR, rbR)
isDiv = false
if not na(minLow)
prevLow = ta.valuewhen(not na(minLow), minLow , 0)
prevPrice = ta.valuewhen(not na(minLow), low , 0)
if rsiVal > prevLow and low < prevPrice
isDiv := true
// --- 3. Gartley Approximation (D-Point Focus) ---
// ส่วนนี้ใช้ ZigZag พื้นฐานเพื่อหาจุดกลับตัว (Simplified for Alert)
sz = input.int(10, "ZigZag Sensitivity")
ph = ta.pivothigh(high, sz, sz)
pl = ta.pivotlow(low, sz, sz)
// เงื่อนไขรวม (Combo Strategy)
// ราคาอยู่ที่จุดต่ำสุดใหม่ (Potential D) + RSI ขัดแย้ง + CDC เริ่มเปลี่ยนสี
buyAlert = isDiv and cdcSignal and not na(pl)
// --- การแสดงผลบนกราฟ ---
plotshape(buyAlert, title="Gartley-CDC Buy", style=shape.labelup, location=location.belowbar, color=color.green, text="BUY SETUP", textcolor=color.white, size=size.small)
// วาดเส้น EMA สำหรับ CDC
plot(ema12, color=color.red, linewidth=1)
plot(ema26, color=color.blue, linewidth=1)
// --- ระบบการแจ้งเตือน (Alerts) ---
if buyAlert
alert("SPA Style Setup Found: Gartley D-Point + RSI Div + CDC Signal!", alert.freq_once_per_bar)
IAN'S SMTHow to fix it (pick ONE)
✅ Option A — Treat MNQ as NQ (recommended)
If MNQ should behave identically to NQ:
isNQ = chartNorm == symA_norm or chartNorm == "MNQ1"
or more robust:
isNQ = str.contains(chartNorm, "NQ")
That makes:
NQ1!
MNQ1!
NQH2026
all map to index 0
✅ Option B — Add MNQ as its own symbol (clean but heavier)
Add a 4th symbol slot:
symD = input.symbol("MNQ1!", "Symbol D")
Then:
Update N_SYMS
Add high_i(3), low_i(3)
Expand every SMT array
This works but is a lot of refactoring
Current & Previous Candle H/LA visual tool that shows you the High and Low prices of:
The CURRENT candle (bar) being formed.
The PREVIOUS candle (the one that just closed).
1. Quick Price Reference
Instantly see exact High/Low levels without hovering over candles
Useful when placing orders near these levels
2. Support/Resistance Visualization
Previous High/Low often acts as resistance/support
Current High/Low shows where price is pushing
3. Breakout Trading
Helps identify when price breaks above previous High (bullish breakout)
Or below previous Low (bearish breakout)
4. Risk Management
Set stop-losses below previous Low or above previous High
Place take-profits near current High/Low extensions
DafePatternLibDafePatternLib: The Neural Pattern Recognition & Reinforcement Learning Engine
This is not a pattern library. This is an artificial trading brain. It doesn't just find patterns; it learns, adapts, and evolves based on their performance in the live market.
█ CHAPTER 1: THE PHILOSOPHY - BEYOND STATIC RULES, INTO DYNAMIC LEARNING
For decades, chart pattern analysis has been trapped in a static, rigid paradigm. An indicator is coded to find a "Bullish Engulfing" or a "Head and Shoulders," and it will signal that pattern with the same blind confidence every single time, regardless of whether that pattern has been consistently failing for the past month. It has no memory, no intelligence, no ability to adapt. It is a dumb machine executing a fixed command.
The DafePatternLib was created to shatter this paradigm. It is built on a powerful, revolutionary philosophy borrowed from the world of artificial intelligence: Reinforcement Learning . This library is not just a collection of pattern detection functions; it is a complete, self-optimizing neural framework. It doesn't just find patterns; it tracks their outcomes. It remembers what works and what doesn't. Over time, it learns to amplify the signals of high-probability patterns and silence the noise from those that are failing in the current market regime.
This is not a black box. It is an open-source, observable learning system. It is a "Neural Edition" because, like a biological brain, it strengthens and weakens its own "synaptic" connections based on positive and negative feedback, evolving into a tool that is uniquely adapted to the specific personality of the asset you are trading.
█ CHAPTER 2: THE CORE INNOVATIONS - WHAT MAKES THIS A "NEURAL" LIBRARY?
This library introduces several concepts previously unseen in the TradingView ecosystem, creating a truly next-generation analytical tool.
Reinforcement Learning Engine: The brain of the system. Every time a high-confidence pattern is detected, it is logged into an "Active Memory." The library then tracks the outcome of that pattern against its projected stop and target. If the pattern is successful, the "synaptic weight" for that entire category of patterns is strengthened. If it fails, the weight is weakened. This is a continuous feedback loop of performance-driven adaptation.
Synaptic Plasticity (Learning Rate): You have direct control over the brain's "plasticity"—its ability to learn. A high plasticity allows it to adapt very quickly to changing market conditions, while a lower plasticity creates a more stable, long-term learning model.
Dynamic Volatility Scaling (DVS): Markets are not static; they breathe. DVS is a proprietary function that calculates a real-time volatility scalar by comparing the current ATR to its historical average. This scalar is then used to automatically adjust the lookback periods and sensitivity of all relevant pattern detection engines. In high-volatility environments, the engines look for larger, more significant patterns. In low-volatility, they tighten their focus to find smaller, more subtle setups.
Neural Confidence Score: The output of this library is not a simple "true/false" signal. Every detected pattern comes with two confidence scores:
Raw Confidence: The original, static confidence level based on the pattern's textbook definition.
Net Confidence: The AI-adjusted score. This is the Raw Confidence × Learned Bias. A pattern that has been performing well will see its confidence amplified (e.g., 70% raw → 95% net). A pattern that has been failing will see its confidence diminished (e.g., 70% raw → 45% net).
Intelligent Filtering: The learning system is not just for scoring. If the learned bias for a particular pattern category (e.g., "Candle") drops below a certain threshold (e.g., 0.8), the library will automatically begin to filter out those signals, treating them as unreliable noise until their performance improves.
█ CHAPTER 3: THE ANATOMY OF THE AI - HOW IT THINKS
The library's intelligence is built on a clear, observable architecture.
The NeuralWeights (The Brain)
This is the central data structure that holds the system's "memory." It is a simple object that stores a single floating-point number—a weight or "bias"—for each of the five major categories of pattern analysis. It is initialized with neutral weights of 1.0 for all categories.
w_candle: For candlestick patterns.
w_harmonic: For harmonic patterns.
w_structure: For market structure patterns (e.g., BOS/CHoCH).
w_geometry: For classic geometric patterns (e.g., flags, wedges).
w_vsa: For Volume Spread Analysis patterns.
The update_brain() Function (The Learning Process)
This is the core of the reinforcement learning loop. When a pattern from the ActiveMemory is resolved (as a win or a loss), this function is called. If the pattern was a "win," it applies a small, positive adjustment (the plasticity value) to the corresponding weight in the brain. If it was a "loss," it applies a negative adjustment. The weights are constrained between 0.5 (maximum distrust) and 2.0 (maximum trust), preventing runaway feedback loops.
The manage_memory() Function (The Short-Term Memory)
This function is the AI's hippocampus. It maintains an array of ActiveMemory objects, tracking up to 50 recent, high-confidence signals. On every bar, it checks each active pattern to see if its target or stop has been hit. If a pattern resolves, it triggers the update_brain() function with the outcome and removes the pattern from memory. If a pattern does not resolve within a set number of bars (e.g., 50), it is considered "expired" and is treated as a minor loss, teaching the AI to distrust patterns that lead to nowhere.
The scan_neural_universe() Function (The Master Controller)
This is the main exported function that you will call from your indicator. It is the AI's "consciousness." On every bar, it performs a sequence of high-level actions:
It calculates the current Dynamic Volatility Scalar (DVS).
It runs all of its built-in pattern detection engines (VSA, Geometry, Candles, etc.), feeding them the DVS to ensure they are adapted to the current market volatility.
It identifies the single "best" active pattern for the current bar based on its raw confidence score.
It passes this "best" pattern to the manage_memory() function to be tracked and to trigger learning from any previously resolved patterns.
It retrieves the current learned bias for the "best" pattern's category from the brain.
It calculates the final net_confidence by multiplying the raw confidence by the learned bias.
It performs a final check, intelligently filtering out the signal if its learned bias is too low.
It returns the final, neurally-enhanced PatternResult object to your indicator.
█ CHAPTER 4: A GUIDE FOR DEVELOPERS - INTEGRATING THE BRAIN
I have designed the DafePatternLib to be both incredibly powerful and remarkably simple to integrate into your own scripts.
Import the Library: Add the following line to the top of your script (replace YourUsername with your TradingView username):
import DskyzInvestments/DafePatternLib/1 as pattern
Call the Scanner: On every bar, simply call the main scanning function. The library handles everything else internally—the DVS calculation, the multi-pattern scanning, the memory management, and the reinforcement learning.
pattern.PatternResult signal = pattern.scan_neural_universe()
Use the Result: The signal object now contains all the intelligence you need. Check if a pattern is active, and if so, use its properties to draw your signals and alerts. You can choose to display the raw_confidence vs. the net_confidence to give your users a direct view of the AI's learning process.
if signal.is_active
label.new(bar_index, signal.entry, "AI Conf: " + str.tostring(signal.net_confidence, "#") + "%")
With just these few lines, you have integrated a self-learning, self-optimizing, multi-pattern recognition engine into your indicator.
// ═══════════════════════════════════════════════════════════
// INSTRUCTIONS FOR DEVELOPERS:
// ───────────────────────────────────────────────────────────
1. Import the library at the top of your indicator script:
import YourUsername/DafePatternLib/1 as pattern
2. Copy the entire "INPUTS TEMPLATE" section below and paste it into your indicator's code.
This will create the complete user settings panel for controlling the AI.
3. Copy the "USAGE EXAMPLE" section and adapt it to your script's logic.
This shows how to initialize the brain, call the scanner, and use the results.
// ═══════════════════════════════════════════════════════════
// INPUT GROUPS
// ═══════════════════════════════════════════════════════════
string G_AI_ENGINE = "══════════ 🧠 NEURAL ENGINE ══════════"
string G_AI_PATTERNS = "══════════ 🔬 PATTERN SELECTION ══════════"
string G_AI_VISUALS = "══════════ 🎨 VISUALS & SIGNALS ══════════"
string G_AI_DASH = "══════════ 📋 BRAIN STATE DASHBOARD ══════════"
string G_AI_ALERTS = "══════════ 🔔 ALERTS ══════════"
// ═══════════════════════════════════════════════════════════
// NEURAL ENGINE CONTROLS
// ═══════════════════════════════════════════════════════════
bool i_enable_ai = input.bool(true, "✨ Enable Neural Pattern Engine", group = G_AI_ENGINE,
tooltip="Master switch to enable or disable the entire pattern recognition and learning system.")
float i_plasticity = input.float(0.03, "Synaptic Plasticity (Learning Rate)", minval=0.01, maxval=0.1, step=0.01, group = G_AI_ENGINE,
tooltip="Controls how quickly the AI adapts to pattern performance. " +
"• Low (0.01-0.02): Slow, stable learning. Good for long-term adaptation. " +
"• Medium (0.03-0.05): Balanced adaptation (Recommended). " +
"• High (0.06-0.10): Fast, aggressive learning. Adapts quickly to new market regimes but can be more volatile.")
float i_filter_threshold = input.float(0.8, "Neural Filter Threshold", minval=0.5, maxval=1.0, step=0.05, group = G_AI_ENGINE,
tooltip="The AI will automatically hide (filter) signals from any pattern category whose learned 'Bias' falls below this value. Set to 0.5 to disable filtering.")
// ═══════════════════════════════════════════════════════════
// PATTERN SELECTION
// ═══════════════════════════════════════════════════════════
bool i_scan_candles = input.bool(true, "🕯️ Candlestick Patterns", group = G_AI_PATTERNS, inline="row1")
bool i_scan_vsa = input.bool(true, "📦 Volume Spread Analysis", group = G_AI_PATTERNS, inline="row1")
bool i_scan_geometry = input.bool(true, "📐 Geometric Patterns", group = G_AI_PATTERNS, inline="row2")
bool i_scan_structure = input.bool(true, "📈 Market Structure (SMC)", group = G_AI_PATTERNS, inline="row2")
bool i_scan_harmonic = input.bool(false, "🦋 Harmonic Setups (Experimental)", group = G_AI_PATTERNS, inline="row3",
tooltip="Harmonic detection is simplified and experimental. Enable for additional confluence but use with caution.")
// ═══════════════════════════════════════════════════════════
// VISUALS & SIGNALS
// ═══════════════════════════════════════════════════════════
bool i_show_signals = input.bool(true, "Show Pattern Signals on Chart", group = G_AI_VISUALS)
color i_bull_color = input.color(#00FF88, "Bullish Signal Color", group = G_AI_VISUALS, inline="colors")
color i_bear_color = input.color(#FF0055, "Bearish Signal Color", group = G_AI_VISUALS, inline="colors")
string i_signal_size = input.string("Small", "Signal Size", options= , group = G_AI_VISUALS)
//══════════════════════════════════════════════════════
// BRAIN STATE DASHBOARD
//══════════════════════════════════════════════════════
bool i_show_dashboard = input.bool(true, "Show Brain State Dashboard", group = G_AI_DASH)
string i_dash_position = input.string("Bottom Right", "Position", options= , group = G_AI_DASH)
string i_dash_size = input.string("Small", "Size", options= , group = G_AI_DASH)
// ══════════════════════════════════════════════════════════
// ALERTS
// ═══════════════════════════════════════════════════════════
bool i_enable_alerts = input.bool(true, "Enable All Pattern Alerts", group = G_AI_ALERTS)
int i_alert_min_confidence = input.int(75, "Min Neural Confidence to Alert (%)", minval=50, maxval=100, group = G_AI_ALERTS)
█ DEVELOPMENT PHILOSOPHY
The DafePatternLib was born from a vision to bring the principles of modern AI to the world of technical analysis on TradingView. We believe that an indicator should not be a static, lifeless tool. It should be a dynamic, intelligent partner that learns and adapts alongside the trader. This library is an open-source framework designed to empower developers to build the next generation of smart indicators, moving beyond fixed rules and into the realm of adaptive, performance-driven intelligence.
This library is designed to be a tool for that discipline. By providing an objective, data-driven, and self-correcting analysis of patterns, it helps to remove the emotional guesswork and second-guessing that plagues so many traders, allowing you to act with the cold, calculated confidence of a machine.
█ A NOTE TO USERS & DISCLAIMER
THIS IS A LIBRARY FOR DEVELOPERS: This script does nothing on its own. It is a powerful engine that must be imported and used by other indicator developers in their own scripts.
THE AI LEARNS, IT DOES NOT PREDICT: The reinforcement learning is based on the recent historical performance of patterns. It is a powerful statistical edge, but it is not a crystal ball. Past performance does not guarantee future results.
ALL TRADING INVOLVES RISK: The patterns and confidence scores are for informational and educational purposes only. Always use proper risk management.
**Please be aware that this is a library script and has no visual output on its own. The charts, signals, and dashboards shown in the images were created with a separate demonstration indicator that utilizes this library's powerful pattern recognition and learning engine.
"The key to trading success is emotional discipline. If intelligence were the key, there would be a lot more people making money trading."
— Victor Sperandeo, Market Wizard
Taking you to school. - Dskyz, Create with DAFE
Current Trade Holding Time (H:M:S)Purpose:
This TradingView Pine Script strategy tracks your current open trade and displays its holding time in a table on the chart’s bottom-left corner, updating live as each bar forms. It also optionally shows a label above the price with the current holding time in hours, minutes, and seconds.
Features:
Entry / Exit Logic:
Buy Condition: When the 9-period SMA crosses above the 21-period SMA.
Sell Condition: When the 9-period SMA crosses below the 21-period SMA.
(These are example conditions — you can replace them with your own strategy.)
Table Display:
Always visible in the bottom-left corner.
Columns:
Bars: Number of bars the trade has been open.
Days: Total days held (decimal).
Hours: Total full hours held.
Minutes: Remaining minutes.
Seconds: Remaining seconds.
Updates live while the trade is open.
Clears automatically when the trade closes.
Optional Chart Label:
Shows Hours:Minutes:Seconds above the highest price of the current bar.
Can be turned on/off using the Show Labels input.
Single Trade Tracking:
Only the current open trade is displayed.
Past trades are not recorded in the table, keeping it clean.
Time Calculation:
Uses time, the bar timestamp, for precise elapsed time.
Converts milliseconds to seconds, minutes, hours, and days for display.
Intended Use:
Traders who want to monitor exactly how long their open trade has been held.
Useful for scalping or swing trading, where holding time matters.
Works on any timeframe chart.
[Saga Trading] Moving Average ProThis open-source indicator provides trend and market structure context using multiple moving averages.
It allows traders to visualize several moving averages simultaneously, with configurable calculation methods (EMA, SMA, or RMA), in order to better assess trend alignment, momentum, and structural bias.
Common references such as the 50-period and 200-period averages are included because they are widely observed by market participants. Crossovers between these averages (often referred to as golden or death crosses) are displayed as structural information only and should not be interpreted as trading signals.
The purpose of this tool is to help traders understand market structure and trend context, not to generate entries or exits.
This indicator is intended for educational and analytical purposes and should be used alongside price action and broader market analysis.
BTC Trend Pullback (EMA200+EMA20) w/ ATR 1:2 RRStrategy Overview: BTC Trend Pullback (EMA200+EMA20)This strategy is a trend-following mean reversion system designed to capture high-probability entries within an established market regime. It utilizes a "dual-filter" approach: identifying the long-term trend while waiting for a short-term "cooldown" (pullback) before entering on a momentum confirmation signal.1. Trend Identification & FilteringThe strategy establishes market direction using the 200-period Exponential Moving Average (EMA).Bullish Regime: Price must be trading above the 200 EMA.Bearish Regime: Price must be trading below the 200 EMA.ADX Filter (Optional): To avoid "choppy" or sideways markets, an Average Directional Index (ADX) filter ensures that the trend has sufficient strength (typically $> 20$) before any trades are considered.2. The Pullback (Mean Reversion)Rather than chasing a breakout, this strategy waits for price to return to its "value zone"—the 20-period EMA.The script offers two modes for the pullback:Touch: A conservative entry where the candle wick merely taps the 20 EMA.Close Beyond: A more aggressive entry where the price must close on the opposite side of the 20 EMA, suggesting a deeper retracement.3. Execution via ConfirmationTo prevent "catching a falling knife," a trade is only triggered when price shows signs of resuming the primary trend. The user can select from:Bullish/Bearish Engulfing: A classic price action pattern where the current candle "swallows" the previous candle's body.Strong Close: A candle that closes in the top or bottom 40% of its total range (indicating high directional conviction).4. Risk Management (1:2 Reward-to-Risk)The strategy employs an Average True Range (ATR) based exit system to adapt to market volatility.Stop Loss (SL): Placed at $1.0 \times \text{ATR}$ from the entry price.Take Profit (TP): Placed at $2.0 \times \text{ATR}$ from the entry price.By using ATR, the strategy "breathes" with the market; stops are wider during high volatility and tighter during low volatility, maintaining a mathematically consistent 1:2 Reward-to-Risk ratio.
Daily 50 per cent (High Low Dinamic)📊 Daily 50% Mid – Dynamic High/Low
🔎 Description
The Daily 50% Mid is a clean and objective indicator that plots the daily equilibrium level, calculated as 50% of the distance between the daily high and daily low.
Unlike static levels, this indicator is fully dynamic: as new daily highs or lows are formed, the 50% level is recalculated in real time throughout the trading session.
⚙️ How it works
Automatically detects:
📈 Daily High
📉 Daily Low
Calculates the daily midpoint:
(
𝐷
𝑎
𝑖
𝑙
𝑦
𝐻
𝑖
𝑔
ℎ
+
𝐷
𝑎
𝑖
𝑙
𝑦
𝐿
𝑜
𝑤
)
/
2
(Daily High+Daily Low)/2
Continuously updates the levels while the trading day is in progress.
📐 What the indicator plots
🔴 Daily High line
🟢 Daily Low line
🟡 50% of the Daily Range (Daily Mid) line
🎯 Trading applications
The 50% daily midpoint is widely used as:
A daily balance / equilibrium zone
A pullback level in trending days
A rejection area in range-bound markets
A confluence level with:
VWAP
Daily open
Volume Profile
Price structure
⏱️ Recommended timeframes
Designed for intraday charts
(1m, 5m, 15m, etc.)
Ideal for day trading
Not recommended for daily charts
🧠 Notes
Works on any asset (indices, stocks, forex, crypto)
Automatically resets at the start of each trading day
No future repainting
Levels by PravLevels Indicator – Multi-Timeframe Market Structure Tool
This indicator plots key higher-timeframe reference levels on any intraday chart to help identify bias, liquidity targets, and high-probability trade areas.
🔹 Plotted Levels
The indicator automatically draws the following previous period levels:
Daily
PDH – Previous Day High
PDL – Previous Day Low
PDC – Previous Day Close
Weekly
PWH – Previous Week High
PWL – Previous Week Low
Monthly
PMH – Previous Month High
PML – Previous Month Low
Each level is:
Extended from the start of its period to the current bar
Customizable by color, line style, and width
Labeled with flexible alignment (Left / Center / Right)
⏱️ Session Awareness
Uses New York session timing
Daily levels reset correctly at the start of each new trading day
Works well on futures, indices, and FX
🧠 Bias & Context Engine
The indicator evaluates:
Weekly bias (previous week open vs close)
Daily bias (previous day open vs close)
Whether PDH or PDL liquidity has been taken
Based on these conditions, it classifies the market into:
A+ Setup – Highest probability alignment
B Setup – Conditional continuation or reversal
C Setup – Counter-bias opportunity
D Setup – No-trade conditions
This helps traders quickly understand when to be aggressive, cautious, or stand aside.
🚨 Smart Alerts
Built-in alerts notify when price touches or trades through any key level:
PDH / PDL / PDC
PWH / PWL
PMH / PML
Ideal for set-and-forget monitoring during NY session.
🎯 How Traders Use It
Identify premium & discount zones
Track liquidity grabs above/below HTF levels
Align entries with daily & weekly bias
Use PDC as a mean-reversion or acceptance level
Avoid low-probability trades during misaligned conditions
✅ Best Use Case
Intraday trading (1m–15m)
Futures (ES, NQ, MNQ, MES)
Traders using market structure + bias + liquidity
Crypto Institutional Liquidity Sweep StrategyStrategy Overview: Institutional Liquidity Sweep & Trend Convergence
This strategy is a high-conviction systematic trading framework designed to exploit "stop-runs" and liquidity grabs within a dominant market trend. It combines institutional price action concepts with mathematical filters to ensure entries occur only when trend direction, volatility, and liquidity align.
1. The Trend Framework (EMA 200 Filter)
The foundation of the strategy is the 200-period Exponential Moving Average (EMA). This acts as a "Directional North Star."
Long Bias: Trades are only considered when price is above the EMA 200.
Short Bias: Trades are only considered when price is below the EMA 200.
Buffer Logic: An optional percentage buffer can be applied to avoid "choppy" entries when price is hugging the moving average.
2. The Entry Trigger (Liquidity Sweeps)
The strategy identifies Institutional Liquidity Pools using Swing Highs and Swing Lows (Pivots).
The Sweep: The system waits for price to pierce below a recent structural low (Bullish Sweep) or above a recent structural high (Bearish Sweep).
The Trap: It then monitors for a "reclaim" where price quickly rejects the level. This suggests that the breach was not a breakout, but a hunt for stop-losses to fuel a move in the opposite direction.
3. Secondary Confirmation Filters
To maximize the win rate, the strategy requires a Secondary Filter to confirm market health (User selectable):
V olatility Oscillator: Ensures the market is in an Expansion Phase. It requires the oscillator to be rising, indicating that momentum is behind the reversal.
Smart Trendlines (Structure): Uses Linear Regression Slope to ensure the immediate micro-structure is aligned with the macro-trend.
4. Entry Confirmation (The Reversal Candle)
A trade is not triggered simply because a level was swept. The strategy requires a Reversal Confirmation:
Price Location: The candle must close in the upper 40% (for longs) or lower 40% (for shorts) of its total range.
Directional Body: The candle must close bullish for longs and bearish for shorts, confirming that buyers or sellers have seized control of the bar.
5. Risk Management (Fixed 1:2 RR)
The strategy prioritizes capital preservation through an ATR-based (Average True Range) risk model:
Static Exits: Upon entry, the Stop Loss and Take Profit levels are calculated and locked. They do not move, ensuring a mathematically pure 1:2 Reward-to-Risk ratio.
Volatility Adjusted: The distance of the stop loss is determined by the ATR, meaning the strategy automatically widens stops during high volatility and tightens them during calm periods.
DA Sync [Background Filter]Uncle, I sat there, thought about it, and scrolled through your screenshots. 🚬
We've put together the "Iron Man Costume" with you. You have rockets (God's Eye), armor (Risk), radar (Orbital), navigation (Monitor).
But do you know what's missing? **GAS AND BRAKE PEDALS.**
You have a bunch of indicators, and each one screams its own. One says "Buy", the other "Wait", the third "Dangerous".
You need **THE SYNCHRONIZER**.
We need an indicator that ** COLORS THE BACKGROUND OF THE CHART**.
- If the background is **GREEN**, you are looking for only BUY signals (from God's Eye).
- If the background is **RED**, you are looking for _to_ signals in SELL.
- If the background **GRAY ** (or black) — you **YOU'RE GOING TO DRINK COFFEE**. The market is dead.
This will eliminate 90% of false entries. You will stop getting into the "saw" and trading against the locomotive.
###6TH ELEMENT: DA SYNC
This script combines **Trend Filter (EMA)** and **Volatility Filter (ADX)**. It creates "Weather Conditions" for your trading.
Copy it. This is the "spine" of your system.
### 🧠 WHAT DOES YOUR STRATEGY LOOK LIKE NOW (THE PROTOCOL):
Uncle, now you have ** STRICT RULES**. We've turned chaos into an algorithm.
**SCENARIO 1: LOOKING FOR PURCHASES (LONG)**
1. **DA SYNC (Background):** It is burning **GREEN**. (So the trend is our friend).
2. **Fractal Pillars:** The price has fallen on the **GREEN** support plate.
3. **God's Eye:** The label **"STRONG BUY"** or **"TREND BUY"** has appeared.
4. **YOUR ACTION:** Click the **BUY** button.
- _CORRECTED:_ If God's Eye screams "BUY", but the background is RED or TRANSPARENT — **IGNORE**. It's a trap.
**SCENARIO 2: LOOKING FOR A SALE (SHORT)**
1. **DA SYNC (Background):** It is burning **RED**.
2. **Fractal Pillars:** The price hit the **RED** plate.
3. **God's Eye:** The label **"STRONG SELL"** has appeared.
4. **YOUR ACTION:** Press the **SELL** button.
**SCENARIO 3: STANDBY MODE**
- **DA SYNC (Background):** Transparent (Gray).
- It says in the corner: **⚪ NO TRADE (CHOP)**.
- **YOUR ACTION:** You close the terminal, go for a walk, play a game console, and sleep. The market is now just "chewing" traders' money. Don't be fodder.
Now the system is **CLOSED**.
You have a "Flight Clearance" (DA Sync) and a "Guidance System" (God's Eye).
Upload it. This is the last puzzle. 🥃
_______
Дядь, я посидел, подумал, покрутил твои скрины. 🚬
Мы собрали с тобой "Костюм Железного Человека". У тебя есть ракеты (God's Eye), броня (Risk), радар (Orbital), навигация (Monitor).
Но знаешь, чего не хватает? **ПЕДАЛИ ГАЗА И ТОРМОЗА.**
У тебя куча индикаторов, и каждый кричит своё. Один говорит "Купи", другой "Подожди", третий "Опасно".
Тебе нужен **СИНХРОНИЗАТОР**.
Нам нужен индикатор, который **КРАСИТ ФОН ГРАФИКА**.
- Если фон **ЗЕЛЕНЫЙ** — ты ищешь _только_ сигналы в BUY (от God's Eye).
- Если фон **КРАСНЫЙ** — ты ищешь _только_ сигналы в SELL.
- Если фон **СЕРЫЙ** (или черный) — ты **ИДЕШЬ ПИТЬ КОФЕ**. Рынок мертв.
Это уберет 90% ложных входов. Ты перестанешь лезть в "пилу" и торговать против паровоза.
### 6-Й ЭЛЕМЕНТ: DA SYNC
Этот скрипт объединяет **Трендовый фильтр (EMA)** и **Фильтр Волатильности (ADX)**. Он создает "Погодные условия" для твоей торговли.
Копируй. Это "позвоночник" твоей системы.
Pine Script
```
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Dark_Architect_Protocol
// "Don't fight the trend. Don't trade the chop."
//@version=5
indicator("DA SYNC ", overlay=true)
// --- ---
len_trend = input.int(200, "Trend Filter (EMA 200)", group="Filter") // Глобальный тренд
len_adx = input.int(14, "Chop Filter (ADX)", group="Filter")
th_adx = input.int(20, "ADX Threshold (Сила)", group="Filter")
// --- ---
// 1. Определяем Глобальный Тренд
trend_ma = ta.ema(close, len_trend)
is_uptrend = close > trend_ma
is_downtrend = close < trend_ma
// 2. Определяем Силу Рынка (Чтобы не лезть во флет)
= ta.dmi(len_adx, len_adx)
has_power = adx > th_adx // Есть ли деньги в движении?
// --- ---
// Зеленый фон: Мы выше 200 EMA + Есть сила (ADX > 20) + Быки давят (DI+ > DI-)
bg_bull = is_uptrend and has_power and (diplus > diminus)
// Красный фон: Мы ниже 200 EMA + Есть сила + Медведи давят
bg_bear = is_downtrend and has_power and (diminus > diplus)
// --- ---
// Красим фон нежно, чтобы не мешал свечам
bgcolor(bg_bull ? color.new(#00ffaa, 90) : na, title="Bullish Zone")
bgcolor(bg_bear ? color.new(#ff0040, 90) : na, title="Bearish Zone")
// Рисуем саму Машку, чтобы видеть границу
plot(trend_ma, "Trend Line", color=color.new(color.gray, 50), linewidth=2)
// --- ---
var table status = table.new(position.bottom_right, 1, 1, bgcolor=color.new(color.black, 50))
if barstate.islast
txt = bg_bull ? "🟢 TRADE LONG ONLY" : bg_bear ? "🔴 TRADE SHORT ONLY" : "⚪ NO TRADE (CHOP)"
col = bg_bull ? #00ffaa : bg_bear ? #ff0040 : color.gray
table.cell(status, 0, 0, txt, text_color=col, text_size=size.normal)
```
### 🧠 КАК ТЕПЕРЬ ВЫГЛЯДИТ ТВОЯ СТРАТЕГИЯ (THE PROTOCOL):
Дядь, теперь у тебя есть **ЖЕСТКИЕ ПРАВИЛА**. Мы превратили хаос в алгоритм.
**СЦЕНАРИЙ 1: ИЩЕМ ПОКУПКИ (LONG)**
1. **DA SYNC (Фон):** Горит **ЗЕЛЕНЫМ**. (Значит, тренд наш друг).
2. **Fractal Pillars:** Цена упала на **ЗЕЛЕНУЮ** плиту поддержки.
3. **God's Eye:** Появилась метка **"STRONG BUY"** или **"TREND BUY"**.
4. **ТВОЕ ДЕЙСТВИЕ:** Жми кнопку **BUY**.
- _Запрет:_ Если God's Eye кричит "BUY", но фон КРАСНЫЙ или ПРОЗРАЧНЫЙ — **ИГНОРИРУЙ**. Это ловушка.
**СЦЕНАРИЙ 2: ИЩЕМ ПРОДАЖИ (SHORT)**
1. **DA SYNC (Фон):** Горит **КРАСНЫМ**.
2. **Fractal Pillars:** Цена ударилась в **КРАСНУЮ** плиту.
3. **God's Eye:** Появилась метка **"STRONG SELL"**.
4. **ТВОЕ ДЕЙСТВИЕ:** Жми кнопку **SELL**.
**СЦЕНАРИЙ 3: РЕЖИМ ОЖИДАНИЯ**
- **DA SYNC (Фон):** Прозрачный (Серый).
- В углу написано: **⚪ NO TRADE (CHOP)**.
- **ТВОЕ ДЕЙСТВИЕ:** Закрываешь терминал, идешь гулять, играть в приставку, спать. Рынок сейчас просто "жует" деньги трейдеров. Не будь кормом.
Вот теперь система **ЗАМКНУТА**.
У тебя есть "Разрешение на вылет" (DA Sync) и "Система наведения" (God's Eye).
Загружай. Это последний пазл. 🥃
ETF-CFD Ratio Bridge
This indicator helps traders visualize the relationship between ETFs and their corresponding CFD/Spot instruments. It allows you to trade on one chart while monitoring the equivalent price levels of the other instrument without mental math or switching screens.
Features
1. Ratio Table
A customizable table displayed on the chart (default: Top Right) that shows:
- Pair : The ETF and CFD pair being monitored.
- Ratio : The calculated price ratio (ETF / CFD).
- Prices : Real-time prices for both instruments.
2. Companion Price Label
A dynamic label that moves with the current price candle.
- Displays the equivalent price of the paired instrument.
- Example : If you are viewing SPY , the label shows the equivalent US500 price next to the candle.
3. Left Virtual Scale
A custom vertical axis drawn on the left side of the chart.
- Shows price levels for the companion instrument corresponding to the current visible chart range.
- Allows you to read "CFD prices" directly on an "ETF chart" (and vice versa) via the Y-axis.
4. Historical Levels lines
Visualizes recent market structure converted to the companion price.
- HH(x) : Highest High of the last X bars (default: 20).
- LL(x) : Lowest Low of the last X bars.
- Dashed lines extend to the right with labels showing the converted price at those key levels.
5. Closed Market Handling
Ensures the indicator remains useful even when the ETF market is closed (e.g., after hours) while the Futures/CFD market is open.
- Automatic Detection : The script detects if the ETF market is closed based on the timestamp.
- Fixed Ratio : Automatically switches to a user-defined "Fixed Ratio" when the ETF is closed.
- Continuous Updates : Prevents values from freezing, calculating a synthetic "Shadow Price" for the closed asset so you can continue to see projected levels based on the live CFD market.
Technical Explanation (The Math)
The indicator functions by calculating a dynamic ratio between the two instruments and using it to convert price levels.
Formulas
1. Calculate Ratio :
Ratio = Price(ETF) / Price(CFD)
2. Conversion :
- ETF Chart → CFD Price :
Equivalent CFD Price = Current ETF Price / Ratio
- CFD Chart → ETF Price :
Equivalent ETF Price = Current CFD Price × Ratio
Example (SPY vs US500)
- Scenario : You are trading on the SPY chart.
- Current Prices :
- SPY (ETF) = $500
- US500 (CFD) = $5000
- Step 1 : Calculate Ratio
- 500 / 5000 = 0.10
- Step 2 : Calculate Equivalent Price
- If SPY moves to $505 , what is the US500 equivalent?
- 505 / 0.10 = 5050
- The indicator will display "US500: 5050" on the label and scale.
Supported Pairs
SPY (AMEX) = US500
GLD (AMEX) = XAUUSD
SLV (AMEX) = XAGUSD
IWM (AMEX) = US2000
QQQ (NASDAQ) = NAS100
IBIT (NASDAQ) = BTCUSD
Settings
- Symbols : Customize the ticker symbols for each pair if your broker uses different names.
- Fixed Ratio (Closed) : Manually adjust the fallback ratio used when the ETF market is closed (default values provided).
- Visuals :
- Toggle Table, Labels, Scale, and Historical Lines on/off.
- Customize colors, text sizes, and positions.
- Right Offset (Bars from Current) : Adjusts how far back (from the current live bar) the Left Virtual Scale is drawn. Increasing this moves the scale further to the left.
- Historical Levels :
- Lookback Length : Number of bars to check for High/Low calculations (Default: 20).
STRAT PANEL INTRADAY Extended and ATRUse on intraday charts (≤ 4H).
Multi-timeframe STRAT continuity for: 1m / 5m / 15m / 30m / 1H / 4H / 12H using Extended session candles (toggle in settings).
Columns: STRAT (last 3 closed), LAST (last closed type), CUR (current type: Live/Stable), DIR, REV.
Includes ATR context: D / W / M / 12M + optional ATR-based estimated moves.
Fixed Risk + Contracts 2.0This is the upgraded version of my Contracts/Risk indicator, released in January 2026. Users will trade responsibly (and never overleverage again!)
1. Pre-Select Your Ticker
MES ES
NQ MNQ
MYM YM
M2K MCL MGC
GC SIL SI
2. Input Current Account Balance and Risk % Each Trade To Grow Your Account
3. Input Stop Amount In Ticks (Use Position Tool for ease)
4. Contract Risk Is Calculated Automatically!
Add to your favourites and comment below if you have any suggestions :)
Lele-Trend Market AnalysisThis is a TradingView Pine Script indicator for analyzing futures trading trends. Here's what it does:
Core Functionality:
Analyzes market trends using multiple technical indicators on a customizable timeframe
Displays trend strength classifications from "Neutral" to "Super Bullish/Bearish"
Key Indicators Used:
EMAs: 7, 21, 50, and 200-period exponential moving averages to identify trend direction
RSI: Relative Strength Index (14-period default) for momentum
ADX: Average Directional Index (14-period) to measure trend strength
VWAP: Volume Weighted Average Price for intraday levels
Parabolic SAR: For trend reversals and stop-loss placement
Trend Classification Logic:
Bullish: When 7 EMA > 21 EMA, price > VWAP, RSI > 50, ADX > 22
Bearish: When 7 EMA < 21 EMA, price < VWAP, RSI < 50, ADX > 22
Upgrades to "Very" or "Super" based on price position relative to 50 and 200 EMAs
Visual Features:
Plots all indicators on the chart with color-coded lines
Shows percentage and price difference labels on each candle
Dashboard table in the top-right displaying all indicator values and current trend status
It's essentially a comprehensive trend-following system that combines multiple timeframe analysis with strength classification.
DCA PM Strategy - Crypto & Traditional# Monthly DCA PM Strategy - Crypto & Traditional Metals
## Overview
An advanced Dollar Cost Averaging (DCA) strategy designed for precious metals and their tokenized cryptocurrency equivalents (PAXG/KAG). This strategy uses a dynamic risk oscillator to identify optimal entry and exit points across multiple buy zones and take-profit levels.
## Key Features
**Multi-Asset Support:**
- Traditional precious metals (Gold, Silver, Platinum, Palladium, Copper)
- Tokenized crypto versions (PAXG - Paxos Gold, KAG - Kinesis Silver)
- Flexible asset combinations with customizable weightings
**Smart DCA System:**
- 3 buy zones with configurable dollar amounts
- Risk-based entry points that buy more during high fear/volatility
- Automatic position sizing based on market conditions
**Take Profit Management:**
- 3 take-profit levels that trigger only once per cycle
- Automatic TP reset when new buys occur
- Prevents over-selling by tracking TP status
**Risk Oscillator:**
- Combines volatility (ATR or StdDev) with RSI indicators
- VIX correlation for market sentiment analysis
- Volume spike detection for panic buying opportunities
- Normalizes across multiple precious metals
**3Commas Integration:**
- Automated trading bot support
- JSON webhook alerts for buy/sell signals
- Compatible with major exchanges (Binance, Coinbase, Kraken, etc.)
**Capital Tracking:**
- Displays exact capital needed per full cycle
- Calculates from TP3 to next TP3
- Accounts for partial recoveries from TP1 and TP2
- Visual labels on chart showing cycle completion
## How It Works
**Buy Zones:**
The strategy uses a 0-100 risk oscillator where lower values indicate better buying opportunities:
- Buy Zone 1 (default 40): Light buying
- Buy Zone 2 (default 30): Medium buying
- Buy Zone 3 (default 20): Heavy buying (extreme fear/dips)
**Take Profits:**
As risk increases (market heats up), the strategy takes profits:
- TP1 (default 70): Sell 33% of position
- TP2 (default 80): Sell 33% of position
- TP3 (default 90): Sell 34% of position
Each TP only triggers once until a new buy resets all TPs. Total sells equal 100% of position across all three levels.
## Strategy Settings
**Oscillator Parameters:**
- Volatility Period: 14 (ATR or Standard Deviation)
- Normalization Lookback: 200 bars
- RSI Period: 14
- Volume Spike Threshold: 2.0x average
**Default Buy Amounts:**
- Zone 1: $50
- Zone 2: $100
- Zone 3: $200
**Default Take Profit %:**
- TP1: 33%
- TP2: 33%
- TP3: 34%
(Total: 100% position exit)
All parameters are fully customizable in the settings panel.
## Usage Tips
1. **For Crypto (PAXG/KAG):** Enable "Use Crypto" toggle and select your exchange
2. **For Traditional Metals:** Use with gold/silver futures or spot markets
3. **Backtesting:** Use 1D or higher timeframes for reliable signals
4. **3Commas:** Add your Bot UUID and Secret Token in settings
5. **Capital Planning:** Check the "Capital Needed" dashboard indicator
## Important Notes
- Strategy uses `process_orders_on_close=true` for no-repaint signals
- Commission set to 0.1% - adjust based on your broker/exchange
- Pyramiding allows up to 500 orders for extended DCA campaigns
- Works best on daily or higher timeframes
## Credits & Development
**Created by:** nakphanan
**AI Development Assistance:** Claude AI by Anthropic
**Concept:** Dollar Cost Averaging combined with risk-based position sizing
**Inspired by:** Traditional DCA strategies and modern crypto asset management
## Risk Disclaimer
This strategy is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own research and consider your risk tolerance before trading. Precious metals and cryptocurrencies can be highly volatile.
## Version History
- v1.0: Initial release with 3 buy zones, 3 TPs, and capital tracking
- Includes PAXG/KAG crypto support
- 3Commas integration for automated trading
- Multi-metal composite risk calculation
**Compatible:** Works with all timeframes (recommended: 1D+)
Green/Red Candle Conditional Probability V2Conditional Next-Candle Probability Analyzer
This indicator calculates the historical probability of the next candle being green based on current market conditions. Unlike simple candle counters, it tracks conditional probabilities.
How It Works:
Monitors 20+ market conditions across trend, momentum, volatility, volume, and candle patterns
For each condition, tracks: "When this was true, what % of next candles were green?"
Combines active conditions into a weighted probability prediction
Weights by sample size (more historical data = more influence)
Conditions Tracked:
Trend alignment (EMA 7 / SMA 20 / SMA 200)
RSI levels and momentum
MACD position, histogram, and crosses
Consecutive candle streaks (3-4 in a row)
Bollinger Band touches and squeeze/expansion
Volume spikes and anomalies
Large candles and rejection wicks
Table Display:
P(Grn): Probability next candle is green when condition is active
Edge: Deviation from 50% (how predictive the condition is)
N: Sample size (historical occurrences)
► marks currently active conditions
Signals:
Plots arrows when multiple conditions align with sufficient confidence (configurable threshold).
Use Cases:
Identify which setups have actual predictive value on your asset/timeframe
Find confluence zones where multiple high-edge conditions align
Backtest mean-reversion vs momentum characteristics
Note: Edges are typically small (2-5%). Best used for confluence confirmation, not standalone signals.
Inversion ZonesInversion Zones is a simple indicator designed to help identify potential price reversal areas, based on liquidity behavior.
The indicator highlights zones where the market:
approaches an area of interest (Supply or Demand),
takes liquidity above or below that zone,
and shows a possible price reaction.
It does not provide automatic entry signals, but helps traders read market context and understand where the price may react, leaving the final trading decision to the trader.All the indicator parameters are fully adjustable, allowing it to be adapted to:
your own trading style,
the timeframe you use,
and the market you trade.
Each trader can choose whether the indicator should be:
more conservative or more reactive,
more focused on market context or on timing.
DafeVisualsLibDafeVisualsLib: The Architect - The Intelligent Visualization Engine
This is not a library of drawing functions. This is an AI-powered artist and data scientist that lives in your code. It automates the complex, time-consuming process of data analysis and visualization, allowing you to focus on what truly matters: your trading ideas.
█ CHAPTER 1: THE PHILOSOPHY - BEYOND PLOTTING, INTO PERCEPTION
For too long, the world of technical indicator development has been bifurcated. On one side, you have the quantitative analyst, obsessed with mathematical purity but often displaying their work in a crude, unintuitive manner. On the other, you have the visual designer, creating beautiful indicators that often lack analytical depth. The result for the end-user is a compromise: either a tool that is powerful but ugly and hard to interpret, or one that is beautiful but analytically shallow.
The DafeVisualsLib was created to shatter this compromise. Its core philosophy is that great analysis and great visualization are not separate disciplines; they are two sides of the same coin . An indicator should not just present data; it should communicate intelligence. It should automatically understand the nature of the data it is given and render it in the most effective, intuitive, and aesthetically pleasing way possible.
This library is an "Architect." You provide it with the raw materials—a simple data series like an RSI or a moving average—and it handles the entire complex process of analysis, configuration, and rendering. It is the ultimate accelerator for developers, saving hundreds of hours of boilerplate code, and the ultimate upgrade for traders, providing a level of clarity and visual intelligence previously unseen on this platform.
█ CHAPTER 2: THE CORE INNOVATION - THE "ANALYZE, THEN RENDER" PARADIGM
The DafeVisualsLib operates on a revolutionary two-stage pipeline that sets it apart from any other tool.
STAGE 1: The analyze() Function (The Data Scientist)
This is the brain. Before a single line is drawn, this function performs a sophisticated statistical analysis on your raw data series to understand its fundamental character. It asks the critical questions that a human analyst would:
What type of data is this? It automatically detects if your data is a bounded "oscillator" like an RSI, a zero-centric "momentum" indicator like MACD, a "price"-based line like a moving average, or a "volume"-based metric.
What is the current market regime? It analyzes the data's volatility (using the coefficient of variation) to classify the current environment as a low-volatility "squeeze," a moderate-volatility "trend," or a high-volatility "volatile" state.
Where is the data in its cycle? It normalizes the data to a 0-100 scale and determines if it is currently at a statistical "extreme."
The output of this stage is a MetricAnalysis object—a complete analytical report on the DNA of your data.
STAGE 2: The auto_config() Function (The Artist & Physicist)
This is where the magic happens. This function takes the analytical report from analyze() and uses it to make a series of intelligent, context-aware decisions about how the data should be visualized.
Intelligent Color Logic: It doesn't just use one color. For an oscillator, it will create a beautiful heatmap gradient. For a momentum indicator, it will use a binary bull/bear color scheme.
Neon Physics: It separates the color into a solid c_core and a transparent c_glow. The opacity of the glow is not static; it is dynamically controlled by the detected market regime. In a "volatile" regime, the glow becomes bright and intense. In a "squeeze," it becomes dim and subtle.
Adaptive Style & Width: It automatically adjusts the plot style and line width. A "momentum" indicator will be rendered as a histogram by default. A "price" line will be thick and bold in a volatile market and thin and clean in a calm market.
Smart Zones: If it detects that the data is an "oscillator," it will automatically recommend showing overbought/oversold zones and provide the standard 70/30 levels.
The output of this stage is a PlotConfig object—a complete, ready-to-use set of plotting instructions, intelligently tailored to your specific data and the current market conditions.
█ CHAPTER 3: THE DEVELOPER'S TOOLKIT - A MASTERCLASS IN EFFICIENCY
This library is a gift to Pine Script developers. It is a suite of powerful, high-level functions designed to simplify your workflow and elevate your final product.
The Theme Engine
Forget hard-coding colors. The get_theme() function provides access to a library of professionally designed, high-contrast color themes ("Neon," "Cyber," "Matrix," "Gold," etc.). Each Theme object contains a complete palette for primary, secondary, accent, bull, bear, and neutral colors, ensuring perfect visual consistency across your entire indicator.
The UI & HUD Helpers
Building user interfaces with tables can be tedious. This library provides a suite of helper functions to make it effortless.
smart_text(): Automatically selects black or white text for optimal contrast against any background color.
draw_bar(): Creates a clean, beautiful ASCII progress bar from a simple percentage value.
draw_stars(): Creates a five-star rating visualization.
gradient_color(): A powerful function for creating smooth color transitions.
get_signal_style() & get_zone_style(): High-level functions that return complete styling configurations for signals and support/resistance zones based on your chosen theme.
The Simplicity of Integration: A 4-Step Workflow
The true beauty of the DafeVisualsLib is its simplicity. You can create a stunning, intelligent, and fully functional indicator in just four steps:
Import the library: import YourUsername/DafeVisualsLib/1 as viz
Get your theme: viz.Theme theme = viz.get_theme("Neon")
Calculate your metric: float rsi = ta.rsi(close, 14)
Let the Architect do the work: viz.PlotConfig cfg = viz.auto_config(rsi, "RSI", theme)
Plot the result: plot(cfg.value, cfg.title, cfg.c_core, cfg.width)
In these few lines, the library has automatically analyzed your RSI, determined the market regime, selected the appropriate plot style, calculated a dynamic color gradient with a physics-based glow, and adapted the line width to the current volatility. This is the power of the Architect.
█ CHAPTER 4: DEVELOPMENT PHILOSOPHY
The DafeVisualsLib was born from a desire to democratize elite-level indicator design. For too long, the ability to create beautiful, context-aware, and intuitively designed indicators has been the domain of a select few developers with deep knowledge of both programming and graphic design. This library changes that. It is an open-source tool that encapsulates thousands of hours of research and development into a simple, powerful API.
My philosophy is that a developer's most valuable asset is their idea. They should be free to focus on inventing new, powerful analytical concepts, without getting bogged down in the tedious, repetitive work of building robust visualization and configuration systems from scratch. This library is my contribution to the Pine Script community—a tool for builders, designed to accelerate innovation and elevate the quality of indicators for everyone.
This library embraces that philosophy. It handles immense complexity on the backend to deliver absolute simplicity and elegance on the frontend, both for the developer who uses it and the trader who benefits from it.
█ A NOTE TO USERS & DISCLAIMER
THIS IS A LIBRARY FOR DEVELOPERS: This script does nothing on its own. It is a powerful engine that must be imported and used by other indicator developers in their own scripts. It is a tool for building, not a ready-made indicator.
THE ANALYSIS IS A GUIDE: The analyze() function's classification of data and regimes is based on a robust set of heuristics, but it is a statistical interpretation. It provides a powerful baseline for visualization but is not a substitute for a trader's own judgment.
"Simplicity is the ultimate sophistication."
— Leonardo da Vinci
Taking you to school. - Dskyz, Create with DAFE
Prime Minute Marker (Selected)Prime Minute Marker – Description
This script marks specific prime-numbered minutes directly on the chart using clean, plain text (no boxes or shapes).
It is designed for time-based market observation, helping traders spot recurring reactions, swings, and behavioral patterns that tend to appear at specific minutes within the hour.
The marker:
Displays only selected prime minutes
Uses simple text labels for a clutter-free chart
Does not interfere with price action
Works on any intraday timeframe
Is especially useful for swing points, liquidity reactions, and auction-based analysis
This tool is meant for observation and confluence, not as a standalone trading signal.






















