Daily Deviations (Lazy Edition)
Plots the standard deviation resistance/support lines.
Uses Previous days close and the VIX as the volatility factor.
credit to u/UberBotMan and u/Living_Granger for the idea and formulas
Wyszukaj w skryptach "daily"
Daily Deviations (Self Input Version)
Plots the standard deviation resistance/support levels.
Input the previous settlement price and the implied volatility.
credit to u/UberBotMan and u/Living_Granger for the idea and formulas
(preview example is using settlement of 2420 and IV of 11)
Daily Returns & STDWhat happened last time when xx increased by xx%? - Start collecting some stats!
You can choose the ticker and the timeframe you're interested in
RSI Oversold/UndersoldThe study script will place GREEN BUY arrows BELOW oversold conditions and RED SHORT arrows ABOVE overbought conditions. You can configure the period
Most RSI(14) indicators use a 14-period, I prefer a 5-period. The period, overbought and oversold periods are settings that can easily be changed by adding this study to your chart and clicking the "gear" icon next to the study inside your chart.
Daily SMAThis pine script on intraday chart is exactly the same SMA as built-in MovingAverage on a 1Day chart (with the same lengths)
[CT] D&W PPO + RBF + DivergenceThis indicator combines two separate ideas into one tool so you can read trend context from your price chart while timing momentum shifts from a clean oscillator panel. The first component is the Daily and Weekly Percentage Price Oscillator (D&W PPO), which measures the relationship between two EMA spreads that are intentionally built to reflect two “speeds” of market structure. The “weekly” leg is calculated as the percentage distance between a slower and faster EMA pair (L1 and L2), and the “daily” leg is calculated as the percentage distance between a shorter EMA pair (L3 and L4), but both are normalized by the same long EMA (e2) so the values behave like a percent-based oscillator rather than raw points. The script then combines those two legs by creating R = W + D, and it plots the histogram as R − W, which simplifies to D. That is not a mistake, it is the point of the design. By setting the baseline at “R equals W,” the zero line becomes a very intuitive threshold that tells you whether the shorter-term push is adding to the longer-term bias or subtracting from it. When the histogram is above zero, the daily component is supportive of the larger trend pressure, and when it is below zero, the daily component is opposing it. The histogram color is intentionally binary and stable, green when the histogram is at or above zero and red when it is below, so the panel reads like a momentum confirmation tool rather than a noisy oscillator that constantly shifts shades.
The second component is the RBF Price Trail, which is drawn on the upper price chart even though the indicator itself lives in a lower panel. This line is not a moving average in the traditional sense. It is a Radial Basis Function kernel smoother that weights recent prices based on their similarity rather than only their recency. In plain terms, the kernel attempts to build a smoother “baseline” that adapts to the shape of price action, and then the script optionally wraps that baseline inside an ATR band and applies a Supertrend-like trailing clamp. When the ATR band is enabled, the line will not simply track the kernel value, it will trail price and hold its position until price forces it to ratchet. This behavior is what makes it useful as a structure-aligned trend line rather than just another smoothing curve. When the adaptive band boost is enabled, the band width is multiplied by a factor that grows when recent price change is large relative to a lookback normalization window. That means the trailing mechanism can adapt to fast markets by changing the effective band behavior, which helps reduce whipsaws in choppy conditions while still allowing the line to respond when volatility expands. The line color is determined by where price closes relative to the trail, bullish when price is above the trail and bearish when price is below it, and you can optionally color your actual chart candles from either the PPO state or the RBF state depending on what you want your eyes to follow.
The settings are organized so you can control each module without changing how the core PPO trend logic behaves. The PPO settings L1, L2, L3, and L4 define the EMA lengths used to compute the weekly leg W and the daily leg D. Increasing these values makes the oscillator slower and smoother, while decreasing them makes it react faster to recent movement. “Show W line” is simply a visual aid, it plots the W line in the oscillator panel so you can see the longer-term component, but it does not change the histogram logic. “Histogram thickness” is purely visual and controls how thick the column bars are. The PPO colors are the two base colors used for the histogram state, green when the daily component is supportive and red when it is opposing.
The RBF settings control what you see on the upper chart. “Show RBF on Price Chart” turns the trail line on or off. “Source” chooses which price series feeds the kernel, and close is usually the cleanest choice. “Kernel Length” determines how many bars the kernel uses; a larger value makes the baseline smoother and slower, and a smaller value makes it more reactive. “Gamma Adj” controls how quickly the kernel’s weights decay as price becomes dissimilar, so higher gamma tends to make the kernel react more sharply to changes while lower gamma produces a broader smoothing effect. “Use ATR Trail Band” is the switch that turns the kernel baseline into a trailing band line, and it is the reason the line can “hold” and then ratchet instead of moving continuously like a normal moving average. “ATR Length” and “ATR Factor” control the width of that band, and widening the band will generally reduce flips and noise at the cost of later signals. “Use Adaptive Band Boost” turns on the volatility normalization idea, “Boost Normalization Lookback” defines how far back the script looks to determine what counts as a large price change, and “Boost Multiplier” controls how strongly the band behavior is adjusted during those periods. The line width and bull/bear colors are visual controls only.
Price bar coloring is intentionally handled with a single selector so you do not end up with two modules fighting to color candles differently. If you choose “Off,” nothing on the main chart is recolored. If you choose “PPO,” your price candles reflect whether the PPO histogram is above or below zero. If you choose “RBF,” your price candles reflect whether price is above or below the RBF trail. Most traders will pick one and stick with it so the chart communicates a single bias at a glance.
The divergence module is optional and is designed to be a confirmation layer rather than a primary trigger. When enabled, it can mark regular divergence and hidden divergence, and it lets you decide what the pivots should be based on. The divergence source can be the PPO histogram or the R line, depending on whether you want divergence measured on the cleaner momentum component or on the combined series. “Key off pivots” determines whether pivot detection is driven by oscillator pivots or by price pivots. If you choose oscillator pivots, divergence anchors are found where the oscillator makes pivot highs or lows and those are compared against price at the same points. If you choose price pivots, the pivots are taken from price first and the oscillator value at those pivot bars is used for the comparison, which can feel more intuitive when you want divergence to respect obvious swing structure on the chart. Pivot Left and Pivot Right control how strict the swing definition is, larger values create fewer but more meaningful pivots and smaller values create more frequent signals. “Mark on Price Chart” adds tiny markers on the candles at the pivot location so you can see where the divergence event was confirmed, while the oscillator panel uses lines and labels to make the divergence relationship obvious.
For trading, the cleanest way to use this tool is to separate “bias” from “timing.” The RBF Price Trail is your bias filter because it is structure-like and tends to hold and ratchet rather than constantly drifting. When price is closing above the trail and the trail is colored bullish, you treat the market as long-biased and you focus on long setups, pullbacks, and continuation entries. When price is closing below the trail and the trail is bearish, you treat the market as short-biased and you focus on short setups, rallies, and continuation shorts. The PPO histogram is then your timing and pressure confirmation. In an up-bias, the highest quality continuation conditions are when the histogram is above zero and stays above zero through pullbacks, because that means the shorter-term pressure is still supporting the longer-term drift. When the histogram dips below zero during an up-bias, it is a warning that the daily component is now opposing, which often corresponds to a deeper pullback, a rotation, or a period of consolidation, so you either wait for the histogram to recover above zero or you tighten expectations and manage risk more aggressively. In a down-bias, the mirror logic applies: the best continuation conditions are when the histogram is below zero, and pushes above zero tend to represent countertrend rotations or pauses inside the bearish condition.
Divergence is best used as an early warning and a location filter, not as a standalone entry button. Regular bullish divergence, where price makes a lower low but the oscillator makes a higher low, can signal bearish pressure is weakening and is most useful when it appears while price is below the RBF trail but failing to continue downward, because it often precedes a reclaim of the trail or at least a meaningful rotation. Regular bearish divergence, where price makes a higher high but the oscillator makes a lower high, can signal bullish pressure is weakening and is most useful when it appears while price is above the trail but extension is failing, because it often precedes a drop back to the trail or a full flip. Hidden divergence is a continuation concept. Hidden bullish divergence, where price makes a higher low while the oscillator makes a lower low, often shows up during pullbacks in an uptrend and can help you confirm continuation as long as the RBF bias remains bullish. Hidden bearish divergence, where price makes a lower high while the oscillator makes a higher high, often shows up during rallies in a downtrend and can help you confirm continuation as long as the RBF bias remains bearish. In practice, you’ll get the best results when you only act on divergence that aligns with the RBF bias for hidden divergence continuation, and you treat regular divergence as a caution or reversal setup only when it occurs near a meaningful swing and is followed by a bias change or a strong momentum shift on the PPO.
The most practical workflow is to keep the RBF trail visible on the price chart as your regime guide, keep the PPO histogram as your momentum confirmation, and decide in advance whether you want candle coloring to represent the PPO state or the RBF state so your eyes are not reading two different meanings at once. if you want the cleanest “trend-following” behavior, color candles by the RBF trail and use the PPO histogram as the timing trigger. If you want the cleanest “momentum-first” behavior, color candles by PPO and treat the RBF trail as the higher-level filter for whether you should press a move or fade it.
Dynamic Supports + Volume Profile (Smart Time Selector)This indicator is an "All-in-One" tool designed to simplify Market Structure and Volume analysis on higher timeframes (especially Daily charts).
Its main innovation is the **Unique Period Selector**, which automatically adjusts 5 internal parameters (tolerance, pivot sensitivity, resolution, and historical depth) with a single click.
**🛠️ MAIN FEATURES:**
1. **Automatic Engine (1-5 Years):**
* Forget about manually setting pivot lengths or "Lookback".
* Select **"1 Year"**: The script scans for fast pivots and recent volume for *Swing Trading*.
* Select **"5 Years"**: The script filters noise and shows only "Rock-Solid" structures (Historical S/R) for *Long Term Investing*.
2. **"Merged" Support & Resistance (S/R):**
* The script detects Pivot Highs/Lows.
* **Fusion Logic:** If price bounces multiple times in the same zone (within calculated tolerance), the script updates the existing line instead of drawing a new one. It extends the line and counts the touches (e.g., "S (4)" means a Support validated 4 times).
* **Clean Chart:** Avoids visual noise.
3. **Lateral Volume Profile (VP):**
* Displays volume distribution to the right of the current price.
* **Orange POC (Point of Control):** Marks the exact price level with the highest trading volume in the selected period.
**🚀 HOW TO USE (STRATEGY):**
Best used on the **Daily Timeframe (1D)**:
* **Scenario 1: Mean Reversion**
* If price moves far from the **Orange POC**, look for it to act as a magnet.
* Enter when price touches a **Green Line (Support)** that aligns with a high volume node.
* **Scenario 2: Breakout**
* If price breaks a **Red Line (Resistance)** aggressively and the volume above is thin (low volume nodes), the move tends to be fast due to lack of friction.
* **Scenario 3: Multi-Timeframe Analysis**
* Use "5 Years" to mark your long-term zones.
* Switch to "1 Year" for tactical entries.
**🎨 VISUAL SETTINGS:**
* **Green Lines:** Demand Zones (Supports).
* **Red Lines:** Supply Zones (Resistances).
* **Dotted Orange Line:** POC (Fair Value).
* **Blue Bars:** Volume Profile.
**Disclaimer / Descargo:**
This script is designed for educational and analytical purposes on the daily timeframe. Use it to identify zones of interest, not as automatic buy/sell signals.
Fed Balance Sheet (Candles)Fed Balance Sheet (Candles) - TradingView Description
📊 OVERVIEW
Fed Balance Sheet (Candles) transforms the Federal Reserve's total assets into an intuitive candlestick visualization, allowing you to track monetary policy changes with the same visual language you use for price action.
This indicator pulls real-time data directly from FRED (Federal Reserve Economic Data) and displays the Total Assets of All Federal Reserve Banks as dynamic candles on your chart, making it effortless to correlate central bank liquidity with market movements.
🎯 WHY THIS MATTERS
The Federal Reserve's balance sheet is one of the most powerful leading indicators in global markets. When the Fed expands its balance sheet (Quantitative Easing), it injects liquidity into the financial system, historically correlating with:
Rising asset prices (stocks, crypto, commodities)
Lower volatility
Risk-on sentiment
Currency devaluation
When the Fed contracts its balance sheet (Quantitative Tightening), liquidity drains from markets, often leading to:
Asset price pressure
Increased volatility
Risk-off sentiment
Dollar strength
By visualizing this as candles, you can instantly see:
The pace of change (candle size)
The direction (green = expansion, red = contraction)
Acceleration or deceleration (consecutive candles in same direction)
Pivots in monetary policy (color changes from green to red or vice versa)
🔧 HOW IT WORKS
Data Source
Source: Federal Reserve Economic Data (FRED)
Metric: Total Assets of All Federal Reserve Banks
Unit: Displayed in Trillions of USD for easy reading
Frequency: Weekly updates (every Wednesday)
Candlestick Construction
Since balance sheet data is reported as a single number each week (not traditional open-high-low-close), this indicator creates candles by comparing each period to the previous one:
Open = Last week's balance sheet value
Close = This week's balance sheet value
High = The higher of the two values
Low = The lower of the two values
This captures directional movement and magnitude of change, making it intuitive for traders accustomed to candlestick analysis.
Color Scheme
🟢 GREEN CANDLES (Expanding Balance Sheet)
When this week's value is higher than last week's
Interpretation: Fed is adding liquidity (Quantitative Easing)
Historically bullish for risk assets
🔴 RED CANDLES (Contracting Balance Sheet)
When this week's value is lower than last week's
Interpretation: Fed is removing liquidity (Quantitative Tightening)
Historically bearish or neutral for risk assets
Value Label
A floating label displays the current balance sheet value in trillions (e.g., "$8.75T") so you always know the exact figure at a glance.
📈 PRACTICAL APPLICATIONS
1. Market Regime Identification
Strings of green candles = Liquidity-driven bull markets
Strings of red candles = Tightening-induced bear markets or corrections
Color transitions = Potential market inflection points
2. Correlation Analysis
Overlay on stock indices (SPY, QQQ, IWM)
Overlay on crypto (BTC, ETH)
Overlay on commodities (Gold, Silver)
Observe how asset prices react to Fed liquidity changes in real-time
3. Macro Timing
Large green candles = Aggressive easing (crisis response)
Large red candles = Aggressive tightening (inflation fighting)
Small candles = Neutral policy (Fed on hold)
4. Risk Management
Shift portfolio allocation based on liquidity environment
Reduce leverage during red candle trends
Increase exposure during green candle trends
Use as confirmation for other technical signals
5. Multi-Timeframe Context
Daily charts: See how daily price action relates to weekly Fed data
Weekly charts: Perfect alignment with data release frequency
Monthly charts: Visualize long-term monetary cycles spanning years
⚙️ SETTINGS
Zero configuration needed. Simply add the indicator to any chart and it works immediately.
The indicator automatically:
Overlays on your main chart
Uses the left price scale (won't interfere with asset prices)
Updates with the latest Fed data
Displays values in trillions for clean readability
🎨 VISUAL DESIGN PHILOSOPHY
The indicator uses semi-transparent candle bodies with vibrant borders to maintain visibility without obscuring your price action. The color scheme follows universal chart conventions where green represents growth/expansion and red represents decline/contraction.
It's designed to blend seamlessly into any chart theme while providing immediate visual clarity about the Fed's monetary stance.
📚 WHAT YOU NEED TO KNOW
Data Availability
Historical data available from December 2002 (over 20 years of Fed policy)
Updates every Wednesday (Federal Reserve's reporting schedule)
Typically published with a 1-week lag
How the Data Appears
On weekdays: Shows the most recent Wednesday's data
On weekends: Shows Friday's data (which is the prior Wednesday's figure)
Updates automatically when new data is released
Scale Considerations
The Fed's balance sheet is measured in trillions, while most assets are priced much lower. The indicator uses the left price scale by default to avoid conflicts with your main asset's price scale. You can easily move it to a separate pane if you prefer.
🧠 INTERPRETATION GUIDE
Historical QE Phases (Green Candles)
2008-2014: Financial Crisis Response
The Fed's balance sheet expanded from under $1T to ~$4.5T to stabilize markets after the mortgage crisis.
2020: COVID-19 Response
Rapid expansion to ~$7T as the Fed stepped in during pandemic lockdowns.
2020-2022: Extended Support
Balance sheet reached historic peak of ~$9T.
Historical QT Phases (Red Candles)
2017-2019: First Modern QT Attempt
The Fed tried to normalize its balance sheet, reducing it from ~$4.5T to ~$3.8T before pivoting.
2022-Present: Inflation-Fighting QT
The Fed began shrinking its balance sheet to combat inflation, letting bonds mature without replacement.
Key Insights
Size matters, but rate of change matters MORE.
A $9T balance sheet growing slowly has different implications than a $5T balance sheet growing rapidly.
Watch for acceleration.
Increasingly large candles (up or down) signal a policy shift that markets will notice.
Plateaus mean "wait and see."
Tiny candles indicate the Fed is holding steady and watching economic data.
Reversals are major events.
When candles switch from green to red (or vice versa), the Fed has changed course—these are critical market turning points.
🎓 EDUCATIONAL VALUE
This indicator helps you understand:
The mechanics of monetary policy through visual learning
The lag between Fed actions and market reactions by observing temporal correlation
The scale of modern central banking (trillions put into perspective)
The relationship between liquidity and asset prices (cause and effect in action)
Many traders talk about "don't fight the Fed" but never actually track what the Fed is doing. Now you can see it as clearly as you see price action.
🔗 RELATED CONCEPTS
For comprehensive macro analysis, consider also tracking:
Fed Funds Rate (short-term interest rates)
M2 Money Supply (broader measure of money in circulation)
Treasury Yield Curves (bond market expectations)
Dollar Index (DXY) (currency strength)
VIX (market fear/volatility)
The Fed's balance sheet is just one piece of the puzzle, but it's arguably the most important one for understanding liquidity conditions.
⚠️ DISCLAIMER
This indicator displays publicly available economic data from the Federal Reserve. It is for informational and educational purposes only and does not constitute financial advice.
Important considerations:
Past monetary policy does not guarantee future market outcomes
Correlation does not equal causation
Asset prices are influenced by many factors beyond Fed liquidity
Always use proper risk management
Consult with qualified financial professionals before making investment decisions
Trading involves substantial risk of loss and is not suitable for everyone.
📜 VERSION HISTORY
Version 1.0 - Initial Release
Fed balance sheet visualized as candlesticks
Real-time FRED data integration
Automatic display in trillions
Dynamic color coding (green/red)
Current value label with exact figure
💡 WHY CANDLES?
You might wonder: "Why show the Fed's balance sheet as candles instead of a line?"
Because candles tell stories that lines can't.
A line shows you where we are
Candles show you how we got here, how fast we're moving, and what momentum looks like
Candles make the Fed's actions feel immediate and tangible
Candles connect macro data to the chart language you already speak
When you see three big green candles in a row on the Fed balance sheet while your crypto or stock portfolio is rallying, you feel the connection. When you see the candles turn red and shrink, you understand the headwinds forming.
It transforms dry economic data into actionable market intelligence.
📞 SUPPORT & FEEDBACK
If you find this indicator valuable:
⭐ Like and favorite to help others discover it
📝 Comment with your use cases and insights
🔔 Follow for updates and new macro indicators
Your feedback drives improvements and helps build better tools for the trading community.
🚀 THE BOTTOM LINE
The Fed's balance sheet is the tide that lifts or lowers all boats.
Whether you're trading stocks, crypto, forex, or commodities—whether you're a day trader or long-term investor—understanding the Fed's liquidity operations gives you an edge.
This indicator makes that understanding visual, immediate, and actionable.
Stop guessing about macro conditions. Start seeing them.
"Don't fight the Fed" - Wall Street Wisdom
Now you can see exactly what they're doing—in the same language you use to read price action.
May your trades ride the tide of liquidity. 🌊📈
Multi-timeframe RSI & Stochastic dashboard with visual gradient █ OVERVIEW
The MTF RSI + Stochastic Dashboard displays RSI and Stochastic values across 6 customizable timeframes in a compact, visual format. Instead of switching between charts or opening multiple indicator windows, see all your momentum data at a glance.
This indicator combines two of the most popular oscillators (RSI and Stochastic) and shows you where they agree—and where they don't.
█ FEATURES
- 6 Customizable Timeframes — Default: 1m, 5m, 15m, 1H, 4H, Daily (fully adjustable)
- Combined RSI + Stochastic Signal — Shows agreement between both indicators
- Visual Gradient Meters — Left side = Stochastic, Right side = RSI
- Color-Coded Status — OB (Overbought), OS (Oversold), Bull, Bear, S.Bull (Strong Bull), S.Bear (Strong Bear), Mixed
- Overall Trend Bias Bar — Shows percentage of timeframes bullish vs bearish
- Built-in Alerts — Trigger when all timeframes align or reach 80%+ agreement
- Fully Customizable — Colors, position, scale, spacing all adjustable
█ HOW TO READ IT
ROW 1 - TIMEFRAME
Shows which timeframe each column represents.
ROW 2 - COMBINED VALUE
The average of RSI and Stochastic for that timeframe. Color indicates the current state.
ROW 3 - STATUS
- OB = Both RSI and Stochastic overbought (>70/80)
- OS = Both RSI and Stochastic oversold (<30/20)
- Bull = Both indicators bullish (>50)
- Bear = Both indicators bearish (<50)
- S.Bull = Strong bullish (one OB, one Bull)
- S.Bear = Strong bearish (one OS, one Bear)
- Mixed = Indicators disagree
ROW 4 - GRADIENT METERS
Visual representation of RSI (right half) and Stochastic (left half) levels.
- Purple/Magenta = Overbought zone
- Green = Bullish zone
- Yellow/Orange = Neutral zone
- Red = Bearish zone
- Cyan = Oversold zone
BOTTOM BAR - TREND BIAS
Shows overall market bias based on all 6 timeframes.
- STRONG BULL = 70%+ timeframes bullish
- BULL = 55%+ timeframes bullish
- STRONG BEAR = 70%+ timeframes bearish
- BEAR = 55%+ timeframes bearish
- MIXED = No clear direction
█ HOW TO USE IT
CONFLUENCE TRADING
Look for multiple timeframes showing the same status. When 4+ timeframes agree, the signal is stronger.
DIVERGENCE SPOTTING
If lower timeframes show bearish while higher timeframes show bullish, price may be pulling back in an uptrend—potential buy opportunity.
OVERBOUGHT/OVERSOLD EXTREMES
When multiple timeframes hit OB or OS together, watch for potential reversals.
TREND CONFIRMATION
Use the bias bar to confirm your directional bias before entering trades.
█ SETTINGS
RSI Settings
- Length, Source, OB/OS levels
Stochastic Settings
- %K Length, %K Smoothing, %D Smoothing
- Choose to display %K or %D
- OB/OS/Mid/Zero levels
Timeframes
- 6 fully customizable slots
Layout
- Position offset, scale, box sizing, spacing
Colors
- Full control over all visual elements
█ ALERTS
- All Timeframes Bullish — Triggers when all 6 show bullish
- All Timeframes Bearish — Triggers when all 6 show bearish
- Strong Bullish Alignment — Triggers at 80%+ bullish
- Strong Bearish Alignment — Triggers at 80%+ bearish
█ BEST WAY TO DISPLAY THIS INDICATOR
For optimal viewing, follow these steps:
1. ADD THE INDICATOR
• Keep all settings at default — they're optimized for immediate use
2. SCALE YOUR CHART
• Right-click on the price scale (right side of chart)
• Select "Reset Price Scale" or double-click the price scale
• Use your mouse scroll wheel on the price scale to zoom OUT vertically
• This enlarges the indicator relative to the price action
3. POSITION ADJUSTMENT (if needed)
• Vertical Offset: Increase if indicator overlaps candles
• Horizontal Offset: Move left/right to your preference
• Overall Scale Size: Increase for larger display (default 2.0)
4. CHART SHIFT (recommended)
• Enable "Shift Chart" at the bottom-right of TradingView
• This gives the indicator room on the right side of your chart
PRO TIP: The indicator scales with your visible price range. Zoom out on the price scale (not the time scale) to make the dashboard larger and easier to read.
█ NOTES
- Non-repainting: Uses confirmed bar data for calculations
- Overlay indicator: Displays directly on your price chart
- Compatible with all markets and timeframes
- Free to use — part of the XRayTrade indicator collection
█ CREDITS
Developed by XRayTrade
2-Year Simple Moving Average (SMA)2-Year Simple Moving Average (SMA)
This indicator plots a 2-year Simple Moving Average (SMA) of price, designed to highlight long-term market trends and major support or resistance zones.
The 2-year SMA automatically adapts to the chart’s timeframe:
Daily charts: Uses either trading days (≈252 per year) or calendar days (365 per year)
Weekly charts: Uses 52 weeks per year
Monthly charts: Uses 12 months per year
Intraday charts: Estimates bars per year based on the selected timeframe
An optional secondary smoothing moving average can be applied to the 2-year SMA itself, with multiple smoothing types available:
SMA
EMA
SMMA (RMA)
WMA
VWMA
SMA with optional Bollinger Bands
When “SMA + Bollinger Bands” is enabled, volatility bands are calculated using the standard deviation of the 2-year SMA, helping visualize trend stability and expansion.
This indicator is best suited for:
Identifying long-term trend direction
Locating macro support and resistance
Filtering short-term market noise
Assessing price position relative to long-term fair value
Ideal for investors and swing traders seeking a high-timeframe trend reference rather than short-term trade signals.
By JezzaBTC
BTC vs GOLD Macro RotationBTC vs GOLD Macro Rotation Indicator
BTC vs GOLD Macro Rotation Model
This indicator is a macroeconomic rotation model that compares the relative attractiveness of Bitcoin (BTC) versus Gold (GOLD) based on multiple fundamental macro factors.
How does it work?
The model analyzes weekly data from various macroeconomic indicators and generates a score for each asset. The taller bar indicates the preferred asset to rotate capital into.
- Green bars (above zero): BTC strength
- Yellow bars (below zero):GOLD strength
- Info table:Shows exact percentages and rotation recommendation
Macroeconomic Factors Analyzed:
1. DXY (US Dollar Index)
- Strong dollar → Favors GOLD
- Weak dollar → Favors BTC
2. Oil (WTI Crude)
- Oil rising → Favors GOLD
- Oil falling → Favors BTC
3. Copper
- Copper rising → Favors BTC (risk-on)
- Copper falling → Favors GOLD (risk-off)
4. Real Rates (Fed Funds - YoY Inflation)
- Real rates falling → Favors GOLD
- Real rates rising → Favors BTC
5. Fertilizer/Natural Gas Regime (Urea, Ammonia, Natural Gas)**
- Specific combinations of movements in these commodities generate inflationary/deflationary regime signals
Fertilizer Rules:**
| Urea | Ammonia | Gas | Signal |
|------|---------|-----|--------|
| ↑ | ↑ | ↓ | GOLD +2 |
| ↑ | ↑ | ↑ | GOLD +3, BTC -1 |
| ↓ | ↓ | ↓ | BTC +3, GOLD -1 |
| ↑ | ↓ | ↓ | BTC +3 |
| ↓ | ↑ | ↑ | GOLD +3, BTC -1 |
Technical Features:
- Operates on weekly timeframe regardless of chart
- Normalized changes for signal stability
- Configurable EMA smoothing
- Safe handling of invalid symbols (won't break if a ticker doesn't exist)
- All tickers are user-editable
Configurable Inputs:
- Symbols for all assets (BTC, GOLD, DXY, Oil, Copper, CPI, Fed Funds, Gas, Urea, Ammonia)
- Individual weights for each macro component
- Normalization length
- EMA smoothing
Interpretation:**
- **BTC dominant (taller green):** Macro conditions favor risk/digital assets
- **GOLD dominant (taller yellow):** Macro conditions favor safe-haven/tangible assets
This indicator is for educational and informational purposes only. It does not constitute financial advice. Always do your own research before making investment decisions.
Recommended Timeframe: Weekly (W) or Daily (D)
ZLT - Date and Time MarkerPine Script v5 indicator called “DateTime Marker” that overlays on the chart and marks bars whose timestamp matches a user-defined schedule. When a bar “matches,” it can draw:
a vertical line through the bar,
a label with a time/date string, and
a triangle marker below the bar (always plotted on matches).
What you can configure
Marker Type (the matching rule)
You choose one of five modes:
Every Minute
Inputs: everyNMinutes (default 15), minuteOffset (default 0)
Match condition: minute % everyNMinutes == minuteOffset
Example with defaults: marks bars at :00, :15, :30, :45 each hour.
Hourly
Inputs: everyNHours (default 4), hourlyMinute (default 0)
Match condition: hour % everyNHours == 0 AND minute == hourlyMinute
Example with defaults: marks bars at 00:00, 04:00, 08:00, 12:00, 16:00, 20:00 (at minute 00).
Daily Time
Inputs: dailyHour (default 10), dailyMinute (default 0)
Match condition: hour == dailyHour AND minute == dailyMinute
Example with defaults: marks 10:00 every day.
Weekly Day & Time
Inputs: weekDay (default Tuesday), weeklyHour (default 16), weeklyMinute (default 0)
It converts the weekday name to Pine’s dayofweek number via getDayNumber().
Match condition: dayofweek == targetDay AND hour == weeklyHour AND minute == weeklyMinute
Example with defaults: marks Tuesday 16:00.
Monthly Date & Time
Inputs: monthlyDay (default 2), monthlyHour (default 23), monthlyMinute (default 0)
Match condition: dayofmonth == monthlyDay AND hour == monthlyHour AND minute == monthlyMinute
Example with defaults: marks the 2nd day of each month at 23:00.
Visual settings
showLine: whether to draw the vertical line.
lineStyle: Solid/Dashed/Dotted (mapped to Pine line styles by getLineStyle()).
lineColor, lineWidth: styling for the line (width is rounded to an integer because Pine line width is integer).
showLabel: whether to draw a label.
labelColor: background color of the label (text is forced white).
What happens when a bar matches
When isMatch becomes true on a bar:
Vertical line: line.new() at that bar’s bar_index, from low to high, extended extend.both (so it spans the full chart vertically).
Label: label.new() at the bar’s high, with mode-specific text:
Minute/Hourly/Daily: "HH:mm"
Weekly: "Tuesday HH:mm" (or whatever day selected)
Monthly: "Day 2 - HH:mm" (or chosen day)
Triangle marker: plotshape() draws a triangle up below the bar on every match (this happens regardless of showLine / showLabel).
Important practical implications
This uses the bar’s exchange/chart time (TradingView’s time, hour, minute, etc.), so results depend on the symbol/session and chart timezone settings.
On timeframes coarser than 1 minute, “Every Minute” still checks only the bar’s timestamp minute value; it won’t mark intra-bar minutes that don’t exist as separate bars.
Because it can create many objects (lines/labels), it sets max_labels_count=500. Lines are not capped here, so very dense marking can still clutter the chart.
If you tell me your intended use (e.g., “mark NY open,” “mark every 15m candle close,” “mark macro events weekly”), I can point out whether the current matching logic fits that precisely or needs adjustments (sessions, timezones, avoiding duplicates, limiting lines, etc.).
ADR % RangesThis indicator is designed to visually represent percentage lines from the open of the day. The % amount is determined by X amount of the last days to create an average...or Average Daily Range (ADR).
1. ADR Percentage Lines: The core function of the script is to apply lines to the chart that represent specific percentage changes from the daily open. It first calculates the average over X amount of days and then displays two lines that are 1/3rd of that average. One line goes above the other line goes below. The other two lines are the full "range" of the average. These lines can act as boundaries or targets to know how an asset has moved recently. *Past performance is not indicative of current or future results.
The calculation for ADR is:
Step 1. Calculate Today's Range = DailyHigh - DailyLow
Step 2. Store this average after the day has completed
Step 3. Sum all day's ranges
Step 4. Divide by total number of days
Step 5. Draw on chart
2. Customizable Inputs: Users have the flexibility to customize the script through various inputs. This includes the option to display lines only for the current trading day (`todayonly`), and to select which lines are displayed. The user can also opt to show a table the displays the total range of previous days and the average range of those previous days.
3. No Secondary Timeframe: The ADR is computed based on whatever timeframe the chart is and does not reference secondary periods. Therefore the script cannot be used on charts greater than daily.
This script is can be used by all traders for any market. The trader might have to adjust the "X" number of days back to compute a historical average. Maybe they only want to know the average over the past week (5 days) or maybe the past month (20 days).
Humble Student OB/OS Trifecta indicatorAfter reading Cam Hui's blog post about his "Trifecta" bottom spotting model I thought I'd try my hand at scripting it as an indicator. The results are pretty close to what he describes. Though the data TradingView feeds me doesn't seem to be identical to what he's using on StockCharts.com the results are close enough that I will call the effort a success worth publishing.
MTF 20 SMA Table - DXY**MTF 20 SMA Table - Multi-Timeframe Trend Analysis Dashboard**
**Overview:**
This indicator provides a comprehensive multi-timeframe analysis dashboard that displays the relationship between price and the 20-period Simple Moving Average (SMA) across four key timeframes: 15-minute, 1-hour, 4-hour, and Daily. It's designed to help traders quickly identify trend alignment and potential trading opportunities across multiple timeframes at a glance. It's definitely not perfect but has helped me speed up my backtesting efforts as it's worked well for me eliminating flipping back and forth between timeframes excpet when I have confluence on the table, then I check the HTF.
**How It Works:**
The indicator creates a table overlay on your chart showing three critical metrics for each timeframe:
1. **Price vs SMA (Row 1):** Shows whether price is currently above (bullish) or below (bearish) the 20 SMA
- Green = Price Above SMA
- Red = Price Below SMA
2. **SMA Direction (Row 2):** Indicates the trend direction of the SMA itself over a lookback period
- Green (↗ Rising) = Uptrend
- Red (↘ Falling) = Downtrend
- Gray (→ Flat) = Ranging/Consolidation
3. **Strength (Row 3):** Displays the distance between current price and the SMA in pips
- Purple background = Strong move (>50 pips away)
- Orange background = Moderate move (20-50 pips)
- Gray background = Weak/consolidating (<20 pips)
- Text color: Green for positive distance, Red for negative
**Key Features:**
- **Customizable Table Position:** Place the table anywhere on your chart (9 position options)
- **Adjustable SMA Lengths:** Modify the SMA period for each timeframe independently (default: 20)
- **Direction Lookback Settings:** Fine-tune how far back the indicator looks to determine SMA direction for each timeframe
- **Flat Threshold:** Set the pip threshold for determining when an SMA is "flat" vs trending (default: 5 pips)
- **DXY Optimized:** Calculations are calibrated for the US Dollar Index (1 pip = 0.01)
**Best Use Cases:**
1. **Trend Alignment:** Identify when multiple timeframes align in the same direction for higher probability trades
2. **Divergence Spotting:** Detect when lower timeframes diverge from higher timeframes (potential reversals)
3. **Entry Timing:** Use lower timeframe signals while higher timeframes confirm overall trend
4. **Strength Assessment:** Gauge how extended price is from the mean (SMA) to avoid overextended entries
**Settings Guide:**
- **SMA Settings Group:** Adjust the SMA period for each timeframe (15M, 1H, 4H, Daily)
- **SMA Direction Group:** Control lookback periods to determine trend direction
- 15M: Default 5 candles
- 1H: Default 10 candles
- 4H: Default 15 candles
- Daily: Default 20 candles
- **Flat Threshold:** Set sensitivity for "flat" detection (lower = more sensitive to ranging markets)
**Trading Strategy Examples:**
1. **Trend Following:** Look for all timeframes showing the same direction (all green or all red)
2. **Pullback Trading:** When Daily/4H are green but 15M/1H show red, wait for lower timeframes to flip green for entry
3. **Ranging Markets:** When multiple SMAs show "flat", consider range-bound strategies
**Important Notes:**
- This is a reference tool only, not a standalone trading system
- Always use proper risk management and combine with other analysis methods
- Best suited for trending instruments like indices and major forex pairs
- Calculations are optimized for DXY but can be used on other instruments (pip calculations may need adjustment)
**Credits:**
Feel free to modify and improve this code! Suggestions for enhancements are welcome in the comments.
---
**Installation Instructions:**
1. Add the indicator to your TradingView chart
2. Adjust the table position via settings to avoid overlap with price action
3. Customize SMA lengths and lookback periods to match your trading style
4. Monitor the table for timeframe alignment and trend confirmation
---
This indicator is published as open source for the community to learn from and improve upon. Happy trading! 📈
BTC Backwardation SearcherThis Pine Script code is a custom indicator named "BTC Backwardation Searcher" designed for the TradingView platform. The indicator aims to identify and visualize the price difference between two Bitcoin futures contracts: CME:BTC1! and CME:BTC2!.
Here's a breakdown of the code:
1. The script fetches the daily close prices of CME:BTC1! and CME:BTC2! using the security() function.
2. It calculates the percentage price difference between the two contracts using the formula: (btc1Price - btc2Price) / btc2Price * 100.
3. The script also calculates the price difference for the previous two days (2 days ago and 3 days ago) using the same formula.
4. Two conditions are defined:
(1) dailyGreenCondition: If the price difference is greater than or equal to 0.3% for three
consecutive days, including the current day and the previous two days.
(2) dailyRedCondition(commented): If the price difference is less than or equal to -1% for three consecutive days, including the current day and the previous two days.
(I commented it out because I don't think it's useful.)
5. The plotshape() function is used to display green triangles on the chart when the dailyGreenCondition is met, and red triangles when the dailyRedCondition is met. These triangles are displayed on the daily, weekly, and monthly timeframes.
The purpose of this indicator is to help traders identify potential trading opportunities based on the price difference between the two Bitcoin futures contracts. The green triangles suggest a bullish scenario where CME:BTC1! is significantly higher than CME:BTC2!, while the red triangles indicate a bearish scenario where CME:BTC2! is significantly lower than CME:BTC1!.
However, it's important to note that this indicator should be used in conjunction with other technical analysis tools and fundamental analysis. Traders should also consider their risk tolerance, investment goals, and market conditions before making any trading decisions based on this indicator.
ES Multi-Timeframe SMC Entry SystemOverviewThis is a comprehensive Smart Money Concepts (SMC) trading strategy for ES1! (E-mini S&P 500) futures that provides simultaneous buy and sell signals across three timeframes: Daily, Weekly, and Monthly. It incorporates your complete entry checklists, confluence scoring system, and automated risk management.Core Features1. Multi-Timeframe Signal Generation
Daily Signals (D) - For intraday/swing trades (1-3 day holds)
Weekly Signals (W) - For swing trades (3-10 day holds)
Monthly Signals (M) - For position trades (weeks to months)
All three timeframes can trigger simultaneously (pyramiding enabled)
2. Smart Money Concepts ImplementationOrder Blocks (OB)
Automatically detects bullish and bearish order blocks
Bullish OB = Down candle before strong impulse up
Bearish OB = Up candle before strong impulse down
Validates freshness (< 10 bars = higher quality)
Visual boxes displayed on chart
Fair Value Gaps (FVG)
Identifies 3-candle imbalance patterns
Bullish FVG = Gap between high and current low
Bearish FVG = Gap between low and current high
Tracks unfilled gaps as targets/entry zones
Auto-removes when filled
Premium/Discount Zones
Calculates 50-period swing range
Premium = Upper 50% (short from here)
Discount = Lower 50% (long from here)
Deep zones (<30% or >70%) for higher quality setups
Visual shading: Red = Premium, Green = Discount
Liquidity Sweeps
Sell-Side Sweep (SSL) = False break below lows → reversal up
Buy-Side Sweep (BSL) = False break above highs → reversal down
Marked with yellow labels on chart
Valid for 10 bars after occurrence
Break of Structure (BOS)
Identifies when price breaks recent swing high/low
Confirms trend continuation
Marked with small circles on chart
3. Confluence Scoring SystemEach timeframe has a 10-point scoring system based on your checklist requirements:Daily Score (10 points max)
HTF Trend Alignment (2 pts) - 4H and Daily EMAs aligned
SMC Structure (2 pts) - OB in correct zone with HTF bias
Liquidity Sweep (1 pt) - Recent SSL/BSL occurred
Volume Confirmation (1 pt) - Volume > 1.2x 20-period average
Optimal Time (1 pt) - 9:30-12 PM or 2-4 PM ET (avoids lunch)
Risk-Reward >2:1 (1 pt) - Built into exit strategy
Clean Price Action (1 pt) - BOS occurred
FVG Present (1 pt) - Near unfilled fair value gap
Minimum Required: 6/10 (adjustable)Weekly Score (10 points max)
Weekly/Monthly Alignment (2 pts) - W and M EMAs aligned
Daily/Weekly Alignment (2 pts) - D and W trends match
Premium/Discount Correct (2 pts) - Deep zone + trend alignment
Major Liquidity Event (1 pt) - SSL/BSL sweep
Order Block Present (1 pt) - Valid OB detected
Risk-Reward >3:1 (1 pt) - Built into exit
Fresh Order Block (1 pt) - OB < 10 bars old
Minimum Required: 7/10 (adjustable)Monthly Score (10 points max)
Monthly/Weekly Alignment (2 pts) - M and W trends match
Weekly OB in Monthly Zone (2 pts) - OB in deep discount/premium
Major Liquidity Sweep (2 pts) - Significant SSL/BSL
Strong Trend Alignment (2 pts) - D, W, M all aligned
Risk-Reward >4:1 (1 pt) - Built into exit
Extreme Zone (1 pt) - Price <20% or >80% of range
Minimum Required: 8/10 (adjustable)4. Entry ConditionsDaily Long Entry
✅ Daily score ≥ 6/10
✅ 4H trend bullish (price > EMAs)
✅ Price in discount zone
✅ Bullish OB OR SSL sweep OR near bullish FVG
✅ NOT during avoid times (lunch/first 5 min)Daily Short Entry
✅ Daily score ≥ 6/10
✅ 4H trend bearish
✅ Price in premium zone
✅ Bearish OB OR BSL sweep OR near bearish FVG
✅ NOT during avoid timesWeekly Long Entry
✅ Weekly score ≥ 7/10
✅ Weekly trend bullish
✅ Daily trend bullish
✅ Price in discount
✅ Bullish OB OR SSL sweepWeekly Short Entry
✅ Weekly score ≥ 7/10
✅ Weekly trend bearish
✅ Daily trend bearish
✅ Price in premium
✅ Bearish OB OR BSL sweepMonthly Long Entry
✅ Monthly score ≥ 8/10
✅ Monthly trend bullish
✅ Weekly trend bullish
✅ Price in DEEP discount (<30%)
✅ Bullish order block presentMonthly Short Entry
✅ Monthly score ≥ 8/10
✅ Monthly trend bearish
✅ Weekly trend bearish
✅ Price in DEEP premium (>70%)
✅ Bearish order block present5. Automated Risk ManagementPosition Sizing (Per Entry)
Daily: 1.0% account risk per trade
Weekly: 0.75% account risk per trade
Monthly: 0.5% account risk per trade
Formula:
Contracts = (Account Equity × Risk%) ÷ (Stop Points × $50)
Minimum = 1 contractStop Losses
Daily: 12 points ($600 per contract)
Weekly: 40 points ($2,000 per contract)
Monthly: 100 points ($5,000 per contract)
Profit Targets (Risk:Reward)
Daily: 2:1 = 24 points ($1,200 profit)
Weekly: 3:1 = 120 points ($6,000 profit)
Monthly: 4:1 = 400 points ($20,000 profit)
Example with $50,000 AccountDaily Trade:
Risk = $500 (1% of $50k)
Stop = 12 points × $50 = $600
Contracts = $500 ÷ $600 = 0.83 → 1 contract
Target = 24 points = $1,200 profit
Weekly Trade:
Risk = $375 (0.75% of $50k)
Stop = 40 points × $50 = $2,000
Contracts = $375 ÷ $2,000 = 0.18 → 1 contract
Target = 120 points = $6,000 profit
Monthly Trade:
Risk = $250 (0.5% of $50k)
Stop = 100 points × $50 = $5,000
Contracts = $250 ÷ $5,000 = 0.05 → 1 contract
Target = 400 points = $20,000 profit
6. Visual Elements on ChartKey Levels
Previous Daily High/Low - Red/Green solid lines
Previous Weekly High/Low - Red/Green circles
Previous Monthly High/Low - Red/Green crosses
Equilibrium Line - White dotted line (50% of range)
Zones
Premium Zone - Light red shading (upper 50%)
Discount Zone - Light green shading (lower 50%)
SMC Markings
Bullish Order Blocks - Green boxes with "Bull OB" label
Bearish Order Blocks - Red boxes with "Bear OB" label
Bullish FVGs - Green boxes with "FVG↑"
Bearish FVGs - Red boxes with "FVG↓"
Liquidity Sweeps - Yellow "SSL" (down) or "BSL" (up) labels
Break of Structure - Small lime/red circles
Entry Signals
Daily Long - Small lime triangle ▲ with "D" below price
Daily Short - Small red triangle ▼ with "D" above price
Weekly Long - Medium green triangle ▲ with "W" below price
Weekly Short - Medium maroon triangle ▼ with "W" above price
Monthly Long - Large aqua triangle ▲ with "M" below price
Monthly Short - Large fuchsia triangle ▼ with "M" above price
7. Information TablesConfluence Score Table (Top Right)
┌──────────┬────────┬────────┬────────┐
│ TF │ SCORE │ STATUS │ SIGNAL │
├──────────┼────────┼────────┼────────┤
│ 📊 DAILY │ 7/10 │ ✓ PASS │ 🔼 │
│ 📈 WEEKLY│ 6/10 │ ✗ WAIT │ ━ │
│ 🌙 MONTH │ 9/10 │ ✓ PASS │ 🔽 │
├──────────┴────────┴────────┴────────┤
│ P&L: $2,450 │
└─────────────────────────────────────┘
Green scores = Pass (meets minimum threshold)
Orange/Red scores = Fail (wait for better setup)
🔼 = Long signal active
🔽 = Short signal active
━ = No signal
Entry Checklist Table (Bottom Right)
┌──────────────┬───┐
│ CHECKLIST │ ✓ │
├──────────────┼───┤
│ ━ DAILY ━ │ │
│ HTF Trend │ ✓ │
│ Zone │ ✓ │
│ OB │ ✗ │
│ Liq Sweep │ ✓ │
│ Volume │ ✓ │
│ ━ WEEKLY ━ │ │
│ W/M Align │ ✓ │
│ Deep Zone │ ✗ │
│ ━ MONTHLY ━ │ │
│ M/W/D Align │ ✓ │
│ Zone: Discount│ │
└──────────────┴───┘
Green ✓ = Condition met
Red ✗ = Condition not met
Real-time updates as market conditions change
8. Alert SystemIndividual Alerts:
"Daily Long" - Triggers when daily long setup appears
"Daily Short" - Triggers when daily short setup appears
"Weekly Long" - Triggers when weekly long setup appears
"Weekly Short" - Triggers when weekly short setup appears
"Monthly Long" - Triggers when monthly long setup appears
"Monthly Short" - Triggers when monthly short setup appears
Combined Alerts:
"Any Long Signal" - Catches any bullish opportunity (D/W/M)
"Any Short Signal" - Catches any bearish opportunity (D/W/M)
Alert Messages Include:
🔼/🔽 Direction indicator
Timeframe (DAILY/WEEKLY/MONTHLY)
Current confluence score
HTF Current/Average RangeThe "HTF(Higher Timeframe) Current/Average Range" indicator calculates and displays the current and average price ranges across multiple timeframes, including daily, weekly, monthly, 4 hour, and user-defined custom timeframes.
Users can customize the lookback period, table size, timeframe, and font color; with the indicator efficiently updating on the final bar to optimize performance.
When the current range surpasses the average range for a given timeframe, the corresponding table cell is highlighted in green, indicating potential maximum price expansion and signaling the possibility of an impending retracement or consolidation.
For day trading strategies, the daily average range can serve as a guide, allowing traders to hold positions until the current daily range approaches or meets the average range, at which point exiting the trade may be considered.
For scalping strategies, the 15min and 5min average range can be utilized to determine optimal holding periods for fast trades.
Other strategies:
Intraday Trading - 1h and 4h Average Range
Swing Trading - Monthly Average Range
Short-term Trading - Weekly Average Range
Also using these statistics in accordance with Power 3 ICT concepts, will assist in holding trades to their statistical average range of the chosen HTF candle.
CODE
The core functionality lies in the data retrieval and table population sections.
The request.security function (e.g., = request.security(syminfo.tickerid, "D", , lookahead = barmerge.lookahead_off)) retrieves high and low prices from specified timeframes without lookahead bias, ensuring accurate historical data.
These values are used to compute current ranges and average ranges (ta.sma(high - low, avgLength)), which are then displayed in a dynamically generated table starting at (if barstate.islast) using table.new, with conditional green highlighting when the current range is greater than average range, providing a clear visual cue for volatility analysis.
HMA & D1 crossover FX (Study)Can work on other Forex pairs if change settings: Period
This example tuned for AUDUSD (FX Version)
Enter new order on HMA ( Hull Moving Average ) and D1 ( Daily Candle) crossovers, Exit orders as basket when profit = Your Target Profit
This study version built for users of Alerts. Crossover of HMA and DailyCandle1 (and/or DailyCandle1 cross DailyCandle2) (also possible Price cross HMA)






















