Blackflag FTS (1H Trailing) + MSB-OB FibThis indicator combines a 1-hour trailing stop system with multi-timeframe Fibonacci retracement levels and ZigZag structure detection to assist traders in identifying trend direction and potential reversal zones.
Features:
✅ 1-Hour Trailing Stop: Uses an ATR-based trailing stop mechanism to track trend direction and dynamic support/resistance.
✅ Multi-Timeframe Approach: The trailing stop is calculated on the 1-hour timeframe, while the ZigZag and Fibonacci retracement levels are based on the 15-minute chart.
✅ ZigZag Structure Detection: Helps filter market swings and trend reversals dynamically.
✅ Fibonacci Levels (0.5 & 0.786): Key retracement levels to watch for price reactions.
✅ Alerts for Key Levels: Get notified when the price crosses important levels (1H trailing stop, Fib 0.5, Fib 0.786).
How It Works:
The trailing stop adapts dynamically based on ATR values and determines trend direction.
ZigZag detection filters out minor price movements to highlight major swing points.
Fibonacci levels are calculated based on ZigZag swings, helping traders spot potential reversal zones.
This tool is useful for trend-following traders, breakout traders, and Fibonacci-based strategies.
Let me know if you'd like any modifications! 🚀
Educational
HTF Trend IdentificationThis indicator identifies higher timeframe (HTF) trends and plots them on the chart. It uses a fixed higher timeframe input and a selectable source to calculate the HTF value. The indicator also plots an EMA and colors the candles based on the HTF trend and EMA crossover.
**Features:**
* **HTF Trend Identification:** Calculates and plots a higher timeframe trend based on a user-defined source and fixed timeframe. This allows you to visualize the larger trend context on your current chart.
* **Repainting Option:** Provides a toggle to control whether the HTF calculation repaints. Disabling repainting ensures that past HTF signals remain fixed, but may introduce a slight lag. Enabling repainting provides more up-to-date signals, but can cause past signals to change.
* **Customizable Colors:** Allows users to set custom colors for uptrends and downtrends.
* **EMA Plot:** Includes an Exponential Moving Average (EMA) plot with a customizable length and offset. The EMA color changes based on the HTF trend.
* **Candle Coloring:** Colors the candles based on the HTF trend, providing a clear visual representation of the overall trend direction.
* **Alerts:** (This would require adding alert conditions to the code, which I can do if you'd like) Could be extended to include alerts for HTF trend changes or EMA crossovers.
**Inputs:**
* **Repainting:** On/Off toggle to control repainting of the HTF calculation.
* **Source:** Select the source for HTF calculations (e.g., close, open, high, low, etc.).
* **Fixed Higher Timeframe:** Set the higher timeframe for trend calculation (e.g., 1D, 4H, 1W). *Note: Timeframes smaller than the current chart's timeframe are not allowed.*
* **Up Color:** Color for uptrends.
* **Down Color:** Color for downtrends.
* **EMA Length 1:** Length of the EMA.
* **Offset:** Offset for the EMA plot.
**How to Use:**
1. Add the indicator to your chart.
2. Configure the inputs to your desired settings.
3. Observe the plotted HTF trend line, EMA, and candle colors to identify potential trading opportunities.
**Limitations:**
* **Repainting:** Enabling repainting can cause past HTF signals to change. Use with caution.
* **No Alerts (by default):** This version does not include alerts. However, this can be added if requested.
**Author:** atulgalande75
**Disclaimer:** This script is for educational purposes only and should not be considered financial advice. Use at your own risk.
Candle Momentum ExhaustionCandle Momentum Exhaustion
The Candle Momentum Exhaustion indicator is designed to help traders spot potential turning points in a trend by identifying when the prevailing momentum may be “running on empty.” The indicator works by comparing the size of each candle’s body (the absolute difference between the open and close) to the average body size over a recent period. When a candle’s body exceeds a user‐defined multiple of this average, it is flagged as an “exhaustion” candle.
• A bullish exhaustion (shown with a red down–facing triangle above the bar) occurs when a very large bullish candle (close > open) is detected, suggesting that buyers may have pushed the price too far and the rally could be near its end.
• A bearish exhaustion (shown with a green up–facing triangle below the bar) occurs when a very large bearish candle (close < open) is detected, implying that selling pressure might be overdone.
These signals can alert you to a potential reversal or consolidation point. The script also includes alert conditions so that you can set up notifications whenever an exhaustion signal is generated.
How It Works
1. Average Candle Body:
The script computes a simple moving average (SMA) of the absolute candle bodies over a user-defined period (default is 14 bars).
2. Exhaustion Candidate:
A candle is flagged as an exhaustion candidate if its body size exceeds the average by more than the set multiplier (default is 2.0).
3. Signal Identification:
• If the exhaustion candle is bullish (close > open), it is marked with a red down–facing triangle above the bar.
• If it is bearish (close < open), it is marked with a green up–facing triangle below the bar.
4. Alerts:
The built-in alertcondition() calls allow you to set alerts (via TradingView’s alert system) so that you can be notified when an exhaustion event occurs.
Risk Disclaimer:
This indicator is provided for educational and informational purposes only and does not constitute financial, investment, or trading advice. Trading and investing involve significant risk, and you should not rely solely on this indicator when making any trading decisions. Past performance is not indicative of future results. Always perform your own due diligence and consult with a qualified financial advisor before making any financial decisions. The creator of this indicator shall not be held responsible for any losses incurred through its use.
US10Y Yield Range Percentile | JeffreyTimmermansUS10Y Yield Range Percentile
The "US10Y Yield Range Percentile" Indicator provides insights into the relative positioning of the U.S. 10-Year Treasury Yield (US10Y) within a specified lookback period. It highlights key valuation style conditions, helping traders assess market sentiment based on yield movements.
Why is the US 10-Year Treasury Yield Important?
The U.S. 10-Year Treasury Yield (US10Y) is one of the most critical benchmarks in global finance. It reflects the cost of borrowing for the U.S. government and serves as a risk-free rate that influences interest rates across the economy.
Macroeconomic Indicator:
Rising yields suggest strong economic growth or inflationary pressures, often leading to tighter monetary policy.
Falling yields indicate economic slowdown, deflationary risks, or increased demand for safe-haven assets.
Impact on Financial Markets:
Stock Market: Higher yields reduce the attractiveness of equities, while lower yields support risk assets.
Credit Markets: A rising 10-year yield increases borrowing costs, impacting corporate debt and mortgage rates.
Global Capital Flows: US10Y is a key driver of capital allocation worldwide, affecting currency valuations and capital flows into emerging markets.
Correlation with Risk Assets (Especially Crypto):
Crypto markets, particularly Bitcoin and Ethereum, have shown a strong inverse correlation with US10Y yields.
When yields rise, risk assets tend to sell off due to tighter financial conditions.
When yields decline, liquidity flows into speculative assets, boosting stocks, crypto, and growth sectors.
Key Functions of the Indicator
Range Calculation:
Computes the highest high and lowest low over a user-defined period (default: 63 days).
Measures the current yield’s position within this range.
Range Percentile Calculation:
Determines the percentile rank of the current yield within its range.
A higher percentile indicates higher yields, often associated with Risk OFF conditions.
A lower percentile suggests lower yields, signaling Risk ON sentiment.
Optional Smoothing:
Enable/Disable: Users can enable Simple Moving Average (SMA) smoothing to reduce noise.
Default smoothing length : 10 periods (can be customized).
Threshold Levels & Background Coloring:
The background color represents the current market regime (valuation based), based on the US10Y yield percentile:
Risk ON (Bullish): When the percentile falls below the lower threshold (default: 20).
Neutrally Positive Zone (also Risk ON): Between 20 and 80 percentile.
Risk OFF (Bearish): When the percentile rises above the upper threshold (default: 80).
Important : Background Coloring is NOT a Leading Signal.
The background color provides a visual representation of valuation periods, but it is not a leading indicator for price movements. Instead, traders should focus on the orange US10Y Range Percentile line, which is the key signal within this indicator. The colors behind the line below the chart are leading. The background colors behind the price chart are more of a valuation style indications.
When the orange line enters the Danger Zone (above 80 percentile), it signals that yields are elevated, and risk assets (such as stocks and crypto) are at increased risk of reversing downward.
While the background coloring helps to visualize market conditions, price reversals tend to occur when the percentile line is in extreme zones rather than when the background color changes.
Traders should monitor the percentile line closely, as it provides a clearer signal of potential shifts in market sentiment.
Visual Elements
Range Percentile Plot:
Displays the smoothed or raw percentile value over time.
Helps identify shifts in yield positioning.
Threshold Markers & Fill Zones:
Key percentile thresholds (0, 20, 80, 100) are marked with horizontal lines.
The area between 20-80 percentile is filled to indicate the neutral zone.
Extreme zones are highlighted to emphasize significant shifts in risk sentiment.
Dynamic Labeling:
A real-time percentile label appears next to the latest data point.
Alerts & Notifications
Risk OFF to Risk ON Transition:
Alert triggers when the percentile falls below the lower threshold (yields decreasing).
Risk ON to Risk OFF Transition:
Alert triggers when the percentile rises above the upper threshold (yields increasing).
Conclusion
The crypto market is highly sensitive to macroeconomic conditions, with Bitcoin often behaving like a high-beta tech stock.
A declining US10Y yield signals looser financial conditions, increasing demand for risk assets like crypto.
A rising US10Y yield tightens liquidity, leading to sell-offs in Bitcoin, Ethereum, and altcoins.
Tracking the US10Y percentile position helps traders anticipate market shifts before they occur.
This indicator serves as a leading signal for understanding market risk appetite by tracking Treasury yield movements. A decline in yields typically favors equities and risk assets, while rising yields indicate a shift toward safety and risk aversion.
Credits
This indicator was inspired by and builds upon the work of TomasOnMarkets . While incorporating significant enhancements, it acknowledges the foundational concepts provided by this original source. Thank you for sharing your input on this important indicator. We are honored to use it and to further improve upon it.
-Jeffrey
US vs EU Interest Rate SpreadThis script plots the difference (Spread) between the US-Interest Rate (Symbol USINTR) and the EU Interest Rate (Symbol: EUINTR) and plots it in a seperate pane. Areas where the background is green are times were the spread was positive (US interest rate higher than EU interest rate), a red background indicates a higher EU interest rate than US interest rate.
OAT Multiple Alert ConditionsOverview:
The OAT Multiple Alert Conditions indicator is designed to enhance TradingView’s alert functionality by allowing users to set multiple conditions for webhook-based alerts. This script enables traders to define up to four independent conditions using different event types (e.g., crossing, greater than, rising, etc.), making it ideal for automated trading strategies and webhook integrations.
Features:
✅ Supports up to 4 independent conditions.
✅ Multiple event types: Crossing, Crossing Up, Crossing Down, Greater Than, Less Than, Rising, Falling.
✅ Choose between value-based or source-based conditions.
✅ Custom timeframes for each condition.
✅ Optional session filtering and expiration settings.
✅ Visual markers for triggered conditions.
✅ Alerts for individual conditions or all conditions being met.
How It Works:
Configure each condition by selecting the event type and input values.
Define whether the alert should trigger on bar close or real-time.
Enable session filtering to limit alerts to specific trading hours.
Set an expiration date for alerts if needed.
Alerts can be sent via TradingView’s webhook feature for automated execution.
Intended Use:
This script is a utility tool for traders using automated strategies with the Options Auto Trader. It does not generate trading signals or provide financial advice. It is designed to enhance alert flexibility and efficiency for trading through webhooks.
License & Compliance:
This script is published under the Mozilla Public License 2.0 and follows TradingView’s guidelines. It does not execute trades but simply provides an enhanced alerting mechanism.
Live Economic CalendarLive Economic Calendar
This TradingView indicator provides real-time economic news events directly on your charts, helping traders stay informed about key market-moving data. Built on the original Forex Factory utility by toodegrees, this version enhances functionality with customizable alerts and improved visualizations.
Key Features:
Real-Time Economic News: Displays upcoming economic events from Forex Factory, categorized by impact level (High, Medium, Low, Holiday).
Custom Alerts: Set alerts before and after news events to stay prepared for market volatility.
Timezone Adjustments: Adjust news event times to match your local timezone for accurate scheduling.
Currency-Specific News: Automatically filters news based on the currency pair you’re viewing, with manual options for specific currencies.
Flexible Display Options: Choose to display news for today, this week, or a custom period. Customize labels, lines, and tables directly on the chart.
Impact Visualization: Visual cues (lines, labels, background shading) for different impact levels to highlight significant market events.
Credits:
• Original Forex Factory Utility by toodegrees
• Alerts and enhancements by Nachodog
This Pine Script™ code is licensed under the Mozilla Public License 2.0: mozilla.org
Dynamic SL - 1 Pip (Up and Down)The Dynamic SL - 1 Pip Up and Down indicator creates two dynamic lines that follow the price at a distance of 1 pip above and below the closing price. This feature can be particularly useful for traders who want to visualize small stop-loss (SL) levels or track price movement in a highly responsive manner.
Unlike traditional stop-loss indicators, this script ensures that the lines only last for 5 seconds, keeping the chart clean and focusing only on the most relevant price movement.
Key Features
✔ Dynamic Stop-Loss Visualization:
The script draws a green line above the price (+1 pip).
A red line below the price (-1 pip) is also drawn.
✔ Auto-Clearing for a Clean Chart:
Each line lasts for 5 seconds only before automatically disappearing.
This prevents unnecessary clutter on the chart and ensures only the latest price movements are visualized.
✔ Adaptable to Multiple Assets:
Automatically calculates the pip size based on the instrument type:
Forex → Uses 0.0001 per pip.
Futures & Stocks → Uses the minimum tick size.
✔ Ideal for High-Frequency Traders & Scalpers:
Designed for 1-minute (M1) or lower timeframes where traders need to monitor price action closely.
Helps visualize ultra-tight stop-loss levels in scalping strategies.
BTC Future Gamma-Weighted Momentum Model (BGMM)The BTC Future Gamma-Weighted Momentum Model (BGMM) is a quantitative trading strategy that utilizes the Gamma-weighted average price (GWAP) in conjunction with a momentum-based approach to predict price movements in the Bitcoin futures market. The model combines the concept of weighted price movements with trend identification, where the Gamma factor amplifies the weight assigned to recent prices. It leverages the idea that historical price trends and weighting mechanisms can be utilized to forecast future price behavior.
Theoretical Background:
1. Momentum in Financial Markets:
Momentum is a well-established concept in financial market theory, referring to the tendency of assets to continue moving in the same direction after initiating a trend. Any observed market return over a given time period is likely to continue in the same direction, a phenomenon known as the “momentum effect.” Deviations from a mean or trend provide potential trading opportunities, particularly in highly volatile assets like Bitcoin.
Numerous empirical studies have demonstrated that momentum strategies, based on price movements, especially those correlating long-term and short-term trends, can yield significant returns (Jegadeesh & Titman, 1993). Given Bitcoin’s volatile nature, it is an ideal candidate for momentum-based strategies.
2. Gamma-Weighted Price Strategies:
Gamma weighting is an advanced method of applying weights to price data, where past price movements are weighted by a Gamma factor. This weighting allows for the reinforcement or reduction of the influence of historical prices based on an exponential function. The Gamma factor (ranging from 0.5 to 1.5) controls how much emphasis is placed on recent data: a value closer to 1 applies an even weighting across periods, while a value closer to 0 diminishes the influence of past prices.
Gamma-based models are used in financial analysis and modeling to enhance a model’s adaptability to changing market dynamics. This weighting mechanism is particularly advantageous in volatile markets such as Bitcoin futures, as it facilitates quick adaptation to changing market conditions (Black-Scholes, 1973).
Strategy Mechanism:
The BTC Future Gamma-Weighted Momentum Model (BGMM) utilizes an adaptive weighting strategy, where the Bitcoin futures prices are weighted according to the Gamma factor to calculate the Gamma-Weighted Average Price (GWAP). The GWAP is derived as a weighted average of prices over a specific number of periods, with more weight assigned to recent periods. The calculated GWAP serves as a reference value, and trading decisions are based on whether the current market price is above or below this level.
1. Long Position Conditions:
A long position is initiated when the Bitcoin price is above the GWAP and a positive price movement is observed over the last three periods. This indicates that an upward trend is in place, and the market is likely to continue in the direction of the momentum.
2. Short Position Conditions:
A short position is initiated when the Bitcoin price is below the GWAP and a negative price movement is observed over the last three periods. This suggests that a downtrend is occurring, and a continuation of the negative price movement is expected.
Backtesting and Application to Bitcoin Futures:
The model has been tested exclusively on the Bitcoin futures market due to Bitcoin’s high volatility and strong trend behavior. These characteristics make the market particularly suitable for momentum strategies, as strong upward or downward movements are often followed by persistent trends that can be captured by a momentum-based approach.
Backtests of the BGMM on the Bitcoin futures market indicate that the model achieves above-average returns during periods of strong momentum, especially when the Gamma factor is optimized to suit the specific dynamics of the Bitcoin market. The high volatility of Bitcoin, combined with adaptive weighting, allows the model to respond quickly to price changes and maximize trading opportunities.
Scientific Citations and Sources:
• Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65–91.
• Black, F., & Scholes, M. (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy, 81(3), 637–654.
• Fama, E. F., & French, K. R. (1992). The Cross-Section of Expected Stock Returns. The Journal of Finance, 47(2), 427–465.
GWAP (Gamma Weighted Average Price)Gamma Weighted Average Price (GWAP) Indicator
The Gamma Weighted Average Price (GWAP) is a dynamic financial indicator that applies exponentially decaying weights to historical prices to calculate a weighted average. The method leverages the exponential decay function, controlled by a gamma factor, to prioritize recent price data while gradually diminishing the influence of older observations. This approach builds upon techniques commonly found in time-series analysis, including Exponentially Weighted Moving Averages (EWMA), which are extensively used in financial modeling (Campbell, Lo & MacKinlay, 1997).
Theoretical Context and Justification
The gamma-weighted approach follows principles similar to those in Exponentially Weighted Moving Averages (EWMA), often used in volatility modeling, where weights decay exponentially over time. The exponential decay model can improve signal responsiveness compared to simple moving averages (Hyndman & Athanasopoulos, 2018). This design helps capture recent market dynamics without ignoring past trends, a common requirement in high-frequency trading systems (Bandi & Russell, 2006).
Practical Applications
1. Trend Detection:
The GWAP can help identify bullish and bearish trends:
• When the price is above GWAP, the market exhibits bullish momentum.
• Conversely, when the price is below GWAP, bearish momentum prevails.
2. Volatility Filtering:
Because of the gamma weighting mechanism, GWAP reduces the noise commonly seen in volatile markets, making it a useful tool for traders looking to smooth price fluctuations while retaining actionable signals.
3. Crossovers for Trade Signals:
Similar to moving average strategies, traders can use price crossovers with the GWAP as trade signals:
• Buy Signal: When the price crosses above the GWAP.
• Sell Signal: When the price crosses below the GWAP.
4. Adaptive Gamma Weighting:
The gamma factor allows for further customization.
• Higher gamma values (>1) place greater emphasis on older data, suitable for long-term trend analysis.
• Lower gamma values (<1) heavily weight recent price movements, ideal for fast-moving markets.
Example Use Case
A trader analyzing the S&P 500 may use a gamma factor of 0.92 with a 14-period GWAP to detect shifts in market sentiment during periods of heightened volatility. When the index price crosses above the GWAP, this could signal a potential recovery, prompting a buy entry. Conversely, when the price moves below the GWAP during a correction, it may suggest a short-selling opportunity.
Scientific References
• Campbell, J. Y., Lo, A. W., & MacKinlay, A. C. (1997). The Econometrics of Financial Markets. Princeton University Press.
• Hyndman, R. J., & Athanasopoulos, G. (2018). Forecasting: Principles and Practice. OTexts.
• Bandi, F. M., & Russell, J. R. (2006). Microstructure Noise, Realized Variance, and Optimal Sampling. Econometrica.
Multiple Candlestick Patterns - AlgomaxxA comprehensive candlestick pattern detection indicator that identifies seven major Japanese candlestick patterns in real-time. This indicator helps traders identify potential reversal and continuation patterns with customizable visual alerts and labels.
Features
Detects 7 major candlestick patterns:
Doji
Hammer
Shooting Star
Bullish Engulfing
Bearish Engulfing
Morning Star
Evening Star
Color-coded candlesticks for easy pattern identification
Customizable pattern indicators above/below candles
Optional pattern labels with adjustable position
Alert conditions for each pattern
Grouped settings for easy customization
Settings
General Settings
Lookback Period: Number of candles to analyze (default: 20)
Body Size Threshold: Minimum relative size for candle body (default: 0.6)
Pattern Settings
Toggle visibility for each pattern type:
Doji Pattern
Hammer Pattern
Shooting Star Pattern
Bullish Engulfing Pattern
Bearish Engulfing Pattern
Morning Star Pattern
Evening Star Pattern
Label Settings
Show Labels: Toggle pattern labels on/off
Label Text Color: Customize label color
Label Position: Choose between Left/Center/Right alignment
Label Offset: Adjust distance of labels from candles
Pattern Descriptions
Doji: Shows indecision when open and close prices are very close
Yellow color
Cross symbol below candle
Hammer: Potential bullish reversal with long lower shadow
Green color
Triangle up symbol below candle
Shooting Star: Potential bearish reversal with long upper shadow
Red color
Triangle down symbol above candle
Bullish Engulfing: Bullish reversal pattern where current green candle completely engulfs previous red candle
Light green color
Triangle up symbol below candle
Bearish Engulfing: Bearish reversal pattern where current red candle completely engulfs previous green candle
Light red color
Triangle down symbol above candle
Morning Star: Three-candle bullish reversal pattern
Seafoam green color
Triangle up symbol below candle
Evening Star: Three-candle bearish reversal pattern
Pink red color
Triangle down symbol above candle
How to Use
Add the indicator to your chart
Customize the settings based on your preferences:
Enable/disable specific patterns you want to monitor
Adjust label settings for better visibility
Set up alerts for patterns you want to be notified about
Pattern Recognition:
Watch for color changes in candlesticks indicating pattern formation
Look for shape indicators above/below candles
Read pattern labels for quick pattern identification
Trading Suggestions:
Use in conjunction with other technical indicators
Consider overall trend and support/resistance levels
Confirm patterns with volume and price action
Wait for pattern completion before making trading decisions
Tips
Patterns work best when used with multiple timeframes
Combine with trend lines and support/resistance levels
Use volume to confirm pattern strength
Consider market context and overall trend
Larger timeframes typically produce more reliable signals
Use alerts to avoid missing important pattern formations
Disclaimer
This indicator is for informational and educational purposes only. No guarantee is made regarding the accuracy of pattern detection or potential future price movements. Always use proper risk management and consider multiple factors before making trading decisions.
Ultimate Volatility Scanner by NHBprod - Requested by Client!Hey Everyone!
I created another script to add to my growing library of strategies and indicators that I use for automated crypto and stock trading! This strategy is for BITCOIN but can be used on any stock or crypto. This was requested by a client so I thought I should create it and hopefully build off of it and build variants!
This script gets and compares the 14-day volatility using the ATR percentage for a list of cryptocurrencies and stocks. Cryptocurrencies are preloaded into the script, and the script will show you the TOP 5 coins in terms of volatility, and then compares it to the Bitcoin volatility as a reference. It updates these values once per day using daily timeframe data from TradingView. The coins are then sorted in descending order by their volatility.
If you don't want to use the preloaded set of coins, you have the option of inputting your own coins AND/OR stocks!
Let me know your thoughts.
Volatility Arbitrage Spread Oscillator Model (VASOM)The Volatility Arbitrage Spread Oscillator Model (VASOM) is a systematic approach to capitalizing on price inefficiencies in the VIX futures term structure. By analyzing the differential between front-month and second-month VIX futures contracts, we employ a momentum-based oscillator (Relative Strength Index, RSI) to signal potential market reversion opportunities. Our research builds upon existing financial literature on volatility risk premia and contango/backwardation dynamics in the volatility markets (Zhang & Zhu, 2006; Alexander & Korovilas, 2012).
Volatility derivatives have become essential tools for managing risk and engaging in speculative trades (Whaley, 2009). The Chicago Board Options Exchange (CBOE) Volatility Index (VIX) measures the market’s expectation of 30-day forward-looking volatility derived from S&P 500 option prices (CBOE, 2018). Term structures in VIX futures often exhibit contango or backwardation, depending on macroeconomic and market conditions (Alexander & Korovilas, 2012).
This strategy seeks to exploit the spread between the front-month and second-month VIX futures as a proxy for term structure dynamics. The spread’s momentum, quantified by the RSI, serves as a signal for entry and exit points, aligning with empirical findings on mean reversion in volatility markets (Zhang & Zhu, 2006).
• Entry Signal: When RSI_t falls below the user-defined threshold (e.g., 30), indicating a potential undervaluation in the spread.
• Exit Signal: When RSI_t exceeds a threshold (e.g., 70), suggesting mean reversion has occurred.
Empirical Justification
The strategy aligns with findings that suggest predictable patterns in volatility futures spreads (Alexander & Korovilas, 2012). Furthermore, the use of RSI leverages insights from momentum-based trading models, which have demonstrated efficacy in various asset classes, including commodities and derivatives (Jegadeesh & Titman, 1993).
References
• Alexander, C., & Korovilas, D. (2012). The Hazards of Volatility Investing. Journal of Alternative Investments, 15(2), 92-104.
• CBOE. (2018). The VIX White Paper. Chicago Board Options Exchange.
• Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65-91.
• Zhang, C., & Zhu, Y. (2006). Exploiting Predictability in Volatility Futures Spreads. Financial Analysts Journal, 62(6), 62-72.
• Whaley, R. E. (2009). Understanding the VIX. The Journal of Portfolio Management, 35(3), 98-105.
Buyable Gap Ups (BGU) ScreenerBuyable Gap Ups (BGU) Screener
This custom indicator detects Buyable Gap Ups (BGU), designed to identify stocks with significant price movements driven by gap-ups, often signaling strong bullish momentum. It helps traders spot potential opportunities where a stock has gapped up above the previous day's high with increased volume, suggesting the possibility of continued price strength.
Key Features:
Gap Percentage Threshold: Set a minimum gap percentage required for a valid buyable gap-up.
Volume Change Threshold: Identifies gap-ups accompanied by a significant increase in volume compared to the 50-day average.
ATR-Based Gap Detection (Optional): Use Average True Range (ATR) to determine whether the gap is large enough, factoring in recent volatility.
Customizable Lookback Period: Adjust the number of recent bars to track the frequency of BGU occurrences.
Volume Confirmation: Only signals buyable gaps when volume surpasses a defined threshold above the 50-day average.
Input Parameters:
Gap Percentage Threshold: Adjusts the minimum percentage gap for a valid signal.
Volume Change Threshold: Determines the minimum percentage increase in volume compared to the 50-day moving average.
Use ATR Gap: Option to use ATR to determine the minimum gap size instead of the percentage gap.
ATR Multiplier for Gap: Customizes the gap size based on the ATR.
ATR Length: Adjusts the lookback period for calculating ATR.
Lookback Period for BGU: Set the number of bars over which to calculate the BGU count.
Alerts & Signals:
The script will plot signals below bars where a valid BGU condition is met.
Alerts can be set for when a BGU is detected, giving real-time notifications for potential trading opportunities.
This indicator is designed to help traders find stocks showing strong bullish momentum, especially after earnings or other market-moving events, with the potential for continued uptrend. It is ideal for those looking to incorporate gap-based strategies in their trading.
Walk Forward PatternsINTRO
In Euclidean geometry, every mathematical output has a planar projection. 'Walk Forward Patterns' can be considered a practical example of this concept. On the other hand, this indicator might also be viewed as an experiment in 'how playing with Lego as a child contributes to time series analysis' :)
OVERVIEW
This script dynamically generates the necessary optimization and testing ranges for Walk Forward Analysis based on user-defined bar count and length inputs. It performs automatic calculations for each step, offers 8 different window options depending on the inputs, and visualizes the results dynamically. I should also note that most of the window models consist of original patterns I have created.
ADDITIONAL INFO : WHAT IS WALK FORWARD ANALYSIS?
Although it is not the main focus of this indicator, providing a brief definition of Walk Forward Analysis can be helpful in correctly interpreting the results it generates. Walk Forward Analysis (WFA) is a systematic method for optimizing parameters and validating trading strategies. It involves dividing historical data into variable segments, where a strategy is first optimized on an in-sample period and then tested on an out-of-sample period. This process repeats by shifting the windows forward, ensuring that each test evaluates the strategy on unseen data, helping to assess its robustness and adaptability in real market conditions.
ORIGINALITY
There are very few studies on Walk Forward Analysis in TradingView. Even worse, there are no any open-source studies available. Someone has to start somewhere, I suppose. And in my personal opinion, determining the optimization and backtest intervals is the most challenging part of WFA. These intervals serve as a prerequisite for automated parameter optimization. I felt the need to publish this pattern module, which I use in my own WFA models, partly due to this gap on community scripts.
INDICATOR MECHANICS
To use the indicator effectively, you only need to perform four simple tasks:
Specify the total number of bars in your chart in the 'Bar Index' parameter.
Define the optimization (In-Sample Test) length.
Define the testing (Out-Of-Sample Test) length.
Finally, select the window type.
The indicator automatically models everything else (including the number of steps) based on your inputs. And the result; you now have a clear idea of which bars to use for your Walk Forward tests!
A COMMONLY USED WINDOW SELECTION METHOD: ROLLING
A more concrete definition of Walk Forward Analysis, specifically for the widely used Rolling method, can be described as follows:
Parameters that have performed well over a certain period are identified (Optimization: In-Sample).
These parameters are then tested on a shorter, subsequent period (Backtest: Out-of-Sample).
The process is repeated forward in time (At each step, the optimization and backtest periods are shifted by the backtest length).
If the cumulative percentage profit obtained from the backtest results is greater than half of the historical optimization profit, the strategy is considered "successful."
If the strategy is successful, the most recent (untested) optimization values are used for live trading.
OTHER WINDOW OPTIONS
ANCHORED: That's a pattern based on progressively expanding optimization ranges at each step. Backtest ranges move forward in a staircase-like manner.
STATIC: Optimization ranges remain fixed, while backtest ranges are shifted forward.
BLOCKED: Optimization ranges are shifted forward in groups of three blocks. Backtest ranges are also shifted in a staircase manner, even at the cost of creating gaps from the optimization end bars.
TRIANGULAR: Optimization ranges are shifted forward in triangular regions, while backtest ranges move in a staircase pattern.
RATIO: The optimization length increases by 25% of the initial step’s fixed length at each step. In other words, the length grows by 25% of the first step's length incrementally. Backtest ranges always start from the bar where the optimization ends.
FIBONACCI: A variation of the Ratio method, where the optimization shift factor is set to 0.618
RANDOM WALK
Unlike the window models explained above, we can also generate optimization and backtest ranges completely randomly—offering almost unlimited variations! When you select the "Random" option in the "Window" parameter on the indicator interface, random intervals are generated based on various trigonometric calculations. By changing the numerical value in the '🐒' parameter, you can create entirely unique patterns.
WHY THE 🐒 EMOJI?
Two reasons.
First, I think that as humanity, we are a species of tailless primates who become happy when we understand things :). At least evolutionarily. The entire history of civilization is built on the effort to express the universe in a scale we can comprehend. 'Knowledge' is an invention born from this effort, which is why we feel happiness when we 'understand'. Second, I can't think of a better metaphor for randomness than a monkey sitting at a keyboard. See: Monkey Test.
Anyway, I’m rambling :)
NOTES
The indicator generates results for up to 100 steps. As the number of steps increases, the table may extend beyond the screen—don’t forget to zoom out!
FINAL WORDS
I haven’t published a Walk Forward script yet . However, there seem to be examples that can perform parameter optimization in the true sense of the word, producing more realistic results without falling into overfitting in my library. Hopefully, I’ll have the chance to publish one in the coming weeks. Sincerely thanks to Kıvanç Özbilgiç, Robert Pardo, Kevin Davey, Ernest P. Chan for their inspiring publishments.
DISCLAIMER
That's just a script, nothing more. I hope it helps everyone. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
© dg_factor
ATM Bar ValidationThe Bar Validation Indicator is a powerful tool designed to enhance chart reading by combining Volume Spread Analysis (VSA) principles with precise volume location. This indicator identifies the position of significant volume spikes within the pointed price bar, using lower timeframes to offer deeper insights into market behaviour. It helps traders find key price levels and volume relationships that are often invisible in the analysed timeframe.
ATM Bar Validation indicator helps to understand how the bar in question was formed or, in other words, where professionals bought/sold during the bar. By automatically selecting the lowest available timeframe called validation timeframe, this indicator finds and displays on the chart the position of the highest found volume spike, the volume spikes that are bigger than specified in settings percentage of the highest one and the absolute values of those spikes.
Key features:
- Automatic or manual selection of the lower timeframe to scan spikes on
- Displays high and low prices of the lower timeframe’s bar with the biggest volume over the time of the analysed bar
- Displays highs and lows of all lower timeframe’s bars with volume less than the one on the biggest spike but bigger than the specified in the settings percentage of the biggest spike volume
- Shows the volume of each spike displayed.
This indicator improves chart reading and in many cases can prevent a trader from taking bad trading decisions.
ATM SWIFT ScannerATM SWIFT Scanner is an advanced Volume Spread Analysis (VSA) methodology-based tool to analyse and alert traders to the strength/weakness of the market. It monitors supply and demand dynamics across multiple timeframes and provides an overall as well as timeframe-specific view of the instrument. This allows traders to identify potential turning points and trade accordingly.
The scanner operates by analysing price and volume data on three user-defined or automatically determined timeframes called Higher, Intermediate and Lower. On each time frame it searches bars with a relatively big volume and follows further price/volume activity to decide if a particular timeframe is strong, weak or neutral. Then, based on that defines the overall market picture.
When the market is strong, it also scans, alerts and displays on Intermediate and Lower timeframes the VSA principle Test and when the market is weak the VSA principle No Demand, which in some circumstances could be good entry points to the long and short trades respectively.
Additional features:
- To address the trading style (scalping, intraday, swing or investments), traders may set the sensitivity of big volume bars, which defines the minimal number of bars the volume is the biggest.
- To address very liquid markets, traders may exclude Higher timeframe from the scanning which will identify the changes in the market faster.
The Indicator should be added to the timeframe with the lowest resolution.
ATM Relative VolumeThe ATM VSA Relative Volume indicator is an analytical tool designed to provide insights into market dynamics by a unique relative volume interpretation. Unlike traditional methods, it defines Volume Spread Analysis (VSA) relative volume zones without using moving averages, aiming for more accuracy and precision in identifying VSA principles.
The volume shows the activity of professional traders and, given that markets are moved by large traders, is a leading indicator. Big volume suggests professional interest, while low volume indicates its absence. By integrating VSA principles with these relativity zones, the indicator aims to identify potential trading opportunities, confirm price moves, and spot areas of accumulation or distribution, potentially leading to earlier recognition of reversals and stronger trade confirmations.
Core components:
- Volume bars: depending on the type of the asset, show either the number of traded contracts or the number of ticks during the price bar.
- Relative volume bands: showing how active professional traders were during the price bar.
This indicator has several display modes:
- Bands with a simple VSA trending system on the bar, where bands are visible on the screen and up, level and down bars are drawn by different colours
- Bands with no bar colouring, where bands are visible on the screen, but all volume bars will have the same colour
- Bands on Volume Bars, when volume bars are coloured based on their relative volume value.
- Highlight UHV Bars Only, when only volume bars with Ultra-High relative volume will be coloured.
Optional components:
- Use a different colour to plot price bars with the volume lower than on the two previous bars
- Plot safe volume level, defining the maximal value of volume with which professionals support a current price move.
- Display relative volume from different timeframes on the same chart.
ATM VSAThe ATM VSA Indicator is a powerful tool used in chart analysis to interpret the relationship between price movements, trading volume and the spread (range) of the price bars. Based on Volume Spread Analysis (VSA) methodology, it is designed to identify key market behaviours that can help to anticipate future price action and market turning points, focusing on the principles of Sign of Strength (SOS) and Sign of Weakness (SOW).
The indicator serves as a pre-warning tool, is not a buy/sell-signal system and includes several main components:
- 3 key SOSs: Potential Market Strength (PmS), Shakeout (SO) and Test (TE),
- 3 key SOWs Potential Market Weakness (PmW), Upthrust (UT) and No Demand (ND)
- Potential Trigger Bars (PT), which could not be immediately interpreted as SOS or SOW, but could later play a significant role in market moves.
All SOSs and SOWs are shown on the chart by triangles below and above the price bar respectively and also distinguished by the different shades of the colour: dark when the VSA principle is confirmed and light when the VSA principle is not confirmed.
Potential Trigger Bars are shown by the grey-coloured circles below the price bar.
Additional advanced features:
- Selection of Trigger Bar sensitivity defining the minimal number of bars the volume is the biggest on
- Filtering of the Test and No Demand VSA Principles
- Different bar colouring schemes (simple trending system or bar’s strength/weakness)
- Different VSA principle’s confirmation strategies (classic VSA or using strength/weakness of the following bars)
- Stop management tool to help traders manage the trade
- Retail Trader’s intention tool (simple moving average) demonstrating typical retail traders’ behaviour in different market phases
- Showing up and alerting recent VSA Setup.
- Filtering bullish and bearish alerts
By using this indicator, traders can make more informed decisions about entering and exiting trades based on the market’s underlying strength or weakness, while avoiding unreliable signals that can lead to poor trading outcomes.
USDT.D + USDT.C ALL TIMEFRAMESThis indicator combines the dominance of USDT (USDT.D) and USDC (USDC.D) to track total stablecoin market share across all timeframes. It displays the combined dominance as candlesticks, providing a clearer view of market liquidity shifts and investor sentiment.
📌 How to Use:
Green candles indicate rising stablecoin dominance (potential risk-off sentiment).
Red candles indicate declining stablecoin dominance (potential risk-on sentiment).
Works on all timeframes, from intraday scalping to macro trend analysis.
This tool is essential for traders looking to analyze stablecoin liquidity flow, identify market turning points, and refine trading strategies based on stablecoin dominance behavior. 🚀
Optimized Dynamic SupertrendDetailed Explanation of the Optimized Dynamic Supertrend Script
This Supertrend script is designed to dynamically adapt to different market conditions using ATR expansion, volume confirmation, and trend filtering. Below is a step-by-step breakdown of how it works and its functions.
1 ATR-Based Supertrend Calculation
📌 Key Purpose:
The script calculates an adaptive ATR-based Supertrend line, which acts as a dynamic support or resistance level for trend direction.
📌 How it Works:
ATR (Average True Range) is used to measure market volatility.
A dynamic ATR multiplier is applied based on price standard deviation (instead of a fixed value).
The Supertrend is calculated as:
Upper Band: SMA(close, ATR length) + (ATR Multiplier * ATR Value)
Lower Band: SMA(close, ATR length) - (ATR Multiplier * ATR Value)
The Supertrend flips when price crosses and holds beyond the Supertrend line.
🔹 Dynamic Adjustment:
Instead of using a fixed ATR multiplier, the script adjusts it using:
pinescript
Copy
Edit
dynamicFactor = ta.stdev(close, atrLength) / ta.sma(close, atrLength)
atrMultiplier = input(1.5, title="Base ATR Multiplier") * dynamicFactor
High volatility → Wider Supertrend bands (to avoid false signals).
Low volatility → Tighter Supertrend bands (for faster detection).
2 Trend Detection Logic
📌 Key Purpose:
Determines if the market is in a bullish or bearish trend based on price action.
Uses volume sensitivity and ATR expansion to reduce false signals.
📌 How it Works:
pinescript
Copy
Edit
var float supertrend = na
supertrend := close > nz(supertrend , lowerBand) ? lowerBand : upperBand
The Supertrend value updates dynamically.
If price is above the Supertrend line, the trend is bullish (green).
If price is below the Supertrend line, the trend is bearish (red).
3 Volume Sensitivity Confirmation
📌 Key Purpose:
Avoid false trend flips by confirming with volume (approximated using a CVD proxy).
📌 How it Works:
pinescript
Copy
Edit
priceChange = close - close
volumeWeightedTrend = priceChange * volume // Approximate CVD Behavior
trendConfirmed = volumeWeightedTrend > 0 ? close > supertrend : close < supertrend
Positive price change + High volume → Confirms bullish momentum.
Negative price change + High volume → Confirms bearish momentum.
If there’s low volume, the trend change is ignored to avoid false breakouts.
4 Noise Reduction (Final Trend Confirmation)
📌 Key Purpose:
Filter out weak or choppy price movements using ATR expansion.
📌 How it Works:
pinescript
Copy
Edit
trendUp = trendConfirmed and ta.atr(atrLength) > ta.atr(atrLength)
trendDown = not trendUp
Trend only flips when confirmed by volume + ATR expansion.
If ATR is not expanding, the script ignores weak price movements.
This ensures Supertrend signals align with strong market moves.
5 Can This Be Used on All Timeframes?
✅ YES! This Supertrend is adaptive, meaning it adjusts dynamically based on:
Volatility: Uses ATR expansion to adjust for different market conditions.
Timeframe Sensitivity: Works on any timeframe (1M, 5M, 15M, 1H, 4H, 1D, 1W).
Market Structure: Confirms trend flips using volume & price movement strength.
🚀 Best Timeframes for Trading:
For Scalping (1M - 15M) → Quick execution, best with order flow confirmation.
For Swing Trading (1H - 4H - 1D) → Stronger trend signals, reduced noise.
For High Timeframes (3D - 1W) → Identifies major market shifts.
🔥 Advantages & Disadvantages in Your Trading Setup
✅ Advantages:
✔ Fully Dynamic & Adaptive → Adjusts to different timeframes & volatility.
✔ Reduces False Signals → Uses ATR expansion & volume confirmation.
✔ Precise Trend Reversals → Labels LONG & SHORT entries clearly.
✔ Works on Any Market → Crypto, Forex, Stocks, Commodities.
✔ No Extra Indicators → Pure Supertrend-based (fits your setup).
❌ Disadvantages:
⚠ Lagging Indicator → ATR & volume confirmation add slight delay.
⚠ Needs High Volume to Confirm → Weak volume → no trend flip.
⚠ Choppy Market = Late Entries → Sideways movement can cause delays.
🚀 Final Thoughts:
It’s fully dynamic & adaptive (unlike traditional static Supertrends).
No extra indicators → Uses only Supertrend logic
Refines entry points using volume & ATR confirmation (removes noise).
This ensures you get high-probability trend signals while filtering out weak breakouts! 🎯
[TehThomas] - CandleStick PatternsScript Overview
This script is designed to identify and highlight various candlestick patterns on a trading chart. It detects bullish, bearish, indecisive, and continuation patterns and visually represents them with color-coded bars. Additionally, it displays a table summarizing the detected patterns.
Key Features
Candlestick Pattern Detection
Identifies multiple candlestick patterns, including:
Bullish Patterns: Bullish Engulfing, Hammer, Inverse Hammer, Morning Star, Piercing Line.
Bearish Patterns: Bearish Engulfing, Hanging Man, Shooting Star, Evening Star, Dark Cloud Cover.
Indecisive Patterns: Doji, Dragonfly Doji, Gravestone Doji.
Each pattern is assigned a distinct color for easy visualization.
Customizable Visibility & Colors
Users can enable or disable the detection of specific patterns.
Custom colors can be assigned to each pattern for better chart clarity.
Trend Identification
Uses the Simple Moving Average (SMA) to determine whether the market is in an uptrend or downtrend.
Helps in filtering patterns based on the prevailing trend.
Pattern Highlighting
Changes the color of the candlesticks whenever a pattern is detected.
Uses barcolor() to color the candles accordingly.
Pattern Dashboard (Table Display)
A static table in the top-right corner of the chart summarizes the detected patterns.
Ensures the table is only created once per chart load to avoid performance issues.
Function Breakdown
1. Input Parameters
Uses input.bool() to allow traders to toggle specific patterns on or off.
Uses input.color() to let users customize the colors for different patterns.
2. Candlestick Measurements
bodySize(index): Measures the absolute size of the candle body.
upperWick(index): Measures the upper wick size.
lowerWick(index): Measures the lower wick size.
3. Trend Determination
isUptrend(length): Checks if the price is above its SMA (indicating an uptrend).
isDowntrend(length): Checks if the price is below its SMA (indicating a downtrend).
4. Candlestick Pattern Identification
Engulfing Patterns
Bullish Engulfing: A large green candle fully engulfs the previous red candle, occurring in a downtrend.
Bearish Engulfing: A large red candle fully engulfs the previous green candle, occurring in an uptrend.
Hammer & Related Patterns
Hammer: A candle with a small body and a long lower wick, appearing after a downtrend.
Inverse Hammer: A candle with a small body and a long upper wick, appearing after a downtrend.
Hanging Man: A Hammer-like pattern that appears in an uptrend.
Shooting Star: An Inverse Hammer-like pattern that appears in an uptrend.
Doji Patterns
Doji: A candle with a small body (open and close prices nearly equal).
Dragonfly Doji: A Doji with a long lower wick.
Gravestone Doji: A Doji with a long upper wick.
Star Patterns
Morning Star: A bullish reversal pattern consisting of three candles.
Evening Star: A bearish reversal pattern consisting of three candles.
Continuation Patterns
Piercing Line: A two-candle bullish continuation pattern.
Dark Cloud Cover: A two-candle bearish continuation pattern.
5. Candlestick Coloring
Uses barcolor() to color the candles based on the detected pattern.
The color is determined using a conditional statement, ensuring only one pattern applies per candle.
6. Pattern Dashboard
Uses tables (table.new()) to display a static dashboard with all enabled patterns.
Calls updateTableCell() to add rows for each active pattern.
How This Script is Useful for Trading
1. Identifying Trade Opportunities
Helps traders spot potential reversal points (e.g., Bullish Engulfing, Hammer, Morning Star).
Highlights trend continuation signals (e.g., Piercing Line, Dark Cloud Cover).
2. Confirming Trend Strength
Engulfing patterns in the direction of the trend confirm trend strength.
Doji and indecisive patterns warn traders of potential reversals or trend slowdowns.
3. Enhancing Trade Entries & Exits
Enter long positions after spotting bullish patterns like Morning Star, Hammer.
Exit long positions when bearish patterns like Evening Star, Shooting Star appear.
Enter short positions upon seeing bearish engulfing, Hanging Man, or Dark Cloud Cover.
4. Improving Risk Management
Traders can set stop-loss orders based on the pattern structure.
Example: Placing stop-loss below the low of a Hammer confirms bullish strength.
5. Works with Other Indicators
Can be combined with RSI, MACD, Bollinger Bands for more reliable signals.
Limitations
False Signals: Candlestick patterns alone are not 100% reliable; traders should confirm signals with volume and trend analysis.
No Automatic Alerts: This script does not send trading alerts; manual observation is required.
No Multi-Timeframe Analysis: It only considers the timeframe it is applied to.
Final Thoughts
This script is a powerful visual tool for traders who rely on candlestick patterns. It helps identify potential reversals, continuations, and indecision zones in the market. While it’s highly useful for discretionary trading, it’s best used alongside other technical indicators to confirm trade setups.
BullDozz MA-CandlesticksBullDozz MA-Candlesticks 🏗️📊
The BullDozz MA-Candlesticks indicator transforms traditional candlesticks by replacing their Open, High, Low, and Close values with various types of Moving Averages (MAs). This helps traders visualize market trends with smoother price action, reducing noise and enhancing decision-making.
🔹 Features:
✅ Choose from multiple MA types: SMA, EMA, WMA, DEMA, TEMA, LSMA
✅ Customizable MA period for flexibility
✅ Candlestick colors based on trend: Green for bullish, Red for bearish
✅ Works on any market and timeframe
This indicator is perfect for traders who want a clearer perspective on price movement using moving average-based candlesticks. 🚀 Try it now and refine your market analysis! 📈🔥