指標和策略
blueprint_ephemeris_lib🔭 Library blueprint_ephemeris_lib
Consolidated planetary ephemeris library with improved accuracy. Supersedes previous individual planet libraries (lib_vsop_core, lib_vsop_mercury, lib_vsop_venus, etc.). One import gives you geocentric/heliocentric positions for all 10 solar system bodies.
█ ACCURACY — VALIDATED AGAINST JPL DE440
Every planetary body was validated against NASA's DE440 ephemeris (via Skyfield). Using only 1.6% of the full VSOP87D theory (511 of 31,577 terms), this library achieves sub-arcminute accuracy for all planets:
Sun 0.004° (14 arcseconds)
Mercury 0.005° (18")
Venus 0.006° (22")
Mars 0.010° (36")
Jupiter 0.007° (25")
Saturn 0.009° (32")
Uranus 0.013° (47")
Neptune 0.017° (61")
Moon 0.062° (3.7')
Pluto 0.059° (3.5')
All bodies under 0.1° RMS — more than sufficient for aspect calculations, ingress timing, and planetary line work. The Sun is accurate to 14 arcseconds using a truncated series that fits entirely inside Pine Script's token limits.
█ WHAT'S NEW (V2)
The original ephemeris required 11 chained library imports. A full validation audit uncovered critical coefficient errors and motivated this rewrite:
• L1 Precession Fix — All 8 VSOP87 planets had incorrect longitude rate coefficients (VSOP87B values instead of VSOP87D). Each was missing +0.24382 rad/millennium of general precession. This single correction reduced error from ~0.75° to < 0.1° across the board.
• 28% Smaller — 4,300 lines across 11 files → ~3,100 lines in 1 file.
• Single Import — No dependency chain. Faster execution.
• Moon Improvements — Functions accept raw `time` directly. Node functions renamed with explicit north/south designation.
█ THEORIES
VSOP87D (Bretagnon & Francou, 1988) — Mercury through Neptune
511 truncated terms out of 31,577 total (1.6%). Heliocentric spherical
coordinates in the ecliptic of date.
ELP2000-82 (Chapront-Touzé & Chapront, 1983) — Moon
91 terms (48 longitude + 43 latitude) from Meeus Chapter 47.
Meeus Series (Meeus, 1998) — Pluto
Analytical series from "Astronomical Algorithms" Ch. 37.
Valid ±1 century from J2000.
█ HOW TO USE
Import the library:
import BlueprintResearch/blueprint_ephemeris_lib/1 as eph
Basic — plot a planet's geocentric longitude and declination:
float jupiter_lon = eph.get_longitude(eph.Planet.Jupiter, time, true)
float jupiter_decl = eph.get_declination(eph.Planet.Jupiter, time)
plot(jupiter_lon, "Jupiter Geo Lon", color.yellow)
plot(jupiter_decl, "Jupiter Decl", color.red)
Retrograde detection:
bool mercury_retro = eph.is_retrograde(eph.Planet.Mercury, time)
bgcolor(mercury_retro ? color.new(color.red, 90) : na)
Moon nodes and declination:
float north_node = eph.get_mean_north_node_lon(time)
float south_node = eph.get_mean_south_node_lon(time)
float moon_decl = eph.get_declination(time)
plot(north_node, "North Node", color.green)
plot(south_node, "South Node", color.purple)
plot(moon_decl, "Moon Declination", color.orange)
Dynamic planet selection from input:
string planet_str = input.string("Sun", "Planet", options= )
eph.Planet p = eph.string_to_planet(planet_str)
float geo = eph.get_longitude(p, time, true)
float helio = eph.get_longitude(p, time, false)
float speed = eph.get_speed(p, time)
plot(geo, "Geocentric", color.yellow)
plot(helio, "Heliocentric", color.blue)
plot(speed * 100, "Speed x100", color.white)
All functions accept TradingView's `time` variable directly.
█ FUNCTIONS
Unified API (all planets):
`get_longitude(Planet, time, preferGeo)` — geo or heliocentric longitude
`get_declination(Planet, time)` — equatorial declination
`get_speed(Planet, time)` — longitude speed (°/day)
`is_retrograde(Planet, time)` — true when retrograde
`string_to_planet(string)` — name to enum
Averages :
`get_avg6_geo_lon` / `get_avg6_helio_lon` — Mercury–Saturn
`get_avg8_geo_lon` / `get_avg8_helio_lon` — Mercury–Neptune
Moon (direct access):
`get_geo_ecl_lon(time)` · `get_geo_ecl_lat(time)` · `get_declination(time)`
`get_mean_north_node_lon(time)` · `get_mean_south_node_lon(time)`
`get_true_north_node_lon(time)` · `get_true_south_node_lon(time)`
`get_north_node_declination(time)` · `get_south_node_declination(time)`
█ LIMITATIONS
• Truncated series — sub-degree accuracy, not sub-arcsecond. More than sufficient for ingress timing and aspect work.
• Validated against DE440 across 250 years (1850–2100). Over this full span, the worst-case VSOP87 planet (Uranus) is 0.017° RMS / 0.043° max error. Ingress dates manually verified back to the late 1800s with consistent accuracy.
• Pluto uses Meeus series, limited to ±1 century from J2000.
• Moon has no speed function.
█ ACKNOWLEDGMENTS
Coefficient validation was made possible by Greg Miller's VSOP87 multi-language project, which provides the complete VSOP87D coefficient tables in accessible formats. His work converting the original Fortran data files into CSV/JSON for multiple languages was essential for identifying the L1 precession errors in the original libraries. Miller released this work into the public domain.
github.com/gmiller123456/vsop87-multilang
References :
• Meeus, Jean. Astronomical Algorithms (2nd Ed., 1998)
• Bretagnon & Francou. VSOP87 Solutions (Astronomy & Astrophysics, 1988)
• Chapront-Touzé & Chapront. ELP2000-82 (1983)
█ OPEN SOURCE
MIT License — part of the Blueprint Research open-source toolkit.
Source code on GitHub
get_geo_ecl_lon(time_)
Returns geocentric ecliptic longitude of the Moon.
Parameters:
time_ (float)
Returns: (float) Longitude in degrees, range [0, 360).
get_geo_ecl_lat(time_)
Returns geocentric ecliptic latitude of the Moon.
Parameters:
time_ (float)
Returns: (float) Latitude in degrees.
get_obliquity_j(time_)
Returns mean obliquity of the ecliptic.
Parameters:
time_ (float)
Returns: (float) Obliquity in degrees.
get_declination(time_)
Returns geocentric equatorial declination of the Moon.
Parameters:
time_ (float)
Returns: (float) Declination in degrees, range where positive is north.
get_declination(p, t)
Returns planetary geocentric equatorial declination.
Parameters:
p (series Planet) : (Planet) Planet to query.
t (float) : (float) Unix timestamp in milliseconds (use built-in 'time' variable).
Returns: (float) Geocentric declination in degrees, range where positive is north.
@note Declination is always geocentric (no heliocentric equivalent in library).
get_mean_north_node_lon(time_)
Returns mean longitude of the Moon's North Node (ascending node).
Parameters:
time_ (float)
Returns: (float) Longitude in degrees, range [0, 360).
@note Mean node is a simple averaged calculation, reducing computational error. Used for declination calculations.
get_mean_south_node_lon(time_)
Returns mean longitude of the Moon's South Node (descending node).
Parameters:
time_ (float)
Returns: (float) Longitude in degrees, range [0, 360). Equals North Node + 180°.
get_true_north_node_lon(time_)
Returns true longitude of the Moon's North Node with perturbation corrections.
Parameters:
time_ (float)
Returns: (float) Longitude in degrees, range [0, 360).
@note True node includes periodic perturbations but formula is low precision. Consider using mean node for consistency.
get_true_south_node_lon(time_)
Returns true longitude of the Moon's South Node with perturbation corrections.
Parameters:
time_ (float)
Returns: (float) Longitude in degrees, range [0, 360). Equals True North Node + 180°.
get_north_node_declination(time_)
Returns declination of the Moon's North Node.
Parameters:
time_ (float)
Returns: (float) Declination in degrees, range (bounded by obliquity).
@note Uses mean node for calculation (more consistent than true node).
get_south_node_declination(time_)
Returns declination of the Moon's South Node.
Parameters:
time_ (float)
Returns: (float) Declination in degrees. Inverse of North Node declination.
normalizeLongitude(lon)
Normalizes any longitude value to the range [0, 360) degrees.
Parameters:
lon (float) : (float) Longitude in degrees (can be any value, including negative or >360).
Returns: (float) Normalized longitude in range [0, 360).
string_to_planet(planetStr)
Converts a planet string identifier to Planet enum value.
Parameters:
planetStr (string) : (string) Planet name (case-insensitive). Supports formats: "Sun", "☉︎ Sun", "sun", "SUN"
Returns: (Planet) Corresponding Planet enum. Returns Planet.Sun if string not recognized.
@note Supported planet strings: Sun, Moon, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto
get_longitude(p, t, preferGeo)
Returns planetary longitude with automatic coordinate system selection.
Parameters:
p (series Planet) : (Planet) Planet to query.
t (float) : (float) Unix timestamp in milliseconds (use built-in 'time' variable).
preferGeo (bool) : (bool) If true, return geocentric; if false, return heliocentric.
Returns: (float) Longitude in degrees, normalized to range [0, 360).
@note Sun and Moon always return geocentric regardless of preference (heliocentric not applicable).
get_speed(p, t)
Returns planetary geocentric longitude speed (rate of change).
Parameters:
p (series Planet) : (Planet) Planet to query.
t (float) : (float) Unix timestamp in milliseconds (use built-in 'time' variable).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion. Returns na for Moon.
@note Speed is always geocentric (no heliocentric equivalent in library). Moon speed calculation not implemented.
get_avg6_geo_lon(t)
get_avg6_geo_lon
@description Returns the arithmetic average of the geocentric longitudes for the six outer planets: Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average geocentric longitude of the six outer planets in degrees, range [0, 360).
get_avg6_helio_lon(t)
get_avg6_helio_lon
@description Returns the arithmetic average of the heliocentric longitudes for the six outer planets: Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average heliocentric longitude of the six outer planets in degrees, range [0, 360).
get_avg8_geo_lon(t)
get_avg8_geo_lon
@description Returns the arithmetic average of the geocentric longitudes for all eight classical planets: Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average geocentric longitude of all eight classical planets in degrees, range [0, 360).
get_avg8_helio_lon(t)
get_avg8_helio_lon
@description Returns the arithmetic average of the heliocentric longitudes for all eight classical planets: Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average heliocentric longitude of all eight classical planets in degrees, range [0, 360).
is_retrograde(p, t)
Returns true if the planet is currently in retrograde motion (geocentric speed < 0) == 0 = stationary.
Parameters:
p (series Planet) : The planet to check.
t (float) : Time in Unix timestamp (milliseconds).
Returns: true if the planet is in retrograde, false otherwise.
RSI / Stoch RSI Combo (Overlay)RSI + Stoch RSI Overlay combines two of TradingView’s most-used momentum tools into a single clean oscillator pane: Relative Strength Index (RSI) for broader momentum/strength and Stochastic RSI (K/D) for faster timing signals.
What you see
RSI line (classic momentum/strength)
Stoch RSI K & D lines (fast momentum/timing)
Optional RSI zones (70/50/30) with gradient fills
Optional Stoch RSI zones (80/50/20) with background fill
Why it’s useful
RSI is great to judge the “bigger” momentum regime, while Stoch RSI is great for entries/exits timing inside that regime. Overlaying both helps you quickly answer:
Is momentum bullish/bearish overall (RSI)?
Is price stretched or resetting (Stoch RSI 80/20 + K/D crosses)?
Are reversals supported by RSI structure or just a quick Stoch RSI fluctuation?
How it’s calculated
RSI is calculated from the selected source (default: close) and length.
Stoch RSI is calculated using the RSI values (not price), then smoothed into:
- K = SMA of Stoch(RSI) over “K” smoothing
- D = SMA of K over “D” smoothing
Optional features
RSI Smoothing: Add an RSI-based moving average (SMA/EMA/SMMA/WMA/VWMA) to reduce noise.
Bollinger Bands on RSI MA: If “SMA + Bollinger Bands” is selected, bands are plotted around the smoothing MA.
Divergence (optional): Enable classic regular bullish/bearish divergence detection on RSI (hidden by default to keep the UI clean) and use alert conditions.
Signals traders often look for
Trend bias: RSI above 50 = bullish pressure; below 50 = bearish pressure.
Overbought/oversold:
-> RSI 70/30 zones for broader momentum extremes
-> Stoch RSI 80/20 zones for faster “stretch / reset”
Timing: Stoch RSI K/D crosses near 20 or 80 can help time pullbacks or reversals—best when aligned with RSI context.
Alerts
Regular Bullish Divergence
Regular Bearish Divergence
(Enable “Calculate Divergence” in settings to activate.)
Notes
This is an oscillator tool, not a standalone trading system.
Works on any market/timeframe; consider combining with structure/trend confirmation.
RT Signals Optimized for Trends: Changed the default Sensitivity (ATR Period) to 21 and Multiplier to 3.0. This widens the stop-loss line, so small price wiggles (like in your image) won't trigger false Buy/Sell signals.
bosstvs tikole sir | ALL IN ONE ULTIMATE NEW STRONG BUY SELLWhat this indicator is
“bosstvs tikole sir | ALL IN ONE ULTIMATE” is a multi-indicator trading tool for TradingView.
It combines trend direction, buy/sell signals, targets, and key levels into one chart.
It is mainly designed for intraday & swing trading.
Main components explained
1. SuperTrend (Trend Direction)
Uses SuperTrend to identify the market trend
When price crosses above SuperTrend → bullish
When price crosses below SuperTrend → bearish
Sensitivity controls how fast/slow signals appear
2. Buy & Sell Signals
A BUY signal appears when:
Price crosses above SuperTrend
Price is above 13-period SMA
Label shows Buy or Strong Buy
Strong Buy = short-term momentum is stronger
A SELL signal appears when:
Price crosses below SuperTrend
Price is below 13-period SMA
Label shows Sell or Strong Sell
Alerts are available for both BUY and SELL.
3. Trend Cloud (Market Bias)
Uses 21 SMA & 34 SMA
Green cloud → bullish trend
Red cloud → bearish trend
Helps you stay on the correct side of the trend
4. Pivot Highs & Lows (Support / Resistance)
Automatically marks recent swing highs and lows
Useful for:
Stop-loss placement
Breakout & rejection trades
5. First Candle High–Low Targets (Intraday Logic)
Takes the first candle of the day
Calculates:
Buy target = High + Day range
Sell target = Low − Day range
Shows target levels on the chart
Signals when price hits the target
Best used on intraday timeframes.
6. EMA, SMA & VWAP (Dynamic Levels)
Optional moving averages:
EMA 21 → short-term trend
SMA 50 → medium-term trend
VWAP → institutional price level
You can turn each ON/OFF from settings.
How traders typically use it
Check the cloud → trend direction
Wait for SuperTrend signal
Confirm with EMA / SMA
Use pivot levels for stop-loss
Use day targets for exits
Best timeframes
5 min / 15 min → intraday
30 min / 1H → swing trades
Who this indicator is for
✔ Intraday traders
✔ Trend followers
✔ Traders who want everything in one script
❌ Not ideal for pure sideways markets
Volume Candle Coloring v5 (BARCOLOR STABLE)Volume Candle Coloring v5 (Barcolor Stable) is a TradingView indicator that dynamically colors price candles based on relative volume intensity and candle direction.
The indicator compares the current volume to a moving average of volume and classifies it into five distinct levels: Low, Normal, High, Extreme, and Ultra. Each level is mapped to a clear, stable color scheme, ensuring excellent readability and no repainting or color flickering.
Bullish and bearish candles are colored separately, allowing traders to instantly identify:
Strong buying pressure
Strong selling pressure
Volume exhaustion
Low-interest / ranging conditions
The color priority is strictly ordered to guarantee stable bar coloring across all market conditions.
🔧 Key Features
Volume-based candle coloring using a moving average reference
Five volume intensity levels (Low → Ultra)
Separate color sets for bullish and bearish candles
Stable barcolor logic (no repainting, no shifting)
Fully customizable volume thresholds
Works on all markets and timeframes
🎯 Use Cases
Identify high-conviction breakouts
Spot volume climaxes and exhaustion
Confirm trend strength
Improve price action and volume analysis
⚙️ Inputs
Volume MA Period
Low / High / Extreme / Ultra volume multipliers
Smart Money Flow: Automated Liquidity & Fair Value GapsOverview
This script is a comprehensive Smart Money Concepts (SMC) toolkit designed specifically for high-volatility assets like Gold (XAUUSD/MGC) on the 4-Hour timeframe. It automates the identification of institutional "traps" and entry zones by tracking Liquidity Sweeps and Fair Value Gaps (FVG).
Key Features
Liquidity Sweep Detection (SSL/BSL): Automatically identifies "Stop Hunts" where price wicks beyond recent swing points to grab liquidity before a reversal.
Automated Fair Value Gaps (FVG): Draws and labels institutional imbalances where price is likely to return for a re-entry.
Market Structure Shift (MSS): Signals the "Change of Character" (CHoCH) following a liquidity sweep, confirming a potential trend reversal.
Scannable Visuals: Includes clear labels and box projections to help traders identify "Discount" and "Premium" zones at a glance.
How to Trade with this Tool
Wait for a Sweep: Look for the SSL Sweep (Green Triangle) or BSL Sweep (Red Triangle) on the 4H chart.
Confirm the Shift: Wait for the MSS (Star) to appear, signaling that the "Smart Money" has shifted the trend.
The Entry: Place your limit orders within the Labeled FVG Boxes created by the move.
Risk Management: Place your Stop Loss below the wick of the Liquidity Sweep.
Disclaimer
This script is a tool to assist in technical analysis. It does not guarantee profits. Trading futures, especially Gold, involves significant risk. Always use proper risk-to-reward ratios.
Moving Average ExponentialDAYAAn Exponential Moving Average (EMA) is a technical chart indicator used in trading to identify market trends by averaging asset prices over a specific timeframe, placing higher weight and significance on the most recent price data. Unlike a Simple Moving Average (SMA), the EMA is more responsive to recent price changes, making it ideal for identifying reversals or short-term trends.
8:30 AM CST Vertical LineVertical line @ open New York market. It let's everyone know when to start trading in order to catch major moves in the market for the most part.
Monthly 14th Line (Past & Future)This utility indicator automatically draws a vertical line on a specific day of every month (default is the 14th). It is designed for traders who track monthly cycles, recurring economic events, or specific expiration dates.
DafePatternsLibDafePatternLib: The Adaptive Pattern Recognition Engine
DafePatternLib is not a static pattern library. It is an adaptive recognition engine. It doesn't just find patterns; it tracks, weights, and filters them 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 rigid paradigm. An indicator coded to find a "Bullish Engulfing" will signal that pattern with the same confidence every time, regardless of whether it has been failing consistently for weeks. It has no memory and no ability to adapt.
DafePatternLib was created to change this. It is built on a performance-based reinforcement framework. This library is not just a collection of detection functions; it is a self-weighting logic system. It tracks outcomes. It remembers what works. Over time, it amplifies the signals of high-probability patterns and filters out those that are failing in the current market regime.
This is not a black box. It is an open-source, observable learning system. It strengthens and weakens its own internal weights based on positive and negative feedback, evolving into a tool adapted to the specific asset you are trading.
█ CHAPTER 2: CORE INNOVATIONS
This library introduces several advanced concepts for algorithmic analysis:
Reinforcement Learning Engine: The core of the system. Every high-confidence pattern is logged into "Active Memory." The library tracks the outcome against projected stops and targets. If successful, the weight for that pattern category is strengthened. If it fails, the weight is reduced. This creates a continuous feedback loop.
Adaptation Rate (Plasticity): You have direct control over the engine's "plasticity"—its ability to learn. High plasticity allows fast adaptation to new conditions; lower plasticity creates a stable, long-term model.
Dynamic Volatility Scaling (DVS): Markets breathe. DVS is a proprietary function that calculates a real-time volatility scalar by comparing current ATR to historical averages. This scalar automatically adjusts lookback periods and sensitivities. In high volatility, engines look for larger structures; in low volatility, they tighten focus.
Smart Confidence Score: The output is not a simple "true/false." Every pattern includes two scores:
• Raw Confidence: Static confidence based on the pattern's textbook definition.
• Net Confidence: The adaptive score (Raw Confidence × Learned Bias). A performing pattern sees its confidence boosted; a failing pattern gets penalized.
Intelligent Filtering: If the learned bias for a category (e.g., "Candle") drops below a threshold (e.g., 0.8), the library automatically filters those signals, treating them as low-probability noise until performance improves.
█ CHAPTER 3: ANATOMY OF THE LOGIC — HOW IT THINKS
The LogicWeights (The Core)
The central data structure holding the system's "memory." It stores a floating-point weight or "bias" for each of the five major categories (Candle, Harmonic, Structure, Geometry, VSA). Initialized at 1.0 (neutral).
update_core() (The Learning Process)
The heart of the reinforcement loop. When a pattern resolves (win/loss), this function applies a positive or negative adjustment to the corresponding category weight. Weights are constrained between 0.5 (distrust) and 2.0 (trust).
manage_memory() (Short-Term Memory)
Maintains an array of active signals. On every bar, it checks if targets or stops have been hit. Resolved patterns trigger update_core(). Unresolved patterns eventually expire, applying a minor penalty to discourage stagnation.
scan_pattern_universe() (Master Controller)
The main exported function. On every bar, it:
Calculates the Dynamic Volatility Scalar (DVS).
Runs all pattern detection engines (VSA, Geometry, Candles, etc.) adapted to DVS.
Identifies the single best pattern based on raw confidence.
Passes it to memory for tracking.
Applies the learned bias to calculate Net Confidence.
Returns the final, adaptively weighted PatternResult.
█ CHAPTER 4: DEVELOPER INTEGRATION GUIDE
Designed for simplicity and power.
1. Import the Library:
import DskyzInvestments/DafePatternLib/1 as pattern
2. Call the Scanner:
The library handles DVS, scanning, memory, and learning internally.
pattern.PatternResult signal = pattern.scan_pattern_universe()
3. Use the Result:
if signal.is_active
label.new(bar_index, signal.entry, "Conf: " + str.tostring(signal.net_confidence, "#") + "%")
With just these lines, you integrate a self-weighting, multi-pattern recognition engine.
█ INPUTS TEMPLATE (COPY INTO YOUR SCRIPT)
// ═══════════════════════════════════════════════════════════
// INPUT GROUPS
// ═══════════════════════════════════════════════════════════
string G_AI_ENGINE = "══════════ 🧠 LOGIC ENGINE ══════════"
string G_AI_PATTERNS = "══════════ 🔬 PATTERN SELECTION ══════════"
string G_AI_VISUALS = "══════════ 🎨 VISUALS & SIGNALS ══════════"
string G_AI_DASH = "══════════ 📋 LOGIC STATE DASHBOARD ══════════"
string G_AI_ALERTS = "══════════ 🔔 ALERTS ══════════"
// ═══════════════════════════════════════════════════════════
// LOGIC ENGINE CONTROLS
// ═══════════════════════════════════════════════════════════
bool i_enable_ai = input.bool(true, "✨ Enable Adaptive Engine", group = G_AI_ENGINE,
tooltip="Master switch to enable the pattern recognition and learning system.")
float i_plasticity = input.float(0.03, "Adaptation Rate", minval=0.01, maxval=0.1, step=0.01, group = G_AI_ENGINE,
tooltip="Controls adaptation speed. • Low (0.01-0.02): Stable learning. • Medium (0.03-0.05): Balanced. • High (0.06+): Fast adaptation.")
float i_filter_threshold = input.float(0.8, "Adaptive Filter Threshold", minval=0.5, maxval=1.0, step=0.05, group = G_AI_ENGINE,
tooltip="Hide signals from categories with a learned bias below this value.")
// ═══════════════════════════════════════════════════════════
// 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", group = G_AI_PATTERNS, inline="row3")
// ═══════════════════════════════════════════════════════════
// VISUALS & DASHBOARD
// ═══════════════════════════════════════════════════════════
bool i_show_signals = input.bool(true, "Show Signals", group = G_AI_VISUALS)
bool i_show_dashboard = input.bool(true, "Show Logic Dashboard", group = G_AI_DASH)
█ DEVELOPMENT PHILOSOPHY
DafePatternLib was born from a vision to bring dynamic logic to technical analysis. We believe an indicator should not be a static tool, but an intelligent partner that adapts. This library is an open-source framework empowering developers to build the next generation of smart indicators.
█ DISCLAIMER
• LIBRARY FOR DEVELOPERS: This script produces no visual output on its own. It is an engine for developers.
• ADAPTIVE, NOT PREDICTIVE: Reinforcement learning optimizes based on recent history. It is a statistical edge, not a crystal ball.
• RISK WARNING: Patterns and confidence scores are for informational purposes.
"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
Create with DAFE.
5, 8, 21, 200 EMA Daily 200 SMA Daily VWAPMulti-timeframe EMA stack with Daily VWAP & 200 SMA
This clean overlay indicator combines popular exponential moving averages (5, 8, 21, 200 EMA on current timeframe) with a higher-timeframe Daily 200 SMA and session-resetting Daily VWAP — perfect for trend following, dynamic support/resistance, and intraday bias on stocks, forex, crypto, or futures.
Key Features:
• 5 EMA (very fast) – quick momentum & scalping filter (default lime)
• 8 EMA (fast) – short-term trend & pullback entries (default blue)
• 21 EMA (medium) – intermediate trend & confluence zone (default orange)
• 200 EMA (long) – major trend direction & big-picture support/resistance (default purple)
• Daily 200 SMA – smooth higher-timeframe trend line that stays constant on lower TFs (default teal, thicker line)
• Daily VWAP – volume-weighted average price that resets each trading day (default yellow)
All lines feature right-edge labels that auto-refresh daily and follow price action (toggleable + size adjustable).
Common uses:
- Trend alignment: Trade in direction of higher EMAs + Daily 200 SMA
- Pullbacks: Enter near 5/8/21 EMA when aligned with 200s
- Intraday mean reversion: Use Daily VWAP as fair value anchor
- Dynamic S/R: Watch reactions at these levels
Fully customizable colors, lengths, and label visibility. Clean code, no repainting issues on historical bars.
Happy trading!
Sessions Gold Sniper MGC1!Overview
The MGC1! Sniper Time Zones is a specialized intraday precision tool designed for Gold futures traders (MGC/GC). It visually segments the trading day into four critical high-volatility windows based on ICT/SMC Killzones and Market Profile auction logic.
Core Functionality
The script automatically highlights specific time blocks on the chart to identify where "Smart Money" is likely to inject liquidity. It assists the trader in avoiding "chop" (low volatility periods) and focusing execution only during high-probability hours.
Highlighted Sessions
London Open (06:00 – 10:00): Captures the initial trend setting and European liquidity raids.
Pre-NY Lunch (12:00 – 13:00): Monitors mid-day rebalancing or potential position squaring before the NY open.
NY Open (14:00 – 16:00): The primary volatility window for ICT/SMC setups (Silver Bullet & Judat Swing).
NY PM Session (16:30 – 18:00): Focuses on the afternoon expansion or daily close reversals.
Key Features
Dynamic Labels: Clear, top-aligned text labels identify each session, ensuring you never lose track of the current market context across any timeframe (M1 to H1).
Customizable Aesthetics: Fully adjustable color palette via the settings menu to match any dark or light chart theme.
Visual Scannability: Uses transparent background fills (bgcolor) to allow price action and candlesticks to remain the primary focus while providing structural time-context.
Technical Setup
Platform: TradingView (Pine Script v5).
Timezone: Set to UTC+1 (Central European Time) by default to align with the MGC1! Sniper methodology.
Predictive Moving Average Convergence Divergence - RyderPredictive MACD that uses EMA math to forecast 1-3 bars ahead, assuming price remains constant. Shows current MACD (5/34/5 default) plus three forward-projected values. Useful for seeing momentum trends and potential early crossover signals, but predictions assume zero price change so they're best used as directional indicators rather than precise forecasts.
DkS Morning Start PRO 3.0DkS Morning Start PRO — FX Live Guide (Auto Entry / SL / TP + Asia Range)
DkS Morning Start PRO is a professional trading tool designed for Forex and intraday traders who want precise, rule-based entries using the Asian session breakout, with fully automated Entry, Stop Loss, and Take Profit levels.
The script automatically detects the Asian session range, monitors breakout conditions during the morning session, and generates a complete trading plan with clean, continuous visual levels directly on the chart.
Key Features
• Automatic Asian Range (Daily High & Low)
Draws the current day’s Asian High and Low and automatically removes previous levels, keeping your chart clean and focused.
• Automatic Entry, Stop Loss, and Take Profit
Calculated using professional logic based on:
Asian range breakout
Optional retest confirmation
Configurable risk management
Custom Risk/Reward ratio
• Clean and Professional Visual Display
Includes:
Continuous Entry, SL, and TP lines
Professional labels (Entry / SL / TP)
Real-time informational panel
Clear and minimal chart design
• Live Trading Plan (Before Confirmation)
Displays potential Entry, SL, and TP levels in advance, allowing traders to prepare before the signal confirms.
• Professional Confirmation Filters
Built-in filters for higher-probability setups:
Fast and Slow EMA trend filter
RSI confirmation filter
One trade per day option (ideal for FTMO and prop firms)
• Designed for Forex Intraday and Scalping
Highly effective on:
EURUSD
GBPUSD
AUDUSD
XAUUSD
Recommended timeframes:
M5
M15
M30
Advantages
• Eliminates emotional decision-making
• Provides clear, rule-based entries
• Improves consistency and discipline
• Ideal for FTMO and prop firm trading
• Clean, professional interface
• Non-repainting logic
How It Works
Detects the Asian session range
Waits for breakout during morning session
Confirms retest (optional)
Calculates Entry, Stop Loss, and Take Profit
Displays full trading plan automatically
Hidden Divergence with BB & Triple Filterthis stargies use for intraday best for structure trading and breakout and breakdown helpful for all beginer and expernices trader
Damodaran_EV_EBITLibrary "Damodaran_EV_EBIT"
sector_sigma(sector)
Parameters:
sector (string)
ev_ebit_base(industry)
Parameters:
industry (string)
ev_ebit_band(industry, sector)
Parameters:
industry (string)
sector (string)
ev_ebit_low(industry, sector)
Parameters:
industry (string)
sector (string)
ev_ebit_high(industry, sector)
Parameters:
industry (string)
sector (string)
UK NQ: Custom Day, Dynamic BreakThe Problem
For UK-based traders focusing on the Nasdaq (NQ) or S&P 500 (ES), the trading day is usually split into two high-probability windows: the London Morning and the New York Open. However, every year in March and October, the US and UK change their clocks on different dates. During these 4 "Mismatch Weeks," the US market opens at 13:30 UK time instead of the usual 14:30.
If your session highlighter is fixed, your lunch break will be out of sync, causing you to miss the critical US pre-market volatility or trade during the "Lunch Lull."
The Solution
This indicator is a "Smart" session manager specifically designed for the UK timezone (Europe/London). It allows you to set your preferred working hours (e.g., 09:15 to 17:15) but dynamically recalculates your internal lunch break based on the live relationship between the London and New York exchange clocks.
Key Features
Dynamic "Smart Break" Logic: The script identifies when the US has "Sprung Forward" or the UK has "Fallen Back" earlier than the other. It automatically shifts your 90-minute lunch break 1 hour earlier (from 12:00 to 11:00) during those weeks.
Fixed Work Window: Your overall trading day (Start/End times) remains fixed to your local UK clock, while only the internal high-volume windows shift to stay aligned with Wall Street.
Universal Backtesting (2020–2030): Unlike basic highlighters, this script contains a built-in mathematical calendar for DST shifts. It is 100% accurate for historical backtesting across the last 5 years and the next 5 years.
Customizable Inputs: Easily adjust your start time (e.g., 09:00 vs 09:15) and finish time to suit your personal trading plan.
How to Read the Chart
Blue Zone (London Morning): Highlights the trend established by European institutional flow.
Uncolored Zone (The Break): Represents the "Lunch Lull." A visual cue to stay flat during lower liquidity.
Green Zone (US Open/Overlap): Highlights the surge in volume starting with US Economic Data (13:30/12:30) and the New York Opening Bell.
Perfect For:
Intraday traders based in the UK who want a "set and forget" solution that ensures they are always at their desk exactly 1 hour before the US market opens, regardless of what the clocks are doing.
UK Dual-Session Highlighter (Fixed Day, Dynamic Break)Overview
Specifically engineered for UK-based Nasdaq (NQ) and US Index traders who operate on a fixed professional schedule (09:15 – 17:15 UK Time).
The primary challenge for UK traders is the 4-week annual "Timezone Mismatch" between London and New York (occurring in March and October). During these weeks, the US market opens at 13:30 UK time instead of the usual 14:30. This indicator solves that problem by automatically shifting your 90-minute lunch break to ensure you are always back at your desk exactly 1 hour before the Wall Street opening bell.
The "Smart Break" Logic
The indicator maintains a strict 09:15 start and 17:15 finish, but dynamically re-calculates the internal "Lunch Lull" based on the live US/UK offset:
Standard Weeks (5hr Offset):
Morning: 09:15 – 12:00 | Break: 12:00 – 13:30 | Afternoon: 13:30 – 17:15
Mismatch Weeks (4hr Offset):
Morning: 09:15 – 11:00 | Break: 11:00 – 12:30 | Afternoon: 12:30 – 17:15
Key Features (2020–2030 Ready)
Universal Backtesting: Unlike basic session highlighters, this script uses a mathematical calendar to identify DST mismatch dates for any year between 2020 and 2030. Perfect for verifying historical strategy performance.
Zero-Maintenance: Automatically detects when the US "Springs Forward" or the UK "Falls Back" earlier than the other.
Volatility Sync: Ensures your afternoon trading session always begins during the high-volume US Pre-Market window (1 hour before the NYSE open).
Visual Clarity: Uses distinct colors to separate the London Morning trend from the New York Open overlap.
How to Use
Blue Zone (Morning): Trade the London session momentum.
Uncolored Zone (Break): The "Lunch Lull." Step away from the screens during lower liquidity.
Green Zone (Afternoon): Focus on US Economic Data (8:30 AM ET) and the 14:30 (or 13:30) New York Open.
Settings
All times are hard-coded to Europe/London standards. No manual timezone adjustments are required on your chart settings.
_MyLibraryV1Library "_MyLibraryV1"
maStackedBull(src, fastLen, midLen, slowLen)
Parameters:
src (float)
fastLen (int)
midLen (int)
slowLen (int)
maStackedBear(src, fastLen, midLen, slowLen)
Parameters:
src (float)
fastLen (int)
midLen (int)
slowLen (int)
bullCross(src1, src2)
Parameters:
src1 (float)
src2 (float)
bearCross(src1, src2)
Parameters:
src1 (float)
src2 (float)
bullRegime(src, len)
Parameters:
src (float)
len (int)
bearRegime(src, len)
Parameters:
src (float)
len (int)
rsiBull(len)
Parameters:
len (simple int)
rsiBear(len)
Parameters:
len (simple int)
atrExpansion(len)
Parameters:
len (simple int)
atrContraction(len)
Parameters:
len (simple int)
Candle Countdown TimerShows the remaining time left for the current candle based on the chart’s selected timeframe.






















