Chimera [theUltimator5]In myth, the chimera is an “impossible” hybrid—lion, goat, and serpent fused into one—striking to look at and formidable in presence. The word has come to mean a beautiful, improbable union of parts that shouldn’t work together, yet do.
Chimera is a dual-mode market context tool that blends a multi-input oscillator with classic ADX/DI trend strength, plus optional multi-timeframe “gap-line” tracking. Use it to visualize regime (trend vs. range), momentum swings around an adaptive midline, and higher timeframe (HTF) reference levels that auto-terminate on touch/cross.
Modes
1) Oscillator view
A smoothed composite of five common inputs—RSI, MACD (oscillator), Bollinger position, Stochastic, and an ATR/DI-weighted bias. Each is normalized to a comparable 0–100 style scale, averaged, and plotted as a candle-style oscillator (short vs. long smoothing, wickless for clarity). A dynamic midline with standard-deviation bands frames neutral → bearish/bullish zones. Colors ramp from neutral to your chosen Oversold/Overbought endpoints; consolidation can override to white.
Here is a description of the (5) signals used to calculate the sentiment oscillator:
RSI (14): Measures recent momentum by comparing average gains vs. losses. High = strength after advances; low = weakness after declines. (Z-score normalized to 0–100.)
MACD oscillator (12/26/9): Uses the difference between MACD and its signal (histogram) to gauge momentum shifts. Positive = bullish tilt; negative = bearish. (Z-score normalized.)
Bollinger Bands position (20, 2): Locates price within the bands (0–100 from lower → upper). Near upper suggests strength/expansion; near lower suggests weakness/contraction. (Then normalized.)
Stochastic (14, 3, 3): Shows where the close sits within the recent high-low range, smoothed via %D. Higher values = closes near highs; lower = near lows. (Scaled 0–100.)
ATR/DI composite (14): Volatility-weighted directional bias: (+DI − −DI) amplified by ATR as a % of price and its relative average. Positive = bullish pressure with volatility; negative = bearish. (Rank/scale normalized.)
All five are normalized and averaged into one composite, then smoothed (short/long) and compared to an adaptive midline with bands.
2) ADX view
Shows ADX, +DI, –DI with user-defined High Threshold. Transparency and color shift with regime. When ADX is strong, a directional “fire/ice” gradient fills the area between ADX and the high threshold, biased toward the dominant DI; when ADX is weak, a soft white fade highlights low-trend conditions.
HTF gap-line tracking (optional; both modes)
Detects “gap-like” reference levels after weak-trend consolidation flips into a sudden DI jump.
Anchors a line at the event bar’s open and auto-terminates upon first touch/cross (tick-size tolerance).
Auto-selects up to three higher timeframes suited to your chart resolution and prints non-overlapping lines with labels like 1H / 4H / 1D. Lower-priority duplicates are suppressed to reduce clutter.
Confirmation / repaint notes
Signals and lines finalize on bar close of the relevant timeframe.
HTF elements update only on the HTF bar close. During a forming bar they may appear transiently.
Line removal finalizes after the bar that produced the touch/cross closes.
Visual cues & effects
Oscillator candles: Open/High = long smoothing; Low/Close = short smoothing (no wicks).
Adaptive bands: Midline ± StdDev Multiplier × stdev of the blended series.
Consolidation tint: Optional white backdrop/candles when the consolidation condition is true (balance + low ADX).
Breakout VFX (optional): With strong DI/ADX and Bollinger breaks, renders a subtle “fire” flare above upper-band thrusts or “ice” shelf below lower-band thrusts.
Inputs (high-level)
Visual Style: Oscillator or ADX.
General (Oscillator): Lookback Period, Short/Long Smoothing, Standard Deviation Multiplier.
Color (Oscillator): Oversold/Overbought colors for gradient endpoints.
Plot (Oscillator): Show Candles, Show Slow MA Line, Show Individual Component (RSI/MACD/BB/Stoch/ATR).
Table (Oscillator): Show Information Table & position (compact dashboard of component values + status).
ADX / Gaps / VFX (both modes): ADX High Threshold, Highlight Backgrounds, Show Gap Labels, Visual Overlay Effects, and color choices for current-TF & HTF lines.
HTF selection: Automatic ladder (3 tiers) based on your chart timeframe.
Alerts (built-in)
Buy Signal – Primary: Oscillator exits oversold.
Sell Signal – Primary: Oscillator exits overbought.
Gap Fill Line Created (Any TF)
Gap Fill Line Terminated (Any TF)
ADX Crossed ABOVE/BELOW Low Threshold
ADX Crossed ABOVE/BELOW High Threshold
Consolidation Started
Alerts evaluate on the close of the relevant timeframe.
How to read it (quick guide)
Pick your lens: Oscillator for blended momentum around an adaptive midline; ADX for trend strength and DI skew.
Watch extremes & mean re-entries (Oscillator): Approaches to the top/bottom band show persistent momentum; returns toward the midline show normalization.
Check regime (ADX): Below Low = low-trend; above High = strong trend, with “fire/ice” bias toward +DI/–DI.
Track gap lines: Fresh labels mark new reference levels; lines auto-remove on first interaction. HTF lines add context but finalize only on HTF close.
The uniqueness from this indicator comes from multiple areas:
1. A unique multi-timeframe algorithm detects gap fill zones and plots them on the chart.
2. Visual effects for both visual modes were hand crafted to provide a visually stunning and intuitive interface.
3. The algorithm to determine sentiment uses a unique blend of weight and sensitivity adjustment to create a plot with elastic upper and lower bounds based off historical volatility and price action.
Indicatori e strategie
Intraday Buy/Sell/Average Zones by Chaitu50cIntraday Buy/Sell/Average Zones by chaitu50c
Timeframe:
Tested on the 5-minute chart.
Recommended timeframe: 5-minute
What it does
This indicator marks intraday Buy (green) and Sell (red) zones made by strong close-confirmed breakouts. These zones act as support/resistance. If price later closes through a zone, the zone changes color from that bar forward (support ↔ resistance). It can flip more than once.
How zones form
Single breakout: an opposite-type candle closes beyond the previous candle’s high/low.
Double breakout: a base candle, then two opposite-type candles, and the second one closes beyond the base high/low.
Zone size
Buy zone: from the combo lowest low up to the nearest open/close of the combo.
Sell zone: from the combo highest high down to the nearest open/close of the combo.
Color shift (optional)
If price closes through a zone, it flips color at that bar and behaves as the other side (support ↔ resistance). Flips can happen again later.
Overlap control
When a new zone overlaps an existing same-color zone in the same session, choose:
Merge (combine), or
Suppress (ignore the new one).
Flipped zones use their current color for this.
Right edge & session
All zones extend to the right (your offset). Detection is limited to your chosen session, and you can show only the last N sessions.
---
How to trade (simple)
A) Initial breakout trade
When a new zone forms, that breakout itself can be a trade idea in the breakout direction, The stoploss will be the zone.
B) Zone breakout trade (flip)
If price later closes out of a zone and it changes color, that breakout is another trade opportunity in the new direction.
C) Retrace & average trade
When price retests a zone, wait for a confirmation candle in the zone’s favor
— bullish close for a green zone, bearish close for a red zone — then average entries inside/near the zone.
Place stops just beyond the opposite edge of the zone.
If the zone flips color, stop averaging; bias changed.
---
Key settings
Breakout type: Single and/or Double
Confirm on Close: strict mode (no intrabar preview) or allow intrabar preview that auto-removes if fail
Color Shift on Breaks: on/off
Same-Type Overlap: Merge/Suppress
Session, Sessions to Display, Right Offset, Colors, Max Zones
Reminder: Best results on the 5-minute timeframe (tested and recommended).
Heikin-Ashi-Candles MTFHeikin-Ashi Higher Timeframe Candles
This indicator overlays higher-timeframe Heikin-Ashi candles (default: 5 minutes) onto a lower-timeframe chart (e.g., 1 minute). Instead of using standard candlesticks, it draws:
Semi-transparent rectangles to represent the candle bodies.
Vertical lines to represent wicks, centered on each body.
Key features:
Dynamic transparency: The current, still-forming higher-timeframe candle is plotted in green or red (depending on trend) with a separate, lighter transparency (default: 30) so you can easily distinguish it from completed candles.
Finalization on close: As soon as a higher-timeframe candle closes, its body and wicks update to the standard transparency level (default: 50), ensuring completed candles are visually distinct.
Customizable inputs: You can adjust
The higher timeframe (tf) for Heikin-Ashi calculations.
Body transparency for confirmed candles.
Transparency for unfinished candles.
Wick thickness.
Use case:
This is particularly useful for traders who analyze price action on lower timeframes but want to stay aware of the higher-timeframe Heikin-Ashi trend without switching charts. The fading effect on the active candle helps prevent confusion between fully formed candles and those still developing.
Kalman Adjusted Average True Range [BackQuant]Kalman Adjusted Average True Range
A volatility-aware trend baseline that fuses a Kalman price estimate with ATR “rails” to create a smooth, adaptive guide for entries, exits, and trailing risk.
Built on my original Kalman
This indicator is based on my original Kalman Price Filter:
That core smoother is used here to estimate the “true” price path, then blended with ATR to control step size and react proportionally to market noise.
What it plots
Kalman ATR Line the main baseline that turns up/down with the filtered trend.
Optional Moving Average of the Kalman ATR a secondary line for confluence (SMA/Hull/EMA/WMA/DEMA/RMA/LINREG/ALMA).
Candle Coloring (optional) paint bars by the baseline’s current direction.
Why combine Kalman + ATR?
Kalman reduces measurement noise and produces a stable path without the lag of heavy MAs.
ATR rails scale the baseline’s step to current volatility, so it’s calm in chop and more responsive in expansion.
The result is a single, intelligible line you can trade around: slope-up = constructive; slope-down = caution.
How it works (plain English)
Each bar, the Kalman filter updates an internal state (tunable via Process Noise , Measurement Noise , and Filter Order ) to estimate the underlying price.
An ATR band (Period × Factor) defines the allowed per-bar adjustment. The baseline cannot “jump” beyond those rails in one step.
A direction flip is detected when the baseline’s slope changes sign (upturn/downturn), and alerts are provided for both.
Typical uses
Trend confirmation Trade in the baseline’s direction; avoid fading a firmly rising/falling line.
Pullback timing Look for entries when price mean-reverts toward a rising baseline (or exits on tags of a falling one).
Trailing risk Use the baseline as a dynamic guide; many traders set stops a small buffer beyond it (e.g., a fraction of ATR).
Confluence Enable the MA overlay of the Kalman ATR; alignment (baseline above its MA and rising) supports continuation.
Inputs & what they do
Calculation
Kalman Price Source which price the filter tracks (Close by default).
Process Noise how quickly the filter can adapt. Higher = more responsive (but choppier).
Measurement Noise how much you distrust raw price. Higher = smoother (but slower to turn).
Filter Order (N) depth of the internal state array. Higher = slightly steadier behavior.
Kalman ATR
Period ATR lookback. Shorter = snappier; longer = steadier.
Factor scales the allowed step per bar. Larger factors permit faster drift; smaller factors clamp movement.
Confluence (optional)
MA Type & Period compute an MA on the Kalman ATR line , not on price.
Sigma (ALMA) if ALMA is selected, this input controls the curve’s shape. (Ignored for other MA types.)
Visuals
Plot Kalman ATR toggle the main line.
Paint Candles color bars by up/down slope.
Colors choose long/short hues.
Signals & alerts
Trend Up baseline turns upward (slope crosses above 0).
Alert: “Kalman ATR Trend Up”
Trend Down baseline turns downward (slope crosses below 0).
Alert: “Kalman ATR Trend Down”
These are state flips , not “price crossovers,” so you avoid many one-bar head-fakes.
How to start (fast presets)
Swing (daily/4H) ATR Period 7–14, Factor 0.5–0.8, Process Noise 0.02–0.05, Measurement Noise 2–4, N = 3–5.
Intraday (5–15m) ATR Period 5–7, Factor 0.6–1.0, Process Noise 0.05–0.10, Measurement Noise 2–3, N = 3–5.
Slow assets / FX raise Measurement Noise or ATR Period for calmer lines; drop Factor if the baseline feels too jumpy.
Reading the line
Rising & curving upward momentum building; consider long bias until a clear downturn.
Flat & choppy regime uncertainty; many traders stand aside or tighten risk.
Falling & accelerating distribution lower; short bias until a clean upturn.
Practical playbook
Continuation entries After a Trend Up alert, wait for a minor pullback toward the baseline; enter on evidence the line keeps rising.
Exit/reduce If long and the baseline flattens then turns down, trim or exit; reverse logic for shorts.
Filters Add a higher-timeframe check (e.g., only take longs when the daily Kalman ATR is rising).
Stops Place stops just beyond the baseline (e.g., baseline − x% ATR for longs) to avoid “tag & reverse” noise.
Notes
This is a guide to state and momentum, not a guarantee. Combine with your process (structure, volume, time-of-day) for decisions.
Settings are asset/timeframe dependent; start with the presets and nudge Process/Measurement Noise until the baseline “feels right” for your market.
Summary
Kalman ATR takes the noise-reduction of a Kalman price estimate and couples it with volatility-scaled movement to produce a clean, adaptive baseline. If you liked the original Kalman Price Filter (), this is its trend-trading cousin purpose-built for cleaner state flips, intuitive trailing, and confluence with your existing
Big Player Buy/Sell SignalHow It Works:
Detects volume spikes over SMA of recent volume.
Signals a buy if there’s a green candle near a recent swing low on high volume (possible big player accumulation).
Signals a sell if there’s a red candle near a swing high on high volume (possible big player distribution).
This is a proxy, not a direct measure of institutional trades, but it often works surprisingly well in liquid markets like Nifty 50 or Bank Nifty.
If you want, I can make an advanced version that combines RSI, EMA, and first occurrence detection for higher accuracy in catching big player moves.
Multipower Entry SecretMultipower Entry Secret indicator is designed to be the ultimate trading companion for traders of all skill levels—especially those who struggle with decision-making due to unclear or overwhelming signals. Unlike conventional trading systems cluttered with too many lines and confusing alerts, this indicator provides a clear, adaptive, and actionable guide for market entries and exits.
Key Points:
Clear Buy/Sell/Wait Signals:
The script dynamically analyzes price action, candle patterns, volume, trend strength, and higher time frame context. This means it gives you “Buy,” “Sell,” or “Wait” signals based on real, meaningful market information—filtering out the noise and weak trades.
Multi-Timeframe Adaptive Analysis:
It synchronizes signals between higher and current timeframes, ensuring you get the most reliable direction—reducing the risk of getting caught in fake moves or sudden reversals.
Automatic Support, Resistance & Liquidity Zones:
Key levels like support, resistance, and liquidity zones are auto-detected and displayed directly on the chart, helping you make precise decisions without manual drawing.
Real-Time Dashboard:
All relevant information, such as trend strength, market intent, volume sentiment, and the reason behind each signal, is neatly summarized in a dashboard—making monitoring effortless and intuitive.
Customizable & Beginner-Friendly:
Whether you’re a newcomer wanting straightforward guidance or a professional needing advanced customization, the indicator offers flexible options to adjust analysis depth, timeframes, sensitivity, and more.
Visual & Clutter-Free:
The design ensures that your chart remains clean and readable, showing only the most important information. This minimizes mental overload and allows for instant decision-making.
Who Will Benefit?
Beginners who want to learn trading logic, avoid common traps, and see the exact reason behind every signal.
Advanced traders who require adaptive multi-timeframe analytics, fast execution, and stress-free monitoring.
Anyone who wants to save screen time, reduce analysis paralysis, and have more confidence in every trade they take.
1. No Indicator Clutter
Intent:
Many traders get confused by charts filled with too many indicators and signals. This often leads to hesitation, missed trades, or taking random, risky trades.
In this Indicator:
You get a clean and clutter-free chart. Only the most important buy/sell/wait signals and relevant support/resistance/liquidity levels are shown. These update automatically, removing the “overload” and keeping your focus sharp, so your decision-making is faster and stress-free.
2. Exact Entry Guide
Intent:
Traders often struggle with entry timing, leading to FOMO (fear of missing out) or getting trapped in sudden market reversals.
In this Indicator:
The system uses powerful adaptive logic to filter out weak signals and only highlight the strongest market moves. This not only prevents you from entering late or on noise, but also helps avoid losses from false breakouts or whipsaws. You get actionable suggestions—when to enter, when to hold back—so your entries are high-conviction and disciplined.
3. HTF+LTF Logic: Multitimeframe Sync Analysis
Intent:
Most losing trades happen when you act only on the short-term chart, ignoring the bigger market trend.
In this Indicator:
Signals are based on both the current chart timeframe (LTF) and a higher (HTF, like hourly/daily) timeframe. The indicator synchronizes trend direction, momentum, and structure across both levels, quickly adapting to show you when both are aligned. This filtering results in “only trade with the bigger trend”—dramatically increasing your win rate and market confidence.
4. Auto Support/Resistance & Liquidity Zones
Intent:
Drawing support/resistance and liquidity zones manually is time-consuming and error-prone, especially for beginners.
In this Indicator:
The system automatically identifies and plots the most crucial support/resistance levels and liquidity zones on your chart. This is based on adaptive, real-time price and volume analysis. These zones highlight where major institutional activity, trap setups, or real breakouts/reversals are most likely, removing guesswork and giving you a clear reference for entries, exits, and stop placements.
5. Clear Action/Direction
Intent:
Traders need certainty—what does the market want right now? Most indicators are vague.
In this Indicator:
Your dashboard always displays in plain words (like “BUY”, “SELL”, or “WAIT”) what action makes sense in the current market phase. Whether it’s a bull trap, volume spike, wick reversal, or exhaustion—it’s interpreted and explained clearly. No more confusion—just direct, real-time advice.
6. For Everyone (Beginner to Pro)
Intent:
Most advanced indicators are overwhelming for new traders; simple ones lack depth for professionals.
In this Indicator:
It is simple enough for a beginner—just add it to the chart and instantly see what action to consider. At the same time, it includes advanced adaptive analysis, multi-timeframe logic, and customizable settings so professional traders can fine-tune it for their strategies.
7. Ideal Usage and User Benefits
Instant Decision Support:
Whenever you’re unsure about a trade, just look at the indicator’s suggestion for clarity.
Entry Learning:
Beginners get real-time “practice” by not only seeing signals, but also the reason behind them—improving your chart reading and market understanding.
Screen Time & Stress Reduction:
Clear, relevant information only; no noise, less fatigue, faster decisions.
Makes Trading Confident & Simple:
The smart dashboard splits actionable levels (HTF, LTF, action) so you never miss a move, avoid traps, and stay aligned with high-probability trades.
8. Advanced Input Settings (Smart Customization)
Explained with Examples:
Enable Wick Analysis:
Finds candles with strong upper/lower wicks (signs of rejection/buying/selling force), alerting you to hidden reversals and protecting from FOMO entries.
Enable Absorption:
Detects when heavy order flow from one side is “absorbed” by the other (shows where institutional buyers/sellers are likely active, helps spot fake breakouts).
Enable Unusual Breakout:
Highlights real breakouts—large volatility plus high volume—so you catch genuine moves and avoid random spikes.
Enable Range/Expansion:
Smartly flags sudden range expansions—when the market goes from quiet to volatile—so you can act at the start of real trends.
Trend Bar Lookback:
Adjusts how many bars/candles are used in trend calculations. Short (fast trades, more signals), long (more reliability, fewer whipsaws).
Bull/Bear Bars for Strong Trend Min:
Sets how many candles in a row must support a trend before calling it “strong”—prevents flipping signals, keeps you disciplined.
Volume MA Length:
Lets you adjust how many bars back volume is averaged—fine-tune for your asset and trading style for best volume signals.
Swing Lookback Bars:
Set how many bars to use for swing high/low detection—short (quick swing levels), long (stronger support/resistance).
HTF (Bias Window):
Decide which higher timeframe the indicator should use for big-picture market mood. Adjustable for any style (scalp, swing, position).
Adaptive Lookback (HTF):
Choose how much HTF history is used for detecting major extremes/zones. Quick adjust for more/less sensitivity.
Show Support/Resistance, Liquidity Zones, Trendlines:
Toggle them on/off instantly per your needs—keeps your chart relevant and tailored.
9. Live Dashboard Sections Explained
Intent HTF:
Shows if the bigger timeframe currently has a Bullish, Bearish, or Neutral (“Chop”) intent, based on strict volume/price body calculations. Instant clarity—no more guessing on trend bias.
HTF Bias:
Clear message about which side (buy/sell/sideways) controls the market on the higher timeframe, so you always trade with the “big money.”
Chart Action:
The central action for the current bar—Whether to Buy, Sell, or Wait—calculated from all indicator logic, not just one rule.
TrendScore Long/Short:
See how many candles in your chosen window were bullish or bearish, at a glance. Instantly gauge market momentum.
Reason (WHY):
Every time a signal appears, the “reason” cell tells you the primary logic (breakout, wick, strong trend, etc.) behind it. Full transparency and learning—never trade blindly.
Strong Trend:
Shows if the market is currently in a powerful trend or not—helping you avoid choppy, risky entries.
HTF Vol/Body:
Displays current higher timeframe volume and candle body %—helping spot when big players are active for higher probability trades.
Volume Sentiment:
A real-time analysis of market psychology (strong bullish/bearish, neutral)—making your decision-making much more confident.
10. Smart and User-Friendly Design
Multi-timeframe Adaptive:
All calculations can now be drawn from your choice of higher or current timeframe, ensuring signals are filtered by larger market context.
Flexible Table Position:
You can set the live dashboard/summary anywhere on the chart for best visibility.
Refined Zone Visualization:
Liquidity and order blocks are visually highlighted, auto-tuning for your settings and always cleaning up to stay clutter-free.
Multi-Lingual & Beginner Accessible:
With Hindi and simple English support, descriptions and settings are accessible for a wide audience—anyone can start using powerful trading logic with zero language barrier.
Efficient Labels & Clear Reasoning:
Signal labels and reasons are shown/removed dynamically so your chart stays informative, not messy.
Every detail of this indicator is designed to make trading both simpler and smarter—helping you avoid the common pitfalls, learn real price action, stay in sync with the market’s true mood, and act with discipline for higher consistency and confidence.
This indicator makes professional-grade market analysis accessible to everyone. It’s your trusted assistant for making smarter, faster, and more profitable trading decisions—providing not just signals, but also the “why” behind every action. With auto-adaptive logic, clear visuals, and strong focus on real trading needs, it lets you focus on capturing the moves that matter—every single time.
Information Flow Analysis[b🔄 Information Flow Analysis: Systematic Multi-Component Market Analysis Framework
SYSTEM OVERVIEW AND ANALYTICAL FOUNDATION
The Information Flow Kernel - Hybrid combines established technical analysis methods into a unified analytical framework. This indicator systematically processes three distinct data streams - directional price momentum, volume-weighted pressure dynamics, and intrabar development patterns - integrating them through weighted mathematical fusion to produce statistically normalized market flow measurements.
COMPREHENSIVE MATHEMATICAL FRAMEWORK
Component 1: Directional Flow Analysis
The directional component analyzes price momentum through three mathematical vectors:
Price Vector: p = C - O (intrabar directional bias)
Momentum Vector: m = C_t - C_{t-1} (bar-to-bar velocity)
Acceleration Vector: a = m_t - m_{t-1} (momentum rate of change)
Directional Signal Integration:
S_d = \text{sgn}(p) \cdot |p| + \text{sgn}(m) \cdot |m| \cdot 0.6 + \text{sgn}(a) \cdot |a| \cdot 0.3
The signum function preserves directional information while absolute values provide magnitude weighting. Coefficients create a hierarchy emphasizing intrabar movement (100%), momentum (60%), and acceleration (30%).
Final Directional Output: K_1 = S_d \cdot w_d where w_d is the directional weight parameter.
Component 2: Volume-Weighted Pressure Analysis
Volume Normalization: r_v = \frac{V_t}{\overline{V_n}} where \overline{V_n} represents the n-period simple moving average of volume.
Base Pressure Calculation: P_{base} = \Delta C \cdot r_v \cdot w_v where \Delta C = C_t - C_{t-1} and w_v is the velocity weighting factor.
Volume Confirmation Function:
f(r_v) = \begin{cases}
1.4 & \text{if } r_v > 1.2 \
0.7 & \text{if } r_v < 0.8 \
1.0 & \text{otherwise}
\end{cases}
Final Pressure Output: K_2 = P_{base} \cdot f(r_v)
Component 3: Intrabar Development Analysis
Bar Position Calculation: B = \frac{C - L}{H - L} when H - L > 0 , else B = 0.5
Development Signal Function:
S_{dev} = \begin{cases}
2(B - 0.5) & \text{if } B > 0.6 \text{ or } B < 0.4 \
0 & \text{if } 0.4 \leq B \leq 0.6
\end{cases}
Final Development Output: K_3 = S_{dev} \cdot 0.4
Master Integration and Statistical Normalization
Weighted Component Fusion: F_{raw} = 0.5K_1 + 0.35K_2 + 0.15K_3
Sensitivity Scaling: F_{master} = F_{raw} \cdot s where s is the sensitivity parameter.
Statistical Normalization Process:
Rolling Mean: \mu_F = \frac{1}{n}\sum_{i=0}^{n-1} F_{master,t-i}
Rolling Standard Deviation: \sigma_F = \sqrt{\frac{1}{n}\sum_{i=0}^{n-1} (F_{master,t-i} - \mu_F)^2}
Z-Score Computation: z = \frac{F_{master} - \mu_F}{\sigma_F}
Boundary Enforcement: z_{bounded} = \max(-3, \min(3, z))
Final Normalization: N = \frac{z_{bounded}}{3}
Flow Metrics Calculation:
Intensity: I = |z|
Strength Percentage: S = \min(100, I \times 33.33)
Extreme Detection: \text{Extreme} = I > 2.0
DETAILED INPUT PARAMETER SPECIFICATIONS
Sensitivity (0.1 - 3.0, Default: 1.0)
Global amplification multiplier applied to the master flow calculation. Functions as: F_{master} = F_{raw} \cdot s
Low Settings (0.1 - 0.5): Enhanced precision for subtle market movements. Optimal for low-volatility environments, scalping strategies, and early detection of minor directional shifts. Increases responsiveness but may amplify noise.
Moderate Settings (0.6 - 1.2): Balanced sensitivity for standard market conditions across multiple timeframes.
High Settings (1.3 - 3.0): Reduced sensitivity to minor fluctuations while emphasizing significant flow changes. Ideal for high-volatility assets, trending markets, and longer timeframes.
Directional Weighting (0.1 - 1.0, Default: 0.7)
Controls emphasis on price direction versus volume and positioning factors. Applied as: K_{1,weighted} = K_1 \times w_d
Lower Values (0.1 - 0.4): Reduces directional bias, favoring volume-confirmed moves. Optimal for ranging markets where momentum may generate false signals.
Higher Values (0.7 - 1.0): Amplifies directional signals from price vectors and acceleration. Ideal for trending conditions where directional momentum drives price action.
Velocity Weighting (0.1 - 1.0, Default: 0.6)
Scales volume-confirmed price change impact. Applied in: P_{base} = \Delta C \times r_v \times w_v
Lower Values (0.1 - 0.4): Dampens volume spike influence, focusing on sustained pressure patterns. Suitable for illiquid assets or news-sensitive markets.
Higher Values (0.8 - 1.0): Amplifies high-volume directional moves. Optimal for liquid markets where volume provides reliable confirmation.
Volume Length (3 - 20, Default: 5)
Defines lookback period for volume averaging: \overline{V_n} = \frac{1}{n}\sum_{i=0}^{n-1} V_{t-i}
Short Periods (3 - 7): Responsive to recent volume shifts, excellent for intraday analysis.
Long Periods (13 - 20): Smoother averaging, better for swing trading and higher timeframes.
DASHBOARD SYSTEM
Primary Flow Gauge
Bilaterally symmetric visualization displaying normalized flow direction and intensity:
Segment Calculation: n_{active} = \lfloor |N| \times 15 \rfloor
Left Fill: Bearish flow when N < -0.01
Right Fill: Bullish flow when N > 0.01
Neutral Display: Empty segments when |N| \leq 0.01
Visual Style Options:
Matrix: Digital blocks (▰/▱) for quantitative precision
Wave: Progressive patterns (▁▂▃▄▅▆▇█) showing flow buildup
Dots: LED-style indicators (●/○) with intensity scaling
Blocks: Modern squares (■/□) for professional appearance
Pulse: Progressive markers (⎯ to █) emphasizing intensity buildup
Flow Intensity Visualization
30-segment horizontal bar graph with mathematical fill logic:
Segment Fill: For i \in : filled if \frac{i}{29} \leq \frac{S}{100}
Color Coding System:
Orange (S > 66%): High intensity, strong directional conviction
Cyan (33% ≤ S ≤ 66%): Moderate intensity, developing bias
White (S < 33%): Low intensity, neutral conditions
Extreme Detection Indicators
Circular markers flanking the gauge with state-dependent illumination:
Activation: I > 2.0 \land |N| > 0.3
Bright Yellow: Active extreme conditions
Dim Yellow: Normal conditions
Metrics Display
Balance Value: Raw master flow output ( F_{master} ) showing absolute directional pressure
Z-Score Value: Statistical deviation ( z_{bounded} ) indicating historical context
Dynamic Narrative System
Context-sensitive interpretation based on mathematical thresholds:
Extreme Flow: I > 2.0 \land |N| > 0.6
Moderate Flow: 0.3 < |N| \leq 0.6
High Volatility: S > 50 \land |N| \leq 0.3
Neutral State: S \leq 50 \land |N| \leq 0.3
ALERT SYSTEM SPECIFICATIONS
Mathematical Trigger Conditions:
Extreme Bullish: I > 2.0 \land N > 0.6
Extreme Bearish: I > 2.0 \land N < -0.6
High Intensity: S > 80
Bullish Shift: N_t > 0.3 \land N_{t-1} \leq 0.3
Bearish Shift: N_t < -0.3 \land N_{t-1} \geq -0.3
TECHNICAL IMPLEMENTATION AND PERFORMANCE
Computational Architecture
The system employs efficient calculation methods minimizing processing overhead:
Single-pass mathematical operations for all components
Conditional visual rendering (executed only on final bar)
Optimized array operations using direct calculations
Real-Time Processing
The indicator updates continuously during bar formation, providing immediate feedback on changing market conditions. Statistical normalization ensures consistent interpretation across varying market regimes.
Market Applicability
Optimal performance in liquid markets with consistent volume patterns. May require parameter adjustment for:
Low-volume or after-hours sessions
News-driven market conditions
Highly volatile cryptocurrency markets
Ranging versus trending market environments
PRACTICAL APPLICATION FRAMEWORK
Market State Classification
This indicator functions as a comprehensive market condition assessment tool providing:
Trend Analysis: High intensity readings ( S > 66% ) with sustained directional bias indicate strong trending conditions suitable for momentum strategies.
Reversal Detection: Extreme readings ( I > 2.0 ) at key technical levels may signal potential trend exhaustion or reversal points.
Range Identification: Low intensity with neutral flow ( S < 33%, |N| < 0.3 ) suggests ranging market conditions suitable for mean reversion strategies.
Volatility Assessment: High intensity without clear directional bias indicates elevated volatility with conflicting pressures.
Integration with Trading Systems
The normalized output range facilitates integration with automated trading systems and position sizing algorithms. The statistical basis provides consistent interpretation across different market conditions and asset classes.
LIMITATIONS AND CONSIDERATIONS
This indicator combines established technical analysis methods and processes historical data without predicting future price movements. The system performs optimally in liquid markets with consistent volume patterns and may produce false signals in thin trading conditions or during news-driven market events. This indicator is provided for educational and analytical purposes only and does not constitute financial advice. Users should combine this analysis with proper risk management, position sizing, and additional confirmation methods before making any trading decisions. Past performance does not guarantee future results.
Note: The term "kernel" in this context refers to modular calculation components rather than mathematical kernel functions in the formal computational sense.
As quantitative analyst Ralph Vince noted: "The essence of successful trading lies not in predicting market direction, but in the systematic processing of market information and the disciplined management of probability distributions."
— Dskyz, Trade with insight. Trade with anticipation.
GC Checklist Signals (All Timeframes, v6)GC (COMEX Gold) checklist strategy with a 3:1 reward-to-risk to your training bot. It enforces your rules:
Heiken Ashi chart logic for color, wicks, and doji detection
100-EMA filter (only buys above / sells below)
Market structure: higher-low above EMA for buys; lower-high below EMA for sells (simple pivot check)
Clean pullback: at least 2 opposite-color candles; clean = no top wicks (buys) / no bottom wicks (sells)
Entry: on high-volume doji (body ≤ ~12% of range and volume ≥ last 1–3 candles), as soon as it closes
Stops: sell = above doji high; buy = below doji low
Volume Spread Candle█ Overview
Volume Spread Candle is a Solid tool for VSA (Volume Spread Analysis).
█ Setting
please put on VSCandle above the candle chart.
█ Features
Candle color reflect volume size.
Back ground color reflect Spread size.
Warning Volume is relatively large volume compared to the Volume flow (up volume MA - down volume MA).
Yellow square mark appears when Warning volume.
Volume Density is Volume / Spread.
Yellow circle mark appears when large Volume Density.
█ Usage
Abnormal Volume and Spread hint what about to happen.
6EMA/SMA/RMA + Smart Money Channels + ICT ConceptsSection 1: 6EMA/SMA/RMA + Forecasting
All 6 moving averages with their original parameters (lengths: 20, 100, 250, 75, 200, 300)
Moving average type selection (SMA, EMA, RMA)
Forecast functionality with Repetition and Linear Regression options
Source selection for each moving average
Forecast plotting with circles
Section 2: Smart Money Breakout Channels
Channel detection with normalization and box detection lengths
Volume analysis with different display modes (Volume, Comparison, Delta)
Nested channels option
Strong closes only feature
Bullish/bearish breakout signals
Volume visualization within channels
Section 3: ICT Concepts
Market Structure Shifts (MSS) and Break of Structure (BOS)
Order Blocks with swing lookback
Liquidity zones (buyside/sellside)
Fair Value Gaps (FVG) and Implied Fair Value Gaps (IFVG)
Volume Imbalances
NWOG/NDOG (New Week/Day Opening Gaps)
Displacement detection
Killzones (New York, London Open/Close, Asian sessions)
Fibonacci levels between various elements
CandelaCharts - Projections 📝 Overview
Projections turns a hand-picked swing window into clean, forward price levels. You pick a time range and an anchor (wick or body); the tool finds that window’s reference extremes (Level 0 & Level 1) and then projects directional extensions (e.g., −1, −2, −2.5, −4) in the chosen bias (Auto / Bullish / Bearish). It draws flat lines across the chart with optional labels so you can plan targets, fade zones, or continuation levels at a glance.
📦 Features
This section highlights the core capabilities you’ll rely on most.
Window-based engine — Define a start/end time; the script records open/high/low/close inside that window and builds levels from those extremes.
Two anchor styles — Project from Wick extremes (Hi/Lo) or Body extremes (max/min of OHLC at the high/low bars).
Directional bias — Auto (up if net up; doji resolves by wick dominance), or force Bullish/Bearish for one-sided extensions.
Default & Custom levels — Toggle pre-sets (−1/−2/−2.5/−4) or enter your own comma-separated list (decimals supported).
Readable drawings — Per-level colors (defaults) or unified bull/bear color (custom), with label size, line style, and width controls.
⚙️ Settings
Use these controls to define the window, pick the projection style, and customize the visuals.
Settings (Core)
From / To — Start and end timestamps of the capture window (everything is computed from this segment).
Bias — Auto / Bullish / Bearish. Guides which way negative levels extend (up for bull, down for bear).
Anchor — Wick uses Hi/Lo; Body uses the body extremes at the high/low bars.
Levels
Levels = Default — Enable any of −1, −2, −2.5, −4 and set each color.
Levels = Custom — Provide your own list (e.g., “−0.5, −1, −1.5, −3”) and pick Bullish/Bearish colors. (Custom uses one color per side.)
Style
Labels — Show/Hide the numeric level tag at the line’s right edge; choose label size.
Lines — Pick solid/dashed/dotted and line width.
⚡️ Showcase
Bearish Projection
Bullish Projection
📒 Usage
Follow these steps to set the window, generate levels, and turn them into a trade plan.
1) Mark the window — Set From/To around the swing you want to project (e.g., prior day, news impulse, weekly move).
2) Choose bias — Auto adapts; or lock Bullish/Bearish if you only want upside or downside projections.
3) Pick anchor — Wick = raw extremes; Body = more conservative reference. Body helps when single-print wicks distort levels.
4) Select levels — Toggle defaults or add a custom list. Negative values (−1, −2, …) extend beyond the reference extreme in the bias direction. (Level 0 and 1 are always drawn as the reference pair.)
5) Style it — Turn labels on, adjust size, and set line style/width for visibility on your timeframe.
6) Trade plan — Treat projections as reaction/continuation zones: scale out into −1/−2/−2.5, watch for fades back into the band, or ride continuation when price accepts beyond a level.
🚨 Alerts
There are no built-in alerts in this version.
⚠️ Disclaimer
Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.
HTF Books Lines for LTF Charts
⸻
📜 日本語説明文
HTF Books Lines for LTF Charts
このインジケーターは、ゴールドの5分足に1時間足のBooksラインを表示するために作成しました。
ドルストレートの通貨ペアであれば同様に利用可能だと思います。
上位足で検出したBooksライン(買い/売り)を下位足チャートに重ねて表示し、ラインが有効である間は強調表示、無効化された際には無効化ラインとして残すことも可能です。
いずれの時間足でも使用できるため、ご自身のトレードスタイルに合わせて設定を切り替えて検証してみてください。
⸻
📜 English Description
HTF Books Lines for LTF Charts
This indicator was originally created to display 1-hour Books lines on the 5-minute chart of Gold (XAUUSD).
It should also work on other USD-related pairs (major dollar crosses).
The indicator plots higher-timeframe Books lines (buy/sell) directly onto a lower-timeframe chart. Active lines are displayed with strong emphasis, and once invalidated they can optionally remain as inactive lines.
It can be applied to any timeframe combination, so please test and adjust it according to your own trading style.
⸻
Climax Absorption Engine [AlgoPoint]Overview
Have you ever noticed that during a sharp, fast-moving trend, the single candle with the highest volume often appears right at the end, just before the price reverses? This is no coincidence. It's the footprint of a Climax Event.
This indicator is designed to detect these critical moments of maximum panic (capitulation) and maximum euphoria (FOMO). These are the moments when retail traders are driven by emotion, creating a massive pool of liquidity. The "Climax Absorption Engine" identifies when Smart Money is likely absorbing this liquidity to enter large positions against the crowd, right before a potential reversal.
It's a tool built not just on mathematical formulas, but on the principles of market psychology and smart money activity.
How It Works: The 3-Step Logic
The indicator uses a sequential, three-step process to identify high-probability reversal setups:
1. Momentum Move Detection: First, the engine identifies a period of strong, directional momentum. It looks for a series of consecutive, same-colored candles and confirms that the move is backed by a steeply sloped moving average. This ensures we are only looking for climactic events at the end of a significant, non-random move.
2. Climax Candle Identification: Within this momentum move, the indicator scans for a candle with abnormally high volume—a volume spike that is significantly larger than the recent average. This candle is marked on your chart with a diamond shape and is identified as the Climax Candle. This is the point of peak emotion and the primary area of interest. No signal is generated yet.
3. Absorption & Reversal Confirmation: A climax is a warning, not a signal. The final signal is only triggered after the market confirms the reversal.
- For a BUY Signal: After a bearish (red) Climax Candle, the indicator waits for a subsequent green candle to close decisively above the midpoint of the Climax Candle. This confirms that the panic selling has been absorbed by buyers.
- For a SELL Signal: After a bullish (green) Climax Candle, it waits for a subsequent red candle to close decisively below the midpoint. This confirms that the euphoric buying has evaporated.
How to Interpret & Use This Indicator
- The Diamond Shape: A diamond shape on your chart is an early warning. It signifies that a climax event has occurred and the underlying trend is exhausted. This is the time to pay close attention and prepare for a potential reversal.
- The BUY/SELL Labels: These are the final, actionable signals. They appear only after the reversal has been confirmed by price action.
- A BUY signal suggests that capitulation selling is over, and buyers have absorbed the pressure.
- A SELL signal suggests that FOMO buying is over, and sellers are now in control.
Key Settings
- Momentum Detection: Adjust the number of consecutive bars and the EMA slope required to define a valid momentum move.
- Climax Detection: Fine-tune the sensitivity of the volume spike detection using the Volume Multiplier. Higher values will find only the most extreme events.
- Confirmation Window: Define how many bars the indicator should wait for a reversal candle after a climax event before the setup is cancelled.
RenKagi Fusion: Aura & SMA Clash IndicatorRenKagi Fusion: Aura & SMA Clash Indicator
Welcome to the RenKagi Fusion Indicator – a powerful, customizable tool that blends the strengths of Renko and Kagi charts to provide noise-filtered trend insights, enhanced with visual Aura effects and SMA (Simple Moving Average) crossover signals. Designed for traders seeking a unique edge in trend detection and reversal identification, this indicator combines traditional charting techniques with modern visualizations to help you navigate markets more effectively. Whether you're trading stocks, forex, or crypto, RenKagi Fusion offers a clean, actionable overview of market dynamics.
Key Features
RenKagi Line (Weighted Fusion of Renko and Kagi): The core of the indicator is the RenKagi line, a weighted average of Renko (brick-based trend filtering) and Kagi (reversal-focused line charts). Users can adjust the weight (default: 60% Renko, 40% Kagi) to prioritize stability or sensitivity. This fusion reduces market noise while highlighting key price movements.
Trend Scoring System: Calculates strength scores for Renko, Kagi, and RenKagi (capped at 20 points, converted to percentages). Scores increase with trend continuation and reset on reversals, giving a quantitative measure of momentum.
Aura Effects (Optional): Visual "glow" around lines based on score percentage – higher scores mean more opaque and thicker auras, adding a dynamic layer to trend visualization.
SMA Clash (Crossover Detection): Monitors daily SMA50, SMA100, and SMA200 for golden/death crosses (SMA50 crossing above/below longer SMAs) and RenKagi-SMA crossovers. These are displayed in a persistent info table for quick reference.
Customizable Visuals: Toggle lines, boxes, shapes, auras, and labels. Background coloring based on selected source (Renko, Kagi, or RenKagi) for intuitive trend bias.
Info Table: A configurable table (position and colors adjustable) summarizing scores, directions, cross states, brick size (with type), Kagi reversal (with type), and weights. No clutter – all in one place.
Alert Conditions: Built-in alerts for direction changes (Renko, Kagi, RenKagi), SMA crossovers, and golden/death crosses – perfect for real-time notifications.
How It Works
Renko Logic: Builds bricks based on user-selected type (Traditional fixed size, ATR dynamic, or Percentage). Scores build as trends persist, resetting on reversals.
Kagi Logic: Line reverses on thresholds (Traditional, ATR, or Percentage), scoring continuous moves.
RenKagi Calculation: Weighted average: (renkoPrice * renkoWeight + kagiLine * (100 - renkoWeight)) / 100. Score is a blend of individual scores.
SMA Integration: Daily timeframe SMAs for reliable long-term signals. Crossovers trigger alerts and update table states persistently until reversed.
Advantages for Traders
Noise Reduction: By fusing Renko's block structure with Kagi's reversal focus, it filters out minor fluctuations, helping identify strong trends early.
Versatility: Fully customizable – adjust weights, types, and visuals to fit any market or timeframe. Ideal for swing trading, trend following, or scalping.
Visual Clarity: Aura and background coloring provide at-a-glance insights, while the table consolidates data without overwhelming the chart.
Actionable Signals: Golden/Death crosses and direction changes offer clear entry/exit points, backed by alerts for timely execution.
Performance Optimization: Limits on lines/labels/boxes (500 each) ensure smooth operation on large datasets.
Usage Tips
Start with default settings for balanced performance.
Use in higher timeframes for trend confirmation or lower for intraday signals.
Combine with your favorite strategies – e.g., buy on RenKagi upward cross with SMA50 and golden cross confirmation.
Test on historical data to optimize weights and thresholds.
Note: This indicator is for educational and informational purposes only. Past performance is not indicative of future results. Always conduct your own analysis and use risk management. No financial advice is provided.
If you find this useful, please like, comment, or share your feedback!
DZ/SZ - HFM by MamaRight-Empty Wick Zones (MTF) draws Supply/Demand zones from the remaining wick of adjacent opposite-color candles (Classic & Non-classic rules). Zones extend right only through empty space and stop at the first touching candle. Multi-TF scan (H1/H4/1D/1W/1M) with TF-colored boxes and labels showing Demand/Supply + H/L.
Demand (red → green, adjacent):
Classic: if the red candle’s lower wick is longer than the green’s → zone = (the “excess” red wick).
Non-classic: if the red’s lower wick is shorter or equal → zone = (use the longer green wick).
Supply (green → red, adjacent):
Classic: if the green candle’s upper wick is longer than the red’s → zone = (the “excess” green wick).
Non-classic: if the green’s upper wick is shorter or equal → zone = (use the longer red wick).
After a zone is created, the box extends right and terminates at the very first bar whose price range (body or wick) overlaps the zone → ensures the plotted area is genuinely right-empty.
What you see
Zone boxes with distinct colors per timeframe (e.g., H1/H4/1D/1W/1M).
Optional labels on each box: H4 Demand / H1 Supply, plus H/L prices of the zone.
Labels can sit at the left edge or follow the right edge of the box.
Inputs
Toggles: Demand Classic / Demand Non-classic / Supply Classic / Supply Non-classic.
Timeframes to scan: H1, H4, 1D, 1W, 1M.
Min zone thickness (price): minimum height of a zone (in price units).
Initial right extension (bars): initial box length; the script auto-cuts at the first touch.
Show labels / place labels at the right edge.
How to use (suggestion)
Use higher TF (e.g., 1D) for bias and lower TFs (H1/H4) for execution zones.
Keep only the rule set (Classic/Non-classic) that matches your playbook.
Treat zones as areas of interest—wait for your own confirmations (e.g., swing rejection, wick re-entry, structure shift, volume cues) and manage risk accordingly.
Notes
Because zones are sourced from higher TFs via request.security, the drawing can update intrabar; a zone is final once the source TF bar closes.
Min zone thickness uses price units (e.g., on XAUUSD, 1.00 ≈ $1).
This tool is an analytical aid, not financial advice or an entry/exit signal.
อินดิเคเตอร์ DZ/SZ - HFM by Mama ใช้หา Demand/Supply zone จาก “ไส้ที่เหลือ” ของ คู่แท่งสีตรงข้ามที่ติดกัน แล้ววาดเป็นกล่อง ยืดไปทางขวาเฉพาะช่วงที่ว่าง และ หยุดตรงแท่งแรกที่เข้ามาแตะโซน รองรับหลาย Timeframe (H1/H4/1D/1W/1M) พร้อมสีแยก TF และป้ายกำกับ Demand/Supply + H/L ของโซน
รายละเอียดการทำงาน (ไทย)
แนวคิดหลัก
Demand: เลือกคู่ แดง→เขียว ที่ “ติดกัน”
Classic: ถ้า ไส้ล่าง ของแท่งแดงยาวกว่าแท่งเขียว → โซน =
Non-classic: ถ้า ไส้ล่าง ของแท่งแดงสั้นกว่าหรือเท่าเขียว → โซน =
Supply: เลือกคู่ เขียว→แดง ที่ “ติดกัน”
Classic: ถ้า ไส้บน ของแท่งเขียวยาวกว่าแท่งแดง → โซน =
Non-classic: ถ้า ไส้บน ของแท่งเขียวสั้นกว่าหรือเท่าแดง → โซน =
เมื่อสร้างโซนแล้ว กล่องจะ ยืดทางขวา ไปเรื่อย ๆ และ หยุดทันทีเมื่อมีแท่งแรกที่ช่วงราคา (ไส้หรือตัวแท่ง) ทับซ้อนกับโซน ⇒ ได้ “พื้นที่ขวาว่าง” ตามโจทย์
สิ่งที่แสดงบนกราฟ
กล่องโซนสีตาม Timeframe (เช่น H1=ฟ้า, H4=เขียว, 1D=ส้ม, 1W=ม่วง, 1M=เทา)
Label ที่มุมกล่อง: H4 Demand / H1 Supply + ราคาของ High/Low ของโซน
(เลือกวาง ซ้าย หรือ ขอบขวา ของกล่องได้ในตั้งค่า)
ตัวเลือกสำคัญใน Settings
เปิด/ปิด: Demand Classic / Demand Non-classic / Supply Classic / Supply Non-classic
เลือก TF ที่จะสแกน: H1, H4, 1D, 1W, 1M
Min zone thickness (price): กำหนด “ความหนา” ขั้นต่ำของโซน (หน่วยเป็นราคา เช่น XAUUSD = ดอลลาร์)
Initial right extension (bars): ความยาวยืดเริ่มต้น (อินดี้จะตัดให้สั้นลงเองเมื่อมีแท่งมาแตะ)
แสดง Label บนโซน และ วาง Label ที่ขอบขวากล่อง
วิธีใช้แนะนำ
เลือก TF ที่ต้องการ (เช่น ให้ H1/H4 เป็นโซนเทรดละเอียด และ 1D ใช้กรองทิศ)
เปิดเฉพาะโหมด (Classic/Non-classic) ที่ตรงกับแนวคิดการเทรดของคุณ
ใช้โซนเป็นบริเวณ “สนใจ” แล้วรอพฤติกรรมราคา/สัญญาณยืนยันเสริม (เช่น สวิงกลับ, rejection wick, โวลลุ่ม, หรือโครงสร้างจบคลื่น)
หมายเหตุสำคัญ
อินดี้ใช้ข้อมูลข้าม TF; สัญญาณจาก TF สูง อาจเปลี่ยนระหว่างแท่งยังไม่ปิด (ลักษณะ intrabar update) โซนจะ “นิ่ง” เมื่อแท่งของ TF ต้นทาง ปิดแล้ว
หน่วยของ Min zone thickness เป็น หน่วยราคา ไม่ใช่ pips (XAUUSD: 1.00 = $1)
อินดี้ไม่ได้ให้สัญญาณเข้า–ออกอัตโนมัติ ควรใช้ร่วมกับแผนเทรดและการจัดการความเสี่ยง
Mayfair FX Scalper V-10 Price Action + SMC//@version=5
indicator("Mayfair FX Scalper V-10 Price Action + SMC", overlay=true)
// === INPUTS ===
rsiLength = input.int(14, title="RSI Length")
overbought = input.float(73, title="SELL Level")
oversold = input.float(31, title="BUY Level")
rsiSrc = input.source(open, title="RSI Source")
// === Color Inputs ===
entryLineColor = input.color(color.white, title="entry Label Color")
entryLabelColor = input.color(color.white, title="entry Lable Color")
slLineColor = input.color(color.red, title="Stop Loss Line Color")
slLabelColor = input.color(color.red, title="Stop Loss Label Color")
tpLineColor = input.color(color.blue, title="Take Profit Line Color")
tpLabelColor = input.color(color.blue, title="Take Profit Color")
entryTextColor = input.color(color.rgb(0, 0, 0) , title="entry Text Color")
slTextColor = input.color(color.white, title="Stop Lose Color")
tpTextColor = input.color(color.white, title="Take Profit Text Color")
//indicator("Author Info Display"
// Create table
var table infoTable = table.new(position.top_right, 2, 6, bgcolor=color.new(#000000, 1), border_width=1)
if barstate.islast
table.cell(infoTable, 0, 0, "Author:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 0, "MR WOW", text_color=color.rgb(255, 251, 0), text_size=size.large)
table.cell(infoTable, 0, 1, "YouTube:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 1, "www.youtube.com/@iammrwow", text_color=color.rgb(255, 251, 0), text_size=size.small)
table.cell(infoTable, 0, 3, "Website:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 3, "www.mrwowea.com", text_color=color.rgb(255, 251, 0), text_size=size.small)
// === RSI CALCULATION ===
rsi = ta.rsi(rsiSrc, rsiLength)
rawBuySignal = rsi < oversold
rawSellSignal = rsi > overbought
// === Confirmed Signals ===
isBullish = close > open
isBearish = close < open
newBuy = rawBuySignal and isBullish and close > open == false
newSell = rawSellSignal and isBearish and close < open == false
// === Trade State Variables ===
var bool inPosition = false
var bool isBuy = false
var float entryPrice = na
var float slPrice = na
var float tp1Price = na
var float tp2Price = na
var float tp3Price = na
var int entryBarIndex = na
var label labels = array.new()
var line lines = array.new()
// === Instrument & Timeframe SL/TP Setup ===
isGold = str.contains(syminfo.ticker, "XAU") or str.contains(syminfo.ticker, "GOLD")
instrumentType = syminfo.type == "crypto" ? "Crypto" : isGold ? "Gold" : syminfo.currency == "JPY" ? "JPY" : "Forex"
tf = timeframe.period
slPipsGold = tf == "1" ? 30 : tf == "3" ? 45 : tf == "5" ? 50 : tf == "15" ? 60 : 70
slPipsCrypto = tf == "1" ? 5 : tf == "3" ? 8 : tf == "5" ? 12 : tf == "15" ? 15 : 10
slPipsForex = tf == "1" ? 6 : tf == "3" ? 9 : tf == "5" ? 11 : tf == "15" ? 15 : 15
gold_slDist = 0.1 * slPipsGold
gold_tp1Dist = gold_slDist
gold_tp2Dist = gold_slDist * 2
gold_tp3Dist = gold_slDist * 3
pipSize = instrumentType == "Crypto" ? 1.0 : instrumentType == "Gold" or instrumentType == "JPY" ? 0.01 : 0.0001
slPips = instrumentType == "Crypto" ? slPipsCrypto : instrumentType == "Gold" ? slPipsGold : slPipsForex
slDist = slPips * pipSize
tp1Dist = slDist
tp2Dist = slDist * 2
tp3Dist = slDist * 3
// === Draw Line & Label ===
drawLine(y, txt, col, lblCol, extendToCurrent) =>
int lineEnd = extendToCurrent ? bar_index : entryBarIndex + 2
array.push(lines, line.new(entryBarIndex, y, lineEnd, y, color=col, width=2, extend=extend.none))
textCol = str.contains(txt, "Entry") ? entryTextColor : str.contains(txt, "Stop") ? slTextColor : tpTextColor
array.push(labels, label.new(lineEnd, y, txt, style=label.style_label_left, color=color.new(lblCol, 0), textcolor=textCol, size=size.small))
// === Check Exit ===
slHit = inPosition and ((isBuy and low <= slPrice) or (not isBuy and high >= slPrice))
tp3Hit = inPosition and ((isBuy and high >= tp3Price) or (not isBuy and low <= tp3Price))
shouldExit = slHit or tp3Hit
if shouldExit
for l in labels
label.delete(l)
array.clear(labels)
for ln in lines
line.delete(ln)
array.clear(lines)
inPosition := false
entryPrice := na
slPrice := na
tp1Price := na
tp2Price := na
tp3Price := na
entryBarIndex := na
// === Confirmed Signal with No Position ===
confirmedBuy = not inPosition and newBuy
confirmedSell = not inPosition and newSell
// === Signal Markers ===
plotshape(series=confirmedBuy, location=location.belowbar, color=color.rgb(33, 150, 243), style=shape.triangleup, text="BUY", textcolor=color.rgb(33, 150, 243))
plotshape(series=confirmedSell, location=location.abovebar, color=color.rgb(254, 254, 255), style=shape.triangledown, text="SELL", textcolor=color.rgb(239, 238, 247))
// === Entry Execution ===
if confirmedBuy or confirmedSell
entryPrice := close
entryBarIndex := bar_index
isBuy := confirmedBuy
inPosition := true
if isGold
slPrice := isBuy ? entryPrice - gold_slDist : entryPrice + gold_slDist
tp1Price := isBuy ? entryPrice + gold_tp1Dist : entryPrice - gold_tp1Dist
tp2Price := isBuy ? entryPrice + gold_tp2Dist : entryPrice - gold_tp2Dist
tp3Price := isBuy ? entryPrice + gold_tp3Dist : entryPrice - gold_tp3Dist
else
slPrice := isBuy ? entryPrice - slDist : entryPrice + slDist
tp1Price := isBuy ? entryPrice + tp1Dist : entryPrice - tp1Dist
tp2Price := isBuy ? entryPrice + tp2Dist : entryPrice - tp2Dist
tp3Price := isBuy ? entryPrice + tp3Dist : entryPrice - tp3Dist
drawLine(entryPrice, "Entry Price - After Candle Above Entry Price Then Place Trade: " + str.tostring(entryPrice), entryLineColor, entryLabelColor, false)
drawLine(slPrice, "Stop Loss: " + str.tostring(slPrice), slLineColor, slLabelColor, false)
drawLine(tp1Price, "(1:1) Take Profit: " + str.tostring(tp1Price), tpLineColor, tpLabelColor, false)
drawLine(tp2Price, "(2:1) Take Profit: " + str.tostring(tp2Price), tpLineColor, tpLabelColor, false)
drawLine(tp3Price, "(3:1) Take Profit: " + str.tostring(tp3Price), tpLineColor, tpLabelColor, false)
// === Update TP/SL Lines if Still in Trade ===
if inPosition and not (confirmedBuy or confirmedSell)
for ln in lines
line.delete(ln)
array.clear(lines)
for l in labels
label.delete(l)
array.clear(labels)
drawLine(entryPrice, "After Candle Closed Above Entry Line Buy & Below Sell :Entry Price-" + str.tostring(entryPrice), entryLineColor, entryLabelColor, true)
drawLine(slPrice, "Stop Loss: " + str.tostring(slPrice), slLineColor, slLabelColor, true)
drawLine(tp1Price, "(1:1) Take Profit: " + str.tostring(tp1Price), tpLineColor, tpLabelColor, true)
drawLine(tp2Price, "(2:1) Take Profit: " + str.tostring(tp2Price), tpLineColor, tpLabelColor, true)
drawLine(tp3Price, "(3:1) Take Profit: " + str.tostring(tp3Price), tpLineColor, tpLabelColor, true)
// === Bollinger Bands Inputs ===
bb_length = input.int(20, title="SMA & StdDev Length")
src = input.source(close, title="Source")
// === Bollinger Band Colors ===
color_upper_2_3 = input.color(color.new(#0db107, 64), title="Upper Band 2–3 Color")
color_upper_3_4 = input.color(color.new(#05c41f, 58), title="Upper Band 3–4 Color")
color_lower_2_3 = input.color(color.new(#bdbc9d, 80), title="Lower Band 2–3 Color")
color_lower_3_4 = input.color(color.new(#e9e6bf, 63), title="Lower Band 3–4 Color")
// === Bollinger Band Calculations ===
sma = ta.sma(src, bb_length)
stdev = ta.stdev(src, bb_length)
bb2_upper = sma + 2 * stdev
bb2_lower = sma - 2 * stdev
bb3_upper = sma + 3 * stdev
bb3_lower = sma - 3 * stdev
bb4_upper = sma + 4 * stdev
bb4_lower = sma - 4 * stdev
// === Hidden Plots for Fill ===
p_bb2_upper = plot(bb2_upper, color=na)
p_bb3_upper = plot(bb3_upper, color=na)
p_bb4_upper = plot(bb4_upper, color=na)
p_bb2_lower = plot(bb2_lower, color=na)
p_bb3_lower = plot(bb3_lower, color=na)
p_bb4_lower = plot(bb4_lower, color=na)
// === Band Zone Fills ===
fill(p_bb2_upper, p_bb3_upper, color=color_upper_2_3)
fill(p_bb3_upper, p_bb4_upper, color=color_upper_3_4)
fill(p_bb2_lower, p_bb3_lower, color=color_lower_2_3)
fill(p_bb3_lower, p_bb4_lower, color=color_lower_3_4)
//SMc
BULLISH_LEG = 1
BEARISH_LEG = 0
BULLISH = +1
BEARISH = -1
GREEN = #9c9c9c
RED = #9c9c9c
BLUE = #9c9c9c
GRAY = #ffffff
MONO_BULLISH = #b2b5be
MONO_BEARISH = #5d606b
HISTORICAL = 'Historical'
PRESENT = 'Present'
COLORED = 'Colored'
MONOCHROME = 'Monochrome'
ALL = 'All'
BOS = 'BOS'
CHOCH = 'CHoCH'
TINY = size.tiny
SMALL = size.small
NORMAL = size.normal
ATR = 'Atr'
RANGE = 'Cumulative Mean Range'
CLOSE = 'Close'
HIGHLOW = 'High/Low'
SOLID = '⎯⎯⎯'
DASHED = '----'
DOTTED = '····'
SMART_GROUP = 'Smart Money Concepts'
INTERNAL_GROUP = 'Real Time Internal Structure'
SWING_GROUP = 'Real Time Swing Structure'
BLOCKS_GROUP = 'Order Blocks'
EQUAL_GROUP = 'EQH/EQL'
GAPS_GROUP = 'Fair Value Gaps'
LEVELS_GROUP = 'Highs & Lows MTF'
ZONES_GROUP = 'Premium & Discount Zones'
modeTooltip = 'Allows to display historical Structure or only the recent ones'
styleTooltip = 'Indicator color theme'
showTrendTooltip = 'Display additional candles with a color reflecting the current trend detected by structure'
showInternalsTooltip = 'Display internal market structure'
internalFilterConfluenceTooltip = 'Filter non significant internal structure breakouts'
showStructureTooltip = 'Display swing market Structure'
showSwingsTooltip = 'Display swing point as labels on the chart'
showHighLowSwingsTooltip = 'Highlight most recent strong and weak high/low points on the chart'
showInternalOrderBlocksTooltip = 'Display internal order blocks on the chart Number of internal order blocks to display on the chart'
showSwingOrderBlocksTooltip = 'Display swing order blocks on the chart Number of internal swing blocks to display on the chart'
orderBlockFilterTooltip = 'Method used to filter out volatile order blocks It is recommended to use the cumulative mean range method when a low amount of data is available'
orderBlockMitigationTooltip = 'Select what values to use for order block mitigation'
showEqualHighsLowsTooltip = 'Display equal highs and equal lows on the chart'
equalHighsLowsLengthTooltip = 'Number of bars used to confirm equal highs and equal lows'
equalHighsLowsThresholdTooltip = 'Sensitivity threshold in a range (0, 1) used for the detection of equal highs & lows Lower values will return fewer but more pertinent results'
showFairValueGapsTooltip = 'Display fair values gaps on the chart'
fairValueGapsThresholdTooltip = 'Filter out non significant fair value gaps'
fairValueGapsTimeframeTooltip = 'Fair value gaps timeframe'
fairValueGapsExtendTooltip = 'Determine how many bars to extend the Fair Value Gap boxes on chart'
showPremiumDiscountZonesTooltip = 'Display premium, discount, and equilibrium zones on chart'
modeInput = input.string( HISTORICAL, 'Mode', group = SMART_GROUP, tooltip = modeTooltip, options = )
styleInput = input.string( COLORED, 'Style', group = SMART_GROUP, tooltip = styleTooltip,options = )
showTrendInput = input( false, 'Color Candles', group = SMART_GROUP, tooltip = showTrendTooltip)
showInternalsInput = input( true, 'Show Internal Structure', group = INTERNAL_GROUP, tooltip = showInternalsTooltip)
showInternalBullInput = input.string( ALL, 'Bullish Structure', group = INTERNAL_GROUP, inline = 'ibull', options = )
internalBullColorInput = input( GREEN, '', group = INTERNAL_GROUP, inline = 'ibull')
showInternalBearInput = input.string( ALL, 'Bearish Structure' , group = INTERNAL_GROUP, inline = 'ibear', options = )
internalBearColorInput = input( RED, '', group = INTERNAL_GROUP, inline = 'ibear')
internalFilterConfluenceInput = input( false, 'Confluence Filter', group = INTERNAL_GROUP, tooltip = internalFilterConfluenceTooltip)
internalStructureSize = input.string( TINY, 'Internal Label Size', group = INTERNAL_GROUP, options = )
showStructureInput = input( true, 'Show Swing Structure', group = SWING_GROUP, tooltip = showStructureTooltip)
showSwingBullInput = input.string( ALL, 'Bullish Structure', group = SWING_GROUP, inline = 'bull', options = )
swingBullColorInput = input( GREEN, '', group = SWING_GROUP, inline = 'bull')
showSwingBearInput = input.string( ALL, 'Bearish Structure', group = SWING_GROUP, inline = 'bear', options = )
swingBearColorInput = input( RED, '', group = SWING_GROUP, inline = 'bear')
swingStructureSize = input.string( SMALL, 'Swing Label Size', group = SWING_GROUP, options = )
showSwingsInput = input( false, 'Show Swings Points', group = SWING_GROUP, tooltip = showSwingsTooltip,inline = 'swings')
swingsLengthInput = input.int( 50, '', group = SWING_GROUP, minval = 10, inline = 'swings')
showHighLowSwingsInput = input( true, 'Show Strong/Weak High/Low',group = SWING_GROUP, tooltip = showHighLowSwingsTooltip)
showInternalOrderBlocksInput = input( true, 'Internal Order Blocks' , group = BLOCKS_GROUP, tooltip = showInternalOrderBlocksTooltip, inline = 'iob')
internalOrderBlocksSizeInput = input.int( 5, '', group = BLOCKS_GROUP, minval = 1, maxval = 20, inline = 'iob')
showSwingOrderBlocksInput = input( false, 'Swing Order Blocks', group = BLOCKS_GROUP, tooltip = showSwingOrderBlocksTooltip, inline = 'ob')
swingOrderBlocksSizeInput = input.int( 5, '', group = BLOCKS_GROUP, minval = 1, maxval = 20, inline = 'ob')
orderBlockFilterInput = input.string( 'Atr', 'Order Block Filter', group = BLOCKS_GROUP, tooltip = orderBlockFilterTooltip, options = )
orderBlockMitigationInput = input.string( HIGHLOW, 'Order Block Mitigation', group = BLOCKS_GROUP, tooltip = orderBlockMitigationTooltip, options = )
internalBullishOrderBlockColor = input.color(color.new(#808080, 80), 'Internal Bullish OB', group = BLOCKS_GROUP)
internalBearishOrderBlockColor = input.color(color.new(#808080, 80), 'Internal Bearish OB', group = BLOCKS_GROUP)
swingBullishOrderBlockColor = input.color(color.new(#808080, 80), 'Bullish OB', group = BLOCKS_GROUP)
swingBearishOrderBlockColor = input.color(color.new(#808080, 80), 'Bearish OB', group = BLOCKS_GROUP)
showEqualHighsLowsInput = input( true, 'Equal High/Low', group = EQUAL_GROUP, tooltip = showEqualHighsLowsTooltip)
equalHighsLowsLengthInput = input.int( 3, 'Bars Confirmation', group = EQUAL_GROUP, tooltip = equalHighsLowsLengthTooltip, minval = 1)
equalHighsLowsThresholdInput = input.float( 0.1, 'Threshold', group = EQUAL_GROUP, tooltip = equalHighsLowsThresholdTooltip, minval = 0, maxval = 0.5, step = 0.1)
equalHighsLowsSizeInput = input.string( TINY, 'Label Size', group = EQUAL_GROUP, options = )
showFairValueGapsInput = input( false, 'Fair Value Gaps', group = GAPS_GROUP, tooltip = showFairValueGapsTooltip)
fairValueGapsThresholdInput = input( true, 'Auto Threshold', group = GAPS_GROUP, tooltip = fairValueGapsThresholdTooltip)
fairValueGapsTimeframeInput = input.timeframe('', 'Timeframe', group = GAPS_GROUP, tooltip = fairValueGapsTimeframeTooltip)
fairValueGapsBullColorInput = input.color(color.new(#00ff68, 70), 'Bullish FVG' , group = GAPS_GROUP)
fairValueGapsBearColorInput = input.color(color.new(#ff0008, 70), 'Bearish FVG' , group = GAPS_GROUP)
fairValueGapsExtendInput = input.int( 1, 'Extend FVG', group = GAPS_GROUP, tooltip = fairValueGapsExtendTooltip, minval = 0)
showDailyLevelsInput = input( false, 'Daily', group = LEVELS_GROUP, inline = 'daily')
dailyLevelsStyleInput = input.string( SOLID, '', group = LEVELS_GROUP, inline = 'daily', options = )
dailyLevelsColorInput = input( BLUE, '', group = LEVELS_GROUP, inline = 'daily')
showWeeklyLevelsInput = input( false, 'Weekly', group = LEVELS_GROUP, inline = 'weekly')
weeklyLevelsStyleInput = input.string( SOLID, '', group = LEVELS_GROUP, inline = 'weekly', options = )
weeklyLevelsColorInput = input( BLUE, '', group = LEVELS_GROUP, inline = 'weekly')
showMonthlyLevelsInput = input( false, 'Monthly', group = LEVELS_GROUP, inline = 'monthly')
monthlyLevelsStyleInput = input.string( SOLID, '', group = LEVELS_GROUP, inline = 'monthly', options = )
monthlyLevelsColorInput = input( BLUE, '', group = LEVELS_GROUP, inline = 'monthly')
showPremiumDiscountZonesInput = input( false, 'Premium/Discount Zones', group = ZONES_GROUP , tooltip = showPremiumDiscountZonesTooltip)
premiumZoneColorInput = input.color( RED, 'Premium Zone', group = ZONES_GROUP)
equilibriumZoneColorInput = input.color( GRAY, 'Equilibrium Zone', group = ZONES_GROUP)
discountZoneColorInput = input.color( GREEN, 'Discount Zone', group = ZONES_GROUP)
//---------------------------------------------------------------------------------------------------------------------}
//DATA STRUCTURES & VARIABLES
//---------------------------------------------------------------------------------------------------------------------{
// @type UDT representing alerts as bool fields
// @field internalBullishBOS internal structure custom alert
// @field internalBearishBOS internal structure custom alert
// @field internalBullishCHoCH internal structure custom alert
// @field internalBearishCHoCH internal structure custom alert
// @field swingBullishBOS swing structure custom alert
// @field swingBearishBOS swing structure custom alert
// @field swingBullishCHoCH swing structure custom alert
// @field swingBearishCHoCH swing structure custom alert
// @field internalBullishOrderBlock internal order block custom alert
// @field internalBearishOrderBlock internal order block custom alert
// @field swingBullishOrderBlock swing order block custom alert
// @field swingBearishOrderBlock swing order block custom alert
// @field equalHighs equal high low custom alert
// @field equalLows equal high low custom alert
// @field bullishFairValueGap fair value gap custom alert
// @field bearishFairValueGap fair value gap custom alert
type alerts
bool internalBullishBOS = false
bool internalBearishBOS = false
bool internalBullishCHoCH = false
bool internalBearishCHoCH = false
bool swingBullishBOS = false
bool swingBearishBOS = false
bool swingBullishCHoCH = false
bool swingBearishCHoCH = false
bool internalBullishOrderBlock = false
bool internalBearishOrderBlock = false
bool swingBullishOrderBlock = false
bool swingBearishOrderBlock = false
bool equalHighs = false
bool equalLows = false
bool bullishFairValueGap = false
bool bearishFairValueGap = false
// @type UDT representing last swing extremes (top & bottom)
// @field top last top swing price
// @field bottom last bottom swing price
// @field barTime last swing bar time
// @field barIndex last swing bar index
// @field lastTopTime last top swing time
// @field lastBottomTime last bottom swing time
type trailingExtremes
float top
float bottom
int barTime
int barIndex
int lastTopTime
int lastBottomTime
// @type UDT representing Fair Value Gaps
// @field top top price
// @field bottom bottom price
// @field bias bias (BULLISH or BEARISH)
// @field topBox top box
// @field bottomBox bottom box
type fairValueGap
float top
float bottom
int bias
box topBox
box bottomBox
// @type UDT representing trend bias
// @field bias BULLISH or BEARISH
type trend
int bias
// @type UDT representing Equal Highs Lows display
// @field l_ine displayed line
// @field l_abel displayed label
type equalDisplay
line l_ine = na
label l_abel = na
// @type UDT representing a pivot point (swing point)
// @field currentLevel current price level
// @field lastLevel last price level
// @field crossed true if price level is crossed
// @field barTime bar time
// @field barIndex bar index
type pivot
float currentLevel
float lastLevel
bool crossed
int barTime = time
int barIndex = bar_index
// @type UDT representing an order block
// @field barHigh bar high
// @field barLow bar low
// @field barTime bar time
// @field bias BULLISH or BEARISH
type orderBlock
float barHigh
float barLow
int barTime
int bias
// @variable current swing pivot high
var pivot swingHigh = pivot.new(na,na,false)
// @variable current swing pivot low
var pivot swingLow = pivot.new(na,na,false)
// @variable current internal pivot high
var pivot internalHigh = pivot.new(na,na,false)
// @variable current internal pivot low
var pivot internalLow = pivot.new(na,na,false)
// @variable current equal high pivot
var pivot equalHigh = pivot.new(na,na,false)
// @variable current equal low pivot
var pivot equalLow = pivot.new(na,na,false)
// @variable swing trend bias
var trend swingTrend = trend.new(0)
// @variable internal trend bias
var trend internalTrend = trend.new(0)
// @variable equal high display
var equalDisplay equalHighDisplay = equalDisplay.new()
// @variable equal low display
var equalDisplay equalLowDisplay = equalDisplay.new()
// @variable storage for fairValueGap UDTs
var array fairValueGaps = array.new()
// @variable storage for parsed highs
var array parsedHighs = array.new()
// @variable storage for parsed lows
var array parsedLows = array.new()
// @variable storage for raw highs
var array highs = array.new()
// @variable storage for raw lows
var array lows = array.new()
// @variable storage for bar time values
var array times = array.new()
// @variable last trailing swing high and low
var trailingExtremes trailing = trailingExtremes.new()
// @variable storage for orderBlock UDTs (swing order blocks)
var array swingOrderBlocks = array.new()
// @variable storage for orderBlock UDTs (internal order blocks)
var array internalOrderBlocks = array.new()
// @variable storage for swing order blocks boxes
var array swingOrderBlocksBoxes = array.new()
// @variable storage for internal order blocks boxes
var array internalOrderBlocksBoxes = array.new()
// @variable color for swing bullish structures
var swingBullishColor = styleInput == MONOCHROME ? MONO_BULLISH : swingBullColorInput
// @variable color for swing bearish structures
var swingBearishColor = styleInput == MONOCHROME ? MONO_BEARISH : swingBearColorInput
// @variable color for bullish fair value gaps
var fairValueGapBullishColor = styleInput == MONOCHROME ? color.new(MONO_BULLISH,70) : fairValueGapsBullColorInput
// @variable color for bearish fair value gaps
var fairValueGapBearishColor = styleInput == MONOCHROME ? color.new(MONO_BEARISH,70) : fairValueGapsBearColorInput
// @variable color for premium zone
var premiumZoneColor = styleInput == MONOCHROME ? MONO_BEARISH : premiumZoneColorInput
// @variable color for discount zone
var discountZoneColor = styleInput == MONOCHROME ? MONO_BULLISH : discountZoneColorInput
// @variable bar index on current script iteration
varip int currentBarIndex = bar_index
// @variable bar index on last script iteration
varip int lastBarIndex = bar_index
// @variable alerts in current bar
alerts currentAlerts = alerts.new()
// @variable time at start of chart
var initialTime = time
// we create the needed boxes for displaying order blocks at the first execution
if barstate.isfirst
if showSwingOrderBlocksInput
for index = 1 to swingOrderBlocksSizeInput
swingOrderBlocksBoxes.push(box.new(na,na,na,na,xloc = xloc.bar_time,extend = extend.right))
if showInternalOrderBlocksInput
for index = 1 to internalOrderBlocksSizeInput
internalOrderBlocksBoxes.push(box.new(na,na,na,na,xloc = xloc.bar_time,extend = extend.right))
// @variable source to use in bearish order blocks mitigation
bearishOrderBlockMitigationSource = orderBlockMitigationInput == CLOSE ? close : high
// @variable source to use in bullish order blocks mitigation
bullishOrderBlockMitigationSource = orderBlockMitigationInput == CLOSE ? close : low
// @variable default volatility measure
atrMeasure = ta.atr(200)
// @variable parsed volatility measure by user settings
volatilityMeasure = orderBlockFilterInput == ATR ? atrMeasure : ta.cum(ta.tr)/bar_index
// @variable true if current bar is a high volatility bar
highVolatilityBar = (high - low) >= (2 * volatilityMeasure)
// @variable parsed high
parsedHigh = highVolatilityBar ? low : high
// @variable parsed low
parsedLow = highVolatilityBar ? high : low
// we store current values into the arrays at each bar
parsedHighs.push(parsedHigh)
parsedLows.push(parsedLow)
highs.push(high)
lows.push(low)
times.push(time)
//---------------------------------------------------------------------------------------------------------------------}
//USER-DEFINED FUNCTIONS
//---------------------------------------------------------------------------------------------------------------------{
// @function Get the value of the current leg, it can be 0 (bearish) or 1 (bullish)
// @returns int
leg(int size) =>
var leg = 0
newLegHigh = high > ta.highest( size)
newLegLow = low < ta.lowest( size)
if newLegHigh
leg := BEARISH_LEG
else if newLegLow
leg := BULLISH_LEG
leg
// @function Identify whether the current value is the start of a new leg (swing)
// @param leg (int) Current leg value
// @returns bool
startOfNewLeg(int leg) => ta.change(leg) != 0
// @function Identify whether the current level is the start of a new bearish leg (swing)
// @param leg (int) Current leg value
// @returns bool
startOfBearishLeg(int leg) => ta.change(leg) == -1
// @function Identify whether the current level is the start of a new bullish leg (swing)
// @param leg (int) Current leg value
// @returns bool
startOfBullishLeg(int leg) => ta.change(leg) == +1
// @function create a new label
// @param labelTime bar time coordinate
// @param labelPrice price coordinate
// @param tag text to display
// @param labelColor text color
// @param labelStyle label style
// @returns label ID
drawLabel(int labelTime, float labelPrice, string tag, color labelColor, string labelStyle) =>
var label l_abel = na
if modeInput == PRESENT
l_abel.delete()
l_abel := label.new(chart.point.new(labelTime,na,labelPrice),tag,xloc.bar_time,color=color(na),textcolor=labelColor,style = labelStyle,size = size.small)
// @function create a new line and label representing an EQH or EQL
// @param p_ivot starting pivot
// @param level price level of current pivot
// @param size how many bars ago was the current pivot detected
// @param equalHigh true for EQH, false for EQL
// @returns label ID
drawEqualHighLow(pivot p_ivot, float level, int size, bool equalHigh) =>
equalDisplay e_qualDisplay = equalHigh ? equalHighDisplay : equalLowDisplay
string tag = 'EQL'
color equalColor = swingBullishColor
string labelStyle = label.style_label_up
if equalHigh
tag := 'EQH'
equalColor := swingBearishColor
labelStyle := label.style_label_down
if modeInput == PRESENT
line.delete( e_qualDisplay.l_ine)
label.delete( e_qualDisplay.l_abel)
e_qualDisplay.l_ine := line.new(chart.point.new(p_ivot.barTime,na,p_ivot.currentLevel), chart.point.new(time ,na,level), xloc = xloc.bar_time, color = equalColor, style = line.style_dotted)
labelPosition = math.round(0.5*(p_ivot.barIndex + bar_index - size))
e_qualDisplay.l_abel := label.new(chart.point.new(na,labelPosition,level), tag, xloc.bar_index, color = color(na), textcolor = equalColor, style = labelStyle, size = equalHighsLowsSizeInput)
// @function store current structure and trailing swing points, and also display swing points and equal highs/lows
// @param size (int) structure size
// @param equalHighLow (bool) true for displaying current highs/lows
// @param internal (bool) true for getting internal structures
// @returns label ID
getCurrentStructure(int size,bool equalHighLow = false, bool internal = false) =>
currentLeg = leg(size)
newPivot = startOfNewLeg(currentLeg)
pivotLow = startOfBullishLeg(currentLeg)
pivotHigh = startOfBearishLeg(currentLeg)
if newPivot
if pivotLow
pivot p_ivot = equalHighLow ? equalLow : internal ? internalLow : swingLow
if equalHighLow and math.abs(p_ivot.currentLevel - low ) < equalHighsLowsThresholdInput * atrMeasure
drawEqualHighLow(p_ivot, low , size, false)
p_ivot.lastLevel := p_ivot.currentLevel
p_ivot.currentLevel := low
p_ivot.crossed := false
p_ivot.barTime := time
p_ivot.barIndex := bar_index
if not equalHighLow and not internal
trailing.bottom := p_ivot.currentLevel
trailing.barTime := p_ivot.barTime
trailing.barIndex := p_ivot.barIndex
trailing.lastBottomTime := p_ivot.barTime
if showSwingsInput and not internal and not equalHighLow
drawLabel(time , p_ivot.currentLevel, p_ivot.currentLevel < p_ivot.lastLevel ? 'LL' : 'HL', swingBullishColor, label.style_label_up)
else
pivot p_ivot = equalHighLow ? equalHigh : internal ? internalHigh : swingHigh
if equalHighLow and math.abs(p_ivot.currentLevel - high ) < equalHighsLowsThresholdInput * atrMeasure
drawEqualHighLow(p_ivot,high ,size,true)
p_ivot.lastLevel := p_ivot.currentLevel
p_ivot.currentLevel := high
p_ivot.crossed := false
p_ivot.barTime := time
p_ivot.barIndex := bar_index
if not equalHighLow and not internal
trailing.top := p_ivot.currentLevel
trailing.barTime := p_ivot.barTime
trailing.barIndex := p_ivot.barIndex
trailing.lastTopTime := p_ivot.barTime
if showSwingsInput and not internal and not equalHighLow
drawLabel(time , p_ivot.currentLevel, p_ivot.currentLevel > p_ivot.lastLevel ? 'HH' : 'LH', swingBearishColor, label.style_label_down)
// @function draw line and label representing a structure
// @param p_ivot base pivot point
// @param tag test to display
// @param structureColor base color
// @param lineStyle line style
// @param labelStyle label style
// @param labelSize text size
// @returns label ID
drawStructure(pivot p_ivot, string tag, color structureColor, string lineStyle, string labelStyle, string labelSize) =>
var line l_ine = line.new(na,na,na,na,xloc = xloc.bar_time)
var label l_abel = label.new(na,na)
if modeInput == PRESENT
l_ine.delete()
l_abel.delete()
l_ine := line.new(chart.point.new(p_ivot.barTime,na,p_ivot.currentLevel), chart.point.new(time,na,p_ivot.currentLevel), xloc.bar_time, color=structureColor, style=lineStyle)
l_abel := label.new(chart.point.new(na,math.round(0.5*(p_ivot.barIndex+bar_index)),p_ivot.currentLevel), tag, xloc.bar_index, color=color(na), textcolor=structureColor, style=labelStyle, size = labelSize)
// @function delete order blocks
// @param internal true for internal order blocks
// @returns orderBlock ID
deleteOrderBlocks(bool internal = false) =>
array orderBlocks = internal ? internalOrderBlocks : swingOrderBlocks
for in orderBlocks
bool crossedOderBlock = false
if bearishOrderBlockMitigationSource > eachOrderBlock.barHigh and eachOrderBlock.bias == BEARISH
crossedOderBlock := true
if internal
currentAlerts.internalBearishOrderBlock := true
else
currentAlerts.swingBearishOrderBlock := true
else if bullishOrderBlockMitigationSource < eachOrderBlock.barLow and eachOrderBlock.bias == BULLISH
crossedOderBlock := true
if internal
currentAlerts.internalBullishOrderBlock := true
else
currentAlerts.swingBullishOrderBlock := true
if crossedOderBlock
orderBlocks.remove(index)
// @function fetch and store order blocks
// @param p_ivot base pivot point
// @param internal true for internal order blocks
// @param bias BULLISH or BEARISH
// @returns void
storeOrdeBlock(pivot p_ivot,bool internal = false,int bias) =>
if (not internal and showSwingOrderBlocksInput) or (internal and showInternalOrderBlocksInput)
array a_rray = na
int parsedIndex = na
if bias == BEARISH
a_rray := parsedHighs.slice(p_ivot.barIndex,bar_index)
parsedIndex := p_ivot.barIndex + a_rray.indexof(a_rray.max())
else
a_rray := parsedLows.slice(p_ivot.barIndex,bar_index)
parsedIndex := p_ivot.barIndex + a_rray.indexof(a_rray.min())
orderBlock o_rderBlock = orderBlock.new(parsedHighs.get(parsedIndex), parsedLows.get(parsedIndex), times.get(parsedIndex),bias)
array orderBlocks = internal ? internalOrderBlocks : swingOrderBlocks
if orderBlocks.size() >= 100
orderBlocks.pop()
orderBlocks.unshift(o_rderBlock)
// @function draw order blocks as boxes
// @param internal true for internal order blocks
// @returns void
drawOrderBlocks(bool internal = false) =>
array orderBlocks = internal ? internalOrderBlocks : swingOrderBlocks
orderBlocksSize = orderBlocks.size()
if orderBlocksSize > 0
maxOrderBlocks = internal ? internalOrderBlocksSizeInput : swingOrderBlocksSizeInput
array parsedOrdeBlocks = orderBlocks.slice(0, math.min(maxOrderBlocks,orderBlocksSize))
array b_oxes = internal ? internalOrderBlocksBoxes : swingOrderBlocksBoxes
for in parsedOrdeBlocks
orderBlockColor = styleInput == MONOCHROME ? (eachOrderBlock.bias == BEARISH ? color.new(MONO_BEARISH,80) : color.new(MONO_BULLISH,80)) : internal ? (eachOrderBlock.bias == BEARISH ? internalBearishOrderBlockColor : internalBullishOrderBlockColor) : (eachOrderBlock.bias == BEARISH ? swingBearishOrderBlockColor : swingBullishOrderBlockColor)
box b_ox = b_oxes.get(index)
b_ox.set_top_left_point( chart.point.new(eachOrderBlock.barTime,na,eachOrderBlock.barHigh))
b_ox.set_bottom_right_point(chart.point.new(last_bar_time,na,eachOrderBlock.barLow))
b_ox.set_border_color( internal ? na : orderBlockColor)
b_ox.set_bgcolor( orderBlockColor)
// @function detect and draw structures, also detect and store order blocks
// @param internal true for internal structures or order blocks
// @returns void
displayStructure(bool internal = false) =>
var bullishBar = true
var bearishBar = true
if internalFilterConfluenceInput
bullishBar := high - math.max(close, open) > math.min(close, open - low)
bearishBar := high - math.max(close, open) < math.min(close, open - low)
pivot p_ivot = internal ? internalHigh : swingHigh
trend t_rend = internal ? internalTrend : swingTrend
lineStyle = internal ? line.style_dashed : line.style_solid
labelSize = internal ? internalStructureSize : swingStructureSize
extraCondition = internal ? internalHigh.currentLevel != swingHigh.currentLevel and bullishBar : true
bullishColor = styleInput == MONOCHROME ? MONO_BULLISH : internal ? internalBullColorInput : swingBullColorInput
if ta.crossover(close,p_ivot.currentLevel) and not p_ivot.crossed and extraCondition
string tag = t_rend.bias == BEARISH ? CHOCH : BOS
if internal
currentAlerts.internalBullishCHoCH := tag == CHOCH
currentAlerts.internalBullishBOS := tag == BOS
else
currentAlerts.swingBullishCHoCH := tag == CHOCH
currentAlerts.swingBullishBOS := tag == BOS
p_ivot.crossed := true
t_rend.bias := BULLISH
displayCondition = internal ? showInternalsInput and (showInternalBullInput == ALL or (showInternalBullInput == BOS and tag != CHOCH) or (showInternalBullInput == CHOCH and tag == CHOCH)) : showStructureInput and (showSwingBullInput == ALL or (showSwingBullInput == BOS and tag != CHOCH) or (showSwingBullInput == CHOCH and tag == CHOCH))
if displayCondition
drawStructure(p_ivot,tag,bullishColor,lineStyle,label.style_label_down,labelSize)
if (internal and showInternalOrderBlocksInput) or (not internal and showSwingOrderBlocksInput)
storeOrdeBlock(p_ivot,internal,BULLISH)
p_ivot := internal ? internalLow : swingLow
extraCondition := internal ? internalLow.currentLevel != swingLow.currentLevel and bearishBar : true
bearishColor = styleInput == MONOCHROME ? MONO_BEARISH : internal ? internalBearColorInput : swingBearColorInput
if ta.crossunder(close,p_ivot.currentLevel) and not p_ivot.crossed and extraCondition
string tag = t_rend.bias == BULLISH ? CHOCH : BOS
if internal
currentAlerts.internalBearishCHoCH := tag == CHOCH
currentAlerts.internalBearishBOS := tag == BOS
else
currentAlerts.swingBearishCHoCH := tag == CHOCH
currentAlerts.swingBearishBOS := tag == BOS
p_ivot.crossed := true
t_rend.bias := BEARISH
displayCondition = internal ? showInternalsInput and (showInternalBearInput == ALL or (showInternalBearInput == BOS and tag != CHOCH) or (showInternalBearInput == CHOCH and tag == CHOCH)) : showStructureInput and (showSwingBearInput == ALL or (showSwingBearInput == BOS and tag != CHOCH) or (showSwingBearInput == CHOCH and tag == CHOCH))
if displayCondition
drawStructure(p_ivot,tag,bearishColor,lineStyle,label.style_label_up,labelSize)
if (internal and showInternalOrderBlocksInput) or (not internal and showSwingOrderBlocksInput)
storeOrdeBlock(p_ivot,internal,BEARISH)
// @function draw one fair value gap box (each fair value gap has two boxes)
// @param leftTime left time coordinate
// @param rightTime right time coordinate
// @param topPrice top price level
// @param bottomPrice bottom price level
// @param boxColor box color
// @returns box ID
fairValueGapBox(leftTime,rightTime,topPrice,bottomPrice,boxColor) => box.new(chart.point.new(leftTime,na,topPrice),chart.point.new(rightTime + fairValueGapsExtendInput * (time-time ),na,bottomPrice), xloc=xloc.bar_time, border_color = boxColor, bgcolor = boxColor)
// @function delete fair value gaps
// @returns fairValueGap ID
deleteFairValueGaps() =>
for in fairValueGaps
if (low < eachFairValueGap.bottom and eachFairValueGap.bias == BULLISH) or (high > eachFairValueGap.top and eachFairValueGap.bias == BEARISH)
eachFairValueGap.topBox.delete()
eachFairValueGap.bottomBox.delete()
fairValueGaps.remove(index)
// @function draw fair value gaps
// @returns fairValueGap ID
drawFairValueGaps() =>
= request.security(syminfo.tickerid, fairValueGapsTimeframeInput, [close , open , time , high , low , time , high , low ],lookahead = barmerge.lookahead_on)
barDeltaPercent = (lastClose - lastOpen) / (lastOpen * 100)
newTimeframe = timeframe.change(fairValueGapsTimeframeInput)
threshold = fairValueGapsThresholdInput ? ta.cum(math.abs(newTimeframe ? barDeltaPercent : 0)) / bar_index * 2 : 0
bullishFairValueGap = currentLow > last2High and lastClose > last2High and barDeltaPercent > threshold and newTimeframe
bearishFairValueGap = currentHigh < last2Low and lastClose < last2Low and -barDeltaPercent > threshold and newTimeframe
if bullishFairValueGap
currentAlerts.bullishFairValueGap := true
fairValueGaps.unshift(fairValueGap.new(currentLow,last2High,BULLISH,fairValueGapBox(lastTime,currentTime,currentLow,math.avg(currentLow,last2High),fairValueGapBullishColor),fairValueGapBox(lastTime,currentTime,math.avg(currentLow,last2High),last2High,fairValueGapBullishColor)))
if bearishFairValueGap
currentAlerts.bearishFairValueGap := true
fairValueGaps.unshift(fairValueGap.new(currentHigh,last2Low,BEARISH,fairValueGapBox(lastTime,currentTime,currentHigh,math.avg(currentHigh,last2Low),fairValueGapBearishColor),fairValueGapBox(lastTime,currentTime,math.avg(currentHigh,last2Low),last2Low,fairValueGapBearishColor)))
// @function get line style from string
// @param style line style
// @returns string
getStyle(string style) =>
switch style
SOLID => line.style_solid
DASHED => line.style_dashed
DOTTED => line.style_dotted
// @function draw MultiTimeFrame levels
// @param timeframe base timeframe
// @param sameTimeframe true if chart timeframe is same as base timeframe
// @param style line style
// @param levelColor line and text color
// @returns void
drawLevels(string timeframe, bool sameTimeframe, string style, color levelColor) =>
= request.security(syminfo.tickerid, timeframe, [high , low , time , time],lookahead = barmerge.lookahead_on)
float parsedTop = sameTimeframe ? high : topLevel
float parsedBottom = sameTimeframe ? low : bottomLevel
int parsedLeftTime = sameTimeframe ? time : leftTime
int parsedRightTime = sameTimeframe ? time : rightTime
int parsedTopTime = time
int parsedBottomTime = time
if not sameTimeframe
int leftIndex = times.binary_search_rightmost(parsedLeftTime)
int rightIndex = times.binary_search_rightmost(parsedRightTime)
array timeArray = times.slice(leftIndex,rightIndex)
array topArray = highs.slice(leftIndex,rightIndex)
array bottomArray = lows.slice(leftIndex,rightIndex)
parsedTopTime := timeArray.size() > 0 ? timeArray.get(topArray.indexof(topArray.max())) : initialTime
parsedBottomTime := timeArray.size() > 0 ? timeArray.get(bottomArray.indexof(bottomArray.min())) : initialTime
var line topLine = line.new(na, na, na, na, xloc = xloc.bar_time, color = levelColor, style = getStyle(style))
var line bottomLine = line.new(na, na, na, na, xloc = xloc.bar_time, color = levelColor, style = getStyle(style))
var label topLabel = label.new(na, na, xloc = xloc.bar_time, text = str.format('P{0}H',timeframe), color=color(na), textcolor = levelColor, size = size.small, style = label.style_label_left)
var label bottomLabel = label.new(na, na, xloc = xloc.bar_time, text = str.format('P{0}L',timeframe), color=color(na), textcolor = levelColor, size = size.small, style = label.style_label_left)
topLine.set_first_point( chart.point.new(parsedTopTime,na,parsedTop))
topLine.set_second_point( chart.point.new(last_bar_time + 20 * (time-time ),na,parsedTop))
topLabel.set_point( chart.point.new(last_bar_time + 20 * (time-time ),na,parsedTop))
bottomLine.set_first_point( chart.point.new(parsedBottomTime,na,parsedBottom))
bottomLine.set_second_point(chart.point.new(last_bar_time + 20 * (time-time ),na,parsedBottom))
bottomLabel.set_point( chart.point.new(last_bar_time + 20 * (time-time ),na,parsedBottom))
// @function true if chart timeframe is higher than provided timeframe
// @param timeframe timeframe to check
// @returns bool
higherTimeframe(string timeframe) => timeframe.in_seconds() > timeframe.in_seconds(timeframe)
// @function update trailing swing points
// @returns int
updateTrailingExtremes() =>
trailing.top := math.max(high,trailing.top)
trailing.lastTopTime := trailing.top == high ? time : trailing.lastTopTime
trailing.bottom := math.min(low,trailing.bottom)
trailing.lastBottomTime := trailing.bottom == low ? time : trailing.lastBottomTime
// @function draw trailing swing points
// @returns void
drawHighLowSwings() =>
var line topLine = line.new(na, na, na, na, color = swingBearishColor, xloc = xloc.bar_time)
var line bottomLine = line.new(na, na, na, na, color = swingBullishColor, xloc = xloc.bar_time)
var label topLabel = label.new(na, na, color=color(na), textcolor = swingBearishColor, xloc = xloc.bar_time, style = label.style_label_down, size = size.tiny)
var label bottomLabel = label.new(na, na, color=color(na), textcolor = swingBullishColor, xloc = xloc.bar_time, style = label.style_label_up, size = size.tiny)
rightTimeBar = last_bar_time + 20 * (time - time )
topLine.set_first_point( chart.point.new(trailing.lastTopTime, na, trailing.top))
topLine.set_second_point( chart.point.new(rightTimeBar, na, trailing.top))
topLabel.set_point( chart.point.new(rightTimeBar, na, trailing.top))
topLabel.set_text( swingTrend.bias == BEARISH ? 'Strong High' : 'Weak High')
bottomLine.set_first_point( chart.point.new(trailing.lastBottomTime, na, trailing.bottom))
bottomLine.set_second_point(chart.point.new(rightTimeBar, na, trailing.bottom))
bottomLabel.set_point( chart.point.new(rightTimeBar, na, trailing.bottom))
bottomLabel.set_text( swingTrend.bias == BULLISH ? 'Strong Low' : 'Weak Low')
// @function draw a zone with a label and a box
// @param labelLevel price level for label
// @param labelIndex bar index for label
// @param top top price level for box
// @param bottom bottom price level for box
// @param tag text to display
// @param zoneColor base color
// @param style label style
// @returns void
drawZone(float labelLevel, int labelIndex, float top, float bottom, string tag, color zoneColor, string style) =>
var label l_abel = label.new(na,na,text = tag, color=color(na),textcolor = zoneColor, style = style, size = size.small)
var box b_ox = box.new(na,na,na,na,bgcolor = color.new(zoneColor,80),border_color = color(na), xloc = xloc.bar_time)
b_ox.set_top_left_point( chart.point.new(trailing.barTime,na,top))
b_ox.set_bottom_right_point(chart.point.new(last_bar_time,na,bottom))
l_abel.set_point( chart.point.new(na,labelIndex,labelLevel))
// @function draw premium/discount zones
// @returns void
drawPremiumDiscountZones() =>
drawZone(trailing.top, math.round(0.5*(trailing.barIndex + last_bar_index)), trailing.top, 0.95*trailing.top + 0.05*trailing.bottom, 'Premium', premiumZoneColor, label.style_label_down)
equilibriumLevel = math.avg(trailing.top, trailing.bottom)
drawZone(equilibriumLevel, last_bar_index, 0.525*trailing.top + 0.475*trailing.bottom, 0.525*trailing.bottom + 0.475*trailing.top, 'Equilibrium', equilibriumZoneColorInput, label.style_label_left)
drawZone(trailing.bottom, math.round(0.5*(trailing.barIndex + last_bar_index)), 0.95*trailing.bottom + 0.05*trailing.top, trailing.bottom, 'Discount', discountZoneColor, label.style_label_up)
//---------------------------------------------------------------------------------------------------------------------}
//MUTABLE VARIABLES & EXECUTION
//---------------------------------------------------------------------------------------------------------------------{
parsedOpen = showTrendInput ? open : na
candleColor = internalTrend.bias == BULLISH ? swingBullishColor : swingBearishColor
plotcandle(parsedOpen,high,low,close,color = candleColor, wickcolor = candleColor, bordercolor = candleColor)
if showHighLowSwingsInput or showPremiumDiscountZonesInput
updateTrailingExtremes()
if showHighLowSwingsInput
drawHighLowSwings()
if showPremiumDiscountZonesInput
drawPremiumDiscountZones()
if showFairValueGapsInput
deleteFairValueGaps()
getCurrentStructure(swingsLengthInput,false)
getCurrentStructure(5,false,true)
if showEqualHighsLowsInput
getCurrentStructure(equalHighsLowsLengthInput,true)
if showInternalsInput or showInternalOrderBlocksInput or showTrendInput
displayStructure(true)
if showStructureInput or showSwingOrderBlocksInput or showHighLowSwingsInput
displayStructure()
if showInternalOrderBlocksInput
deleteOrderBlocks(true)
if showSwingOrderBlocksInput
deleteOrderBlocks()
if showFairValueGapsInput
drawFairValueGaps()
if barstate.islastconfirmedhistory or barstate.islast
if showInternalOrderBlocksInput
drawOrderBlocks(true)
if showSwingOrderBlocksInput
drawOrderBlocks()
lastBarIndex := currentBarIndex
currentBarIndex := bar_index
newBar = currentBarIndex != lastBarIndex
if barstate.islastconfirmedhistory or (barstate.isrealtime and newBar)
if showDailyLevelsInput and not higherTimeframe('D')
drawLevels('D',timeframe.isdaily,dailyLevelsStyleInput,dailyLevelsColorInput)
if showWeeklyLevelsInput and not higherTimeframe('W')
drawLevels('W',timeframe.isweekly,weeklyLevelsStyleInput,weeklyLevelsColorInput)
if showMonthlyLevelsInput and not higherTimeframe('M')
drawLevels('M',timeframe.ismonthly,monthlyLevelsStyleInput,monthlyLevelsColorInput)
//---------------------------------------------------------------------------------------------------------------------}
//ALERTS
//---------------------------------------------------------------------------------------------------------------------{
alertcondition(currentAlerts.internalBullishBOS, 'Internal Bullish BOS', 'Internal Bullish BOS formed')
alertcondition(currentAlerts.internalBullishCHoCH, 'Internal Bullish CHoCH', 'Internal Bullish CHoCH formed')
alertcondition(currentAlerts.internalBearishBOS, 'Internal Bearish BOS', 'Internal Bearish BOS formed')
alertcondition(currentAlerts.internalBearishCHoCH, 'Internal Bearish CHoCH', 'Internal Bearish CHoCH formed')
alertcondition(currentAlerts.swingBullishBOS, 'Bullish BOS', 'Internal Bullish BOS formed')
alertcondition(currentAlerts.swingBullishCHoCH, 'Bullish CHoCH', 'Internal Bullish CHoCH formed')
alertcondition(currentAlerts.swingBearishBOS, 'Bearish BOS', 'Bearish BOS formed')
alertcondition(currentAlerts.swingBearishCHoCH, 'Bearish CHoCH', 'Bearish CHoCH formed')
alertcondition(currentAlerts.internalBullishOrderBlock, 'Bullish Internal OB Breakout', 'Price broke bullish internal OB')
alertcondition(currentAlerts.internalBearishOrderBlock, 'Bearish Internal OB Breakout', 'Price broke bearish internal OB')
alertcondition(currentAlerts.swingBullishOrderBlock, 'Bullish Swing OB Breakout', 'Price broke bullish swing OB')
alertcondition(currentAlerts.swingBearishOrderBlock, 'Bearish Swing OB Breakout', 'Price broke bearish swing OB')
alertcondition(currentAlerts.equalHighs, 'Equal Highs', 'Equal highs detected')
alertcondition(currentAlerts.equalLows, 'Equal Lows', 'Equal lows detected')
alertcondition(currentAlerts.bullishFairValueGap, 'Bullish FVG', 'Bullish FVG formed')
alertcondition(currentAlerts.bearishFairValueGap, 'Bearish FVG', 'Bearish FVG formed')
//---------------------------------------------------------------------------------------------------------------------}
RSI Trend Navigator [QuantAlgo]🟢 Overview
The RSI Trend Navigator integrates RSI momentum calculations with adaptive exponential moving averages and ATR-based volatility bands to generate trend-following signals. The indicator applies variable smoothing coefficients based on RSI readings and incorporates normalized momentum adjustments to position a trend line that responds to both price action and underlying momentum conditions.
🟢 How It Works
The indicator begins by calculating and smoothing the RSI to reduce short-term fluctuations while preserving momentum information:
rsiValue = ta.rsi(source, rsiPeriod)
smoothedRSI = ta.ema(rsiValue, rsiSmoothing)
normalizedRSI = (smoothedRSI - 50) / 50
It then creates an adaptive smoothing coefficient that varies based on RSI positioning relative to the midpoint:
adaptiveAlpha = smoothedRSI > 50 ? 2.0 / (trendPeriod * 0.5 + 1) : 2.0 / (trendPeriod * 1.5 + 1)
This coefficient drives an adaptive trend calculation that responds more quickly when RSI indicates bullish momentum and more slowly during bearish conditions:
var float adaptiveTrend = source
adaptiveTrend := adaptiveAlpha * source + (1 - adaptiveAlpha) * nz(adaptiveTrend , source)
The normalized RSI values are converted into price-based adjustments using ATR for volatility scaling:
rsiAdjustment = normalizedRSI * ta.atr(14) * sensitivity
rsiTrendValue = adaptiveTrend + rsiAdjustment
ATR-based bands are constructed around this RSI-adjusted trend value to create dynamic boundaries that constrain trend line positioning:
atr = ta.atr(atrPeriod)
deviation = atr * atrMultiplier
upperBound = rsiTrendValue + deviation
lowerBound = rsiTrendValue - deviation
The trend line positioning uses these band constraints to determine its final value:
if upperBound < trendLine
trendLine := upperBound
if lowerBound > trendLine
trendLine := lowerBound
Signal generation occurs through directional comparison of the trend line against its previous value to establish bullish and bearish states:
trendUp = trendLine > trendLine
trendDown = trendLine < trendLine
if trendUp
isBullish := true
isBearish := false
else if trendDown
isBullish := false
isBearish := true
The final output colors the trend line green during bullish states and red during bearish states, creating visual buy/long and sell/short opportunity signals based on the combined RSI momentum and volatility-adjusted trend positioning.
🟢 Signal Interpretation
Rising Trend Line (Green): Indicates upward momentum where RSI influence and adaptive smoothing favor continued price advancement = Potential buy/long positions
Declining Trend Line (Red): Indicates downward momentum where RSI influence and adaptive smoothing favor continued price decline = Potential sell/short positions
Flattening Trend Lines: Occur when momentum weakens and the trend line slope approaches neutral, suggesting potential consolidation before the next move
Built-in Alert System: Automated notifications trigger when bullish or bearish states change, sending "RSI Trend Bullish Signal" or "RSI Trend Bearish Signal" messages for timely entry/exit
Color Bar Candles Option: Optional candle coloring feature that applies the same green/red trend colors to price bars, providing additional visual confirmation of the current trend direction
Optimized SMC Dashboard - by MinkyJuiceSMC - all in one
all SMC confluences are included, fully automated and customisable
enjoy, made by MinkyJuice
No Turd Burglars, please
ORB + SMA + EMA + BUY/SELL by yuvaraj ORB (Opening Range Breakout)
Meaning:
ORB stands for Opening Range Breakout.
It is a trading strategy where you watch the price movement for the first few minutes after the market opens (for example, 9:15 – 9:30 AM in India).
You mark the high and low during this period.
If price goes above the high, it signals a possible buy (long trade).
If price goes below the low, it signals a possible sell (short trade).
Why traders use it:
First few minutes decide the market direction.
Helps catch early momentum trades.
Very popular for intraday traders (Nifty, BankNifty, Crude Oil, etc.).
Example:
Market opens at 9:15.
First 5 minutes: High = 100, Low = 95.
If price moves above 100 → Buy.
If price moves below 95 → Sell.
📌 SMA (Simple Moving Average)
Meaning:
SMA stands for Simple Moving Average.
It is the average closing price of a stock over a certain number of candles.
Example:
SMA 9 → Average price of last 9 candles.
SMA 50 → Average price of last 50 candles.
Why traders use it:
Shows trend direction.
SMA going up → Uptrend, SMA going down → Downtrend.
You can use multiple SMAs (for example SMA 9 and SMA 50):
If SMA 9 crosses above SMA 50 → Buy signal.
If SMA 9 crosses below SMA 50 → Sell signal.
🔑 Key Difference:
Feature ORB SMA
Type Strategy (price breakout) Indicator (average price)
Use Entry trigger for trades Identifies trend direction
Works Best Intraday (first minutes) Any timeframe (intraday or swing)
Plots ORB High/Low lines for the first few minutes
Plots SMA 9/50/180 & EMA 20
Plots trailing stopline + Buy/Sell arrows
Optional bar color / background color toggle
Alert conditions for Buy/Sell
ORB high/low lines
SMA 9/50/180 + EMA 20
Buy/Sell arrows + trailing stopline
RSI DivergenceThe code originally belongs to Matthew J. Slabosz, the founder of Zen Trading (The Art of Trading). ✍️📈
👉 My contribution and improvement was adding a divergence line directly on the RSI chart.
Why? Because most people can’t confirm correctness just by reading the code. 🧑💻❌
They need to see it with their own eyes 👀✔️ — this prevents misinterpretation and makes divergences crystal clear.
✨ By adding these visual confirmations, the efficiency and usability of the code has been significantly enhanced. 🚀📊
Smart Money Flow Index (SMFI) - This tool is useful for comparing price action with underlying money flow and spotting where smart money may be entering or exiting the market.
30s Opening Range with TargetsSimple 30 Second opening range with profit targets and adjustable fill transparency and profit targets