Weierstrass Function (Fractal Cycles)THE WEIERSTRASS FUNCTION
f(x) = ∑(n=0)^∞ a^n * cos(b^n * π * x)
The Weierstrass Function is the sum of an infinite series of cosine functions, each with increasing frequency and decreasing amplitude. This creates powerful multi-scale oscillations within the range ⬍(-2;+2), resembling a system of self-repetitive patterns. You can zoom into any part of the output and observe similar proportions, mimicking the hidden order behind the irregularity and unpredictability of financial markets.
IT DOESN’T RELY ON ANY MARKET DATA, AS THE OUTPUT IS BASED PURELY ON A MATHEMATICAL FORMULA!
This script does not provide direct buy or sell signals and should be used as a tool for analyzing the market behavior through fractal geometry. The function is often used to model complex, chaotic systems, including natural phenomena and financial markets.
APPLICATIONS:
Timing Aspect: Identifies the phases of market cycles, helping to keep awareness of frequency of turning points
Price-Modeling features: The Amplitude, frequency, and scaling settings allow the indicator to simulate the trends and oscillations. Its nowhere-differentiable nature aligns with the market's inherent uncertainty. The fractured oscillations resemble sharp jumps, noise, and dips found in volatile markets.
SETTINGS
Amplitude Factor (a): Controls the size of each wave. A higher value makes the waves larger.
Frequency Factor (b): Determines how fast the waves oscillate. A higher value creates more frequent waves.
Ability to Invert the output: Just like any cosine function it starts its journey with a decline, which is not distinctive to the behavior of most assets. The default setting is in "inverted mode".
Scale Factor: Adjusts the speed at which the oscillations grow over time.
Number of Terms (n_terms): Increases the number of waves. More terms add complexity to the pattern.
Cycles
Advanced Multi-Seasonality StrategyThe Multi-Seasonality Strategy is a trading system based on seasonal market patterns. Seasonality refers to recurring market trends driven by predictable calendar-based events. These patterns emerge due to economic cycles, corporate activities (e.g., earnings reports), and investor behavior around specific times of the year. Studies have shown that such effects can influence asset prices over defined periods, leading to opportunities for traders who exploit these patterns (Hirshleifer, 2001; Bouman & Jacobsen, 2002).
How the Strategy Works:
The strategy allows the user to define four distinct periods within a calendar year. For each period, the trader selects:
Entry Date (Month and Day): The date to enter the trade.
Holding Period: The number of trading days to remain in the trade after the entry.
Trade Direction: Whether to take a long or short position during that period.
The system is designed with flexibility, enabling the user to activate or deactivate each of the four periods. The idea is to take advantage of seasonal patterns, such as buying during historically strong periods and selling during weaker ones. A well-known example is the "Sell in May and Go Away" phenomenon, which suggests that stock returns are higher from November to April and weaker from May to October (Bouman & Jacobsen, 2002).
Seasonality in Financial Markets:
Seasonal effects have been documented across different asset classes and markets:
Equities: Stock markets tend to exhibit higher returns during certain months, such as the "January effect," where prices rise after year-end tax-loss selling (Haugen & Lakonishok, 1987).
Commodities: Agricultural commodities often follow seasonal planting and harvesting cycles, which impact supply and demand patterns (Fama & French, 1987).
Forex: Currency pairs may show strength or weakness during specific quarters based on macroeconomic factors, such as fiscal year-end flows or central bank policy decisions.
Scientific Basis:
Research shows that market anomalies like seasonality are linked to behavioral biases and institutional practices. For example, investors may respond to tax incentives at the end of the year, and companies may engage in window dressing (Haugen & Lakonishok, 1987). Additionally, macroeconomic factors, such as monetary policy shifts and holiday trading volumes, can also contribute to predictable seasonal trends (Bouman & Jacobsen, 2002).
Risks of Seasonal Trading:
While the strategy seeks to exploit predictable patterns, there are inherent risks:
Market Changes: Seasonal effects observed in the past may weaken or disappear as market conditions evolve. Increased algorithmic trading, globalization, and policy changes can reduce the reliability of historical patterns (Lo, 2004).
Overfitting: One of the risks in seasonal trading is overfitting the strategy to historical data. A pattern that worked in the past may not necessarily work in the future, especially if it was based on random chance or external factors that no longer apply (Sullivan, Timmermann, & White, 1999).
Liquidity and Volatility: Trading during specific periods may expose the trader to low liquidity, especially around holidays or earnings seasons, leading to slippage and larger-than-expected price swings.
Economic and Geopolitical Shocks: External events such as pandemics, wars, or political instability can disrupt seasonal patterns, leading to unexpected market behavior.
Conclusion:
The Multi-Seasonality Strategy capitalizes on the predictable nature of certain calendar-based patterns in financial markets. By entering and exiting trades based on well-established seasonal effects, traders can potentially capture short-term profits. However, caution is necessary, as market dynamics can change, and seasonal patterns are not guaranteed to persist. Rigorous backtesting, combined with risk management practices, is essential to successfully implementing this strategy.
References:
Bouman, S., & Jacobsen, B. (2002). The Halloween Indicator, "Sell in May and Go Away": Another Puzzle. American Economic Review, 92(5), 1618-1635.
Fama, E. F., & French, K. R. (1987). Commodity Futures Prices: Some Evidence on Forecast Power, Premiums, and the Theory of Storage. Journal of Business, 60(1), 55-73.
Haugen, R. A., & Lakonishok, J. (1987). The Incredible January Effect: The Stock Market's Unsolved Mystery. Dow Jones-Irwin.
Hirshleifer, D. (2001). Investor Psychology and Asset Pricing. Journal of Finance, 56(4), 1533-1597.
Lo, A. W. (2004). The Adaptive Markets Hypothesis: Market Efficiency from an Evolutionary Perspective. Journal of Portfolio Management, 30(5), 15-29.
Sullivan, R., Timmermann, A., & White, H. (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. Journal of Finance, 54(5), 1647-1691.
This strategy harnesses the power of seasonality but requires careful consideration of the risks and potential changes in market behavior over time.
RSI from Rolling VWAP [CHE]Introducing the RSI from Rolling VWAP Indicator
Elevate your trading strategy with the RSI from Rolling VWAP —a cutting-edge indicator designed to provide unparalleled insights and enhance your decision-making on TradingView. This advanced tool seamlessly integrates the Relative Strength Index (RSI) with a Rolling Volume-Weighted Average Price (VWAP) to deliver precise and actionable trading signals.
Why Choose RSI from Rolling VWAP ?
- Clear Trend Detection: Our enhanced algorithms ensure accurate identification of bullish and bearish trends, allowing you to capitalize on market movements with confidence.
- Customizable Time Settings: Tailor the time window in days, hours, and minutes to align perfectly with your unique trading strategy and market conditions.
- Flexible Moving Averages: Select from a variety of moving average types—including SMA, EMA, WMA, and more—to smooth the RSI, providing clearer trend analysis and reducing market noise.
- Threshold Alerts: Define upper and lower RSI thresholds to effortlessly spot overbought or oversold conditions, enabling timely and informed trading decisions.
- Visual Enhancements: Enjoy a visually intuitive interface with color-coded RSI lines, moving averages, and background fills that make interpreting market data straightforward and efficient.
- Automatic Signal Labels: Receive immediate bullish and bearish labels directly on your chart, signaling potential trading opportunities without the need for constant monitoring.
Key Features
- Inspired by Proven Tools: Building upon the robust foundation of TradingView's Rolling VWAP, our indicator offers enhanced functionality and greater precision.
- Volume-Weighted Insights: By incorporating volume into the VWAP calculation, gain a deeper understanding of price movements and market strength.
- User-Friendly Configuration: Easily adjust settings to match your trading preferences, whether you're a novice trader or an experienced professional.
- Hypothesis-Driven Analysis: Utilize hypothetical results to backtest strategies, understanding that past performance does not guarantee future outcomes.
How It Works
1. Data Integration: Utilizes the `hlc3` (average of high, low, and close) as the default data source, with customization options available to suit your trading needs.
2. Dynamic Time Window: Automatically calculates the optimal time window based on an auto timeframe or allows for fixed time periods, ensuring flexibility and adaptability.
3. Rolling VWAP Calculation: Accurately computes the Rolling VWAP by balancing price and volume over the specified time window, providing a reliable benchmark for price action.
4. RSI Analysis: Measures momentum through RSI based on Rolling VWAP changes, smoothed with your chosen moving average for enhanced trend clarity.
5. Actionable Signals: Detects and labels bullish and bearish conditions when RSI crosses predefined thresholds, offering clear indicators for potential market entries and exits.
Seamless Integration with Your TradingView Experience
Adding the RSI from Rolling VWAP to your TradingView charts is straightforward:
1. Add to Chart: Simply copy the Pine Script code into TradingView's Pine Editor and apply it to your desired chart.
2. Customize Settings: Adjust the Source Settings, Time Settings, RSI Settings, MA Settings, and Color Settings to align with your trading strategy.
3. Monitor Signals: Watch for RSI crossings above or below your set thresholds, accompanied by clear labels indicating bullish or bearish trends.
4. Optimize Your Trades: Leverage the visual and analytical strengths of the indicator to make informed buy or sell decisions, maximizing your trading potential.
Disclaimer:
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Get Started Today
Transform your trading approach with the RSI from Rolling VWAP indicator. Experience the synergy of momentum and volume-based analysis, and unlock the potential for more accurate and profitable trades.
Download now and take the first step towards a more informed and strategic trading journey!
For further inquiries or support, feel free to contact
Best regards
Chervolino
Inspired by the acclaimed Rolling VWAP by TradingView
(MA-EWMA) with ChannelsHamming Windowed Volume-Weighted Bidirectional Momentum-Adaptive Exponential Weighted Moving Average
This script is an advanced financial indicator that calculates a Hamming Windowed Volume-Weighted Bidirectional Momentum-Adaptive Exponential Weighted Moving Average (MA-EWMA). It adapts dynamically to market conditions, adjusting key parameters like lookback period, momentum length, and volatility sensitivity based on price volatility.
Key Components:
Dynamic Adjustments: The indicator adjusts its lookback and momentum length using the ATR (Average True Range), making it more responsive to volatile markets.
Volume Weighting: It incorporates volume data, weighting the moving average based on the volume activity, adding further sensitivity to price movement.
Bidirectional Momentum: It calculates upward and downward momentum separately, using these values to determine the directional weighting of the moving average.
Hamming Window: This technique smooths the price data by applying a Hamming window, which helps to reduce noise in the data and enhances the accuracy of the moving average.
Channels: Instead of plotting a single line, the script creates dynamic channels, providing more context for support and resistance levels based on the market's behavior.
The result is a highly adaptive and sophisticated moving average indicator that responds dynamically to both price momentum and volume trends.
VIDYA with Dynamic Length Based on ICPThis script is a Pine Script-based indicator that combines two key concepts: the Instantaneous Cycle Period (ICP) from Dr. John Ehlers and the Variable Index Dynamic Average (VIDYA). Here's an overview of how the script works:
Components:
Instantaneous Cycle Period (ICP):
This part of the indicator uses Dr. John Ehlers' approach to detect the market cycle length dynamically. It calculates the phase of price movement by computing the in-phase and quadrature components of the price detrended over a specific period.
The ICP helps adjust the smoothing length dynamically, giving a real-time estimate of the dominant cycle in price action. The script uses a phase calculation, adjusts it for cycle dynamics, and smoothes it for more reliable readings.
VIDYA (Variable Index Dynamic Average):
VIDYA is a moving average that dynamically adjusts its smoothing length based on the market conditions, in this case, using the RSI (Relative Strength Index) as a weight.
The length of VIDYA is determined by the dynamically calculated ICP, allowing it to adapt to changing market cycles.
This indicator performs several recursive layers of VIDYA smoothing (applying VIDYA multiple times) to provide a more refined result.
Key Features:
Dynamic Length: The length for the VIDYA calculation is derived from the smoothed ICP value, meaning that the smoothing adapts to the detected cycle length in real-time, making the indicator more responsive to market conditions.
Multiple VIDYA Layers: The script applies multiple layers of VIDYA smoothing (up to 5 iterations), further refining the output to smooth out market noise while maintaining responsiveness.
Plotting: The final smoothed VIDYA value and the smoothed ICP length are plotted. Additionally, overbought (70) and oversold (30) horizontal lines are provided for visual reference.
Application:
This indicator helps identify trends, smooths out price data, and adapts dynamically to market cycles. It's useful for detecting shifts in momentum and trends, and traders can use it to identify overbought or oversold conditions based on dynamically calculated thresholds.
Optimized WaveletsThe script, High-Resolution Volume-Price Pressure Indicator with Wavelets, utilizes wavelet transforms and high-resolution data to analyze market pressure based on volume and price dynamics. The approach combines volume data from smaller timeframes (1 second) with non-linear transformation techniques to generate a refined view of market conditions. Here’s a detailed breakdown of how it works:
Key Components:
Wavelet Transform:
A wavelet function is applied to the price and volume data to capture patterns over a set time period. This technique helps identify underlying structures in the data that might be missed with traditional moving averages.
High-Resolution Data:
The indicator fetches 1-second high-resolution data for price movements and volume. This allows the strategy to capture granular price and volume changes, crucial for short-term trading decisions.
Normalized Difference:
The script calculates the normalized difference in price and volume data. By comparing changes over the selected length, it standardizes these movements to help detect sudden shifts in market pressure.
Sigmoid Transformation:
After combining the price and volume wavelet data, a sigmoid function is applied to smooth out the resulting values. This non-linear transformation helps highlight significant moves while filtering out minor fluctuations.
Volume-Price Pressure:
The up and down volume differences, together with price movements, are combined to create a "Volume-Price Pressure Score." The final indicator reflects the pressure exerted on the market by both buyers and sellers.
Indicator Plot:
The final transformed score is plotted, showing how price and volume dynamics, combined through wavelet transformation, interact. The indicator can be used to identify potential market turning points or pressure buildups based on volume and price movement patterns.
This approach is well-suited for traders looking for advanced signal detection based on high-frequency data and can provide insight into areas where typical indicators may lag or overlook short-term volatility.
Sweep + MSS# Sweep + MSS Indicator
This indicator identifies market sweeps and Market Structure Shifts (MSS) to help traders recognize potential trend changes and market manipulations.
How it works:
1. Sweep Detection:
- Identifies when price briefly moves beyond a recent high/low (pivot point) and then reverses.
- Bullish sweep: Price drops below a recent low, then closes above it.
- Bearish sweep: Price rises above a recent high, then closes below it.
2. Market Structure Shift (MSS):
- Occurs when price action invalidates a previous sweep level.
- Bullish MSS: Price closes above a bearish sweep level.
- Bearish MSS: Price closes below a bullish sweep level.
Key Features:
- Customizable pivot lookback length for sweep detection
- Minimum bar requirement after a sweep before MSS can trigger
- One MSS per sweep level to avoid multiple signals
- Visual representation with lines connecting sweep points to MSS triggers
- Emoji labels for easy identification (🐂-MSS for bullish, 🐻-MSS for bearish)
Logic Behind MSS:
The MSS aims to identify potential trend changes by recognizing when the market invalidates a previous sweep level. This often indicates a shift in market structure, suggesting that the previous trend may be weakening or reversing.
- A bullish MSS occurs when the price closes above a bearish sweep level, potentially signaling a shift from bearish to bullish sentiment.
- A bearish MSS occurs when the price closes below a bullish sweep level, potentially signaling a shift from bullish to bearish sentiment.
By requiring a minimum number of bars between the sweep and the MSS, the indicator helps filter out noise and focuses on more significant structural changes in the market.
This indicator can be a valuable tool for traders looking to identify potential trend changes and entry/exit points based on market structure analysis.
Fluid Dynamics-Inspired Indicator with Bidirectional ScalingThe "Enhanced Fluid Dynamics-Inspired Indicator with Bidirectional Scaling" is a sophisticated technical analysis tool that draws inspiration from the principles of fluid dynamics to measure both upward and downward price movements, while also incorporating volatility and momentum into its calculations. The indicator aims to provide traders with a clear understanding of market dynamics by analyzing "streamflow" (price and volume movements) in both directions, enhanced with adaptive scaling techniques.
Key Features:
Bidirectional Price Momentum:
The indicator separately calculates positive and negative momentum using the price's rate of change. This allows for independent analysis of upward and downward price movements, providing a balanced view of the market's direction.
Streamflow Model:
The "streamflow" is calculated by multiplying volume flow with price momentum. This approach treats the market as a fluid system, where the momentum and volume of trades influence the flow of prices in both upward and downward directions. Streamflow is calculated independently for each direction.
Adaptive Volatility Scaling:
Volatility is dynamically calculated using the Average True Range (ATR) and is weighted to adjust to varying market conditions. An adaptive logarithmic scaling factor is applied to the volatility to capture the dynamic nature of market environments.
DRMA (Displaced Rolling Moving Average):
The indicator uses the DRMA function to smooth out price and volume data, improving the accuracy of its measurements. This allows the indicator to capture longer-term trends while still being responsive to short-term fluctuations.
Non-Linear Scaling and Normalization:
To ensure that the output values are within a usable range, the indicator employs a sigmoid-based non-linear scaling function. This helps normalize the composite output, making it easier to interpret overbought and oversold conditions.
Visual Representation:
The indicator plots two separate lines for upward and downward market movements, making it easy to distinguish between bullish and bearish trends. Background colors are also used to highlight periods of strong upward or downward momentum, as well as high volatility.
Overbought/Oversold Conditions:
Upper and lower thresholds are used to signal potential overbought and oversold conditions. Alerts are triggered when the market moves into extreme levels, helping traders identify potential entry and exit points.
Usage:
This indicator is designed for traders who are looking for a more nuanced and dynamic tool to measure both bullish and bearish trends. By using bidirectional scaling, it provides clearer signals for market direction, while adaptive volatility and momentum adjustments ensure the indicator responds to different market environments. The alert conditions make it especially useful for timing trades in highly volatile conditions or when price movements reach extreme levels.
Fractal & Entropy Market Dynamics with Mexican Hat WaveletThis indicator combines fractal analysis, entropy, and wavelet theory to model market dynamics using a customized approach. It integrates advanced mathematical techniques to assess the complexity and structure of price action, while also incorporating volume and price volatility.
Key Concepts and Features:
Volume-Weighted Price:
The script calculates a volume-adjusted price using a moving average of volume to give more weight to periods with higher volume. This allows the indicator to account for the impact of trading volume on price movements, enhancing its sensitivity to significant price shifts.
Mexican Hat Wavelet Approximation:
The script employs the Mexican Hat Wavelet, a mathematical tool that approximates price movements based on the Laplacian of the price series. This helps capture localized oscillations in price, acting as a filter to highlight certain price dynamics over the specified length. This wavelet is commonly used to identify key inflection points and trends in financial data.
Fractal Dimension Calculation:
The fractal dimension is calculated to quantify the market's complexity. It measures how price moves between intervals, with higher values indicating chaotic or more volatile market behavior. This dimension captures the self-similarity in price movements across different time frames, a key feature of fractals.
Shannon Entropy Calculation:
Shannon Entropy is used to measure the randomness or uncertainty in the price action. It calculates the degree of unpredictability based on the price changes, providing insight into the market's informational efficiency. Higher entropy indicates more randomness, while lower entropy suggests more predictable trends.
Custom Normalization:
The script includes a custom normalization function that processes the composite score (derived from fractal dimension and entropy). This normalization helps scale the values into a consistent range, making it easier to interpret the output. The smoothing factor and RSI-based approach ensure that the normalized value reacts smoothly to the changes in market dynamics.
Composite Score:
The composite score is a weighted combination of the fractal dimension and entropy. This score aims to provide a holistic view of the market by combining the structural complexity (fractal) and randomness (entropy) into one unified metric.
Plotting and Visuals:
The indicator plots the normalized composite score on a scale where a baseline of 50 is provided for reference. The resulting plot helps traders visualize market dynamics, with the score fluctuating based on changes in the market's fractal dimension and entropy. A score above or below the baseline of 50 indicates potential market shifts.
Use Case:
The "Enhanced Fractal and Entropy Market Dynamics with Mexican Hat Wavelet" is useful for traders looking to identify market conditions where there is a balance between price structure and randomness. By integrating wavelets, fractals, and entropy, the indicator can provide insights into market complexity, helping traders recognize potential trend reversals, periods of consolidation, or increased volatility. This can be particularly effective for those employing swing trading or trend-following strategies
Bernoulli Price Dynamics with IntraBar Volume (Bidirectional)This indicator adapts the principles of Bernoulli’s equation from fluid dynamics to analyze price and volume dynamics in the market. By incorporating intrabar volume data and splitting price movements into upward and downward components, it provides a bidirectional view of the market's kinetic and potential energies. This approach helps assess market pressure in both upward and downward directions, offering insights into potential price movement with energy-based mechanics.
Key Features:
Intrabar Volume Integration: The indicator collects up and down volume data from a lower timeframe, such as seconds or minutes, to provide more granular insights.
Bidirectional Market Pressure: By separating upward and downward price movements, it calculates market pressure in both directions, which is akin to fluid pressure. The separation enables tracking of distinct upward and downward energy flows in the market.
Energy Calculation:
Kinetic Energy: This represents the "movement" aspect of the price, weighted by volume. It is calculated for both upward and downward movements based on price velocity squared.
Potential Energy: This represents the "position" aspect of the price, calculated as the product of volume and the current price level. It is also separated into upward and downward components.
Market Pressure: The difference between the total energy (sum of kinetic and potential energies) and the highest observed total energy over a defined period (N). This provides an insight into the current momentum of price movement in both directions.
Visualization:
Market Pressure Up/Down: Plots the calculated market pressure for upward (green) and downward (red) movements.
Kinetic and Potential Energies: Provides individual plots for kinetic and potential energy in both directions to analyze the behavior of price and volume in more detail.
This indicator can be used to track market momentum and potential reversals by understanding the energy and pressure dynamics in both upward and downward price movements.
Earnings Surprise Indicator (Post-Earnings Announcement Drift)What It Does:
- Displays a company's actual earnings vs. analysts' estimates over time
- Shows "earnings surprises" - when actual results beat or miss expectations
- Helps identify trends in a company's financial performance
How It Works:
- Green bars: Positive surprise (earnings beat estimates)
- Red bars: Negative surprise (earnings missed estimates)
- Yellow line: Analysts' earnings estimates
Correlation with Post Earnings Announcement Drift (PEAD): PEAD is the tendency for a stock's price to drift in the direction of an earnings surprise for several weeks or months after the announcement.
Why It Matters:
- Positive surprises often lead to upward price drift
- Negative surprises often lead to downward price drift
- This drift can create trading opportunities
How to Use It:
1. Spot Trends:
- Consistent beats may indicate strong company performance
- Consistent misses may signal underlying issues
2. Gauge Market Expectations:
- Large surprises may lead to significant price movements
3. Timing Decisions:
- Consider long positions after positive surprises
- Consider short positions or exits after negative surprises
4. Risk Management:
- Be cautious of reversal if the drift seems excessive
- Use in conjunction with other technical and fundamental analysis
Key Takeaways:
- Earnings surprises can be fundamental-leading indicators of future stock performance, especially when correlated with analyst projections
- PEAD suggests that markets often underreact to earnings news initially
- This indicator helps visualize the magnitude and direction of surprises
- It can be a valuable tool for timing entry and exit points in trades
Profitable Mondays & Losing FridaysHere's a Pine Script that marks profitable Mondays and losing Fridays for a given stock:
Explanation
Input Parameter: The script allows you to input the stock symbol, defaulting to SPX.
Daily Returns: It calculates the daily return based on the closing price.
Day Identification: It checks if the current day is Monday or Friday.
Conditions:
Profitable Mondays: Marks with a green background if Monday's return is positive.
Losing Fridays: Marks with a red background if Friday's return is negative.
Visualization: Uses bgcolor to highlight the respective days on the chart.
You can adjust the stockSymbol input to analyze different stocks.
RSI Ignoring Gaps Between DaysThe RSI Ignoring Gaps Between Days indicator is an advanced modification of the traditional Relative Strength Index (RSI) designed to exclude price gaps that occur between the last bar of one trading day and the first bar of the next. This ensures that the RSI calculations remain focused on the actual price action during the trading session, avoiding distortions caused by overnight price gaps.
Key Features:
Gap Ignoring Mechanism: The indicator detects when a new day begins and skips the price change between the last bar of the previous day and the first bar of the current day. This ensures that only the intra-day price changes are included in the RSI calculation.
Intra-day Price Movement: The RSI calculations are based on real price changes within each trading day, providing a clearer reflection of momentum without interference from overnight events.
Dynamic RSI Calculation: The traditional RSI formula is preserved, but gains and losses are recalculated based on price changes from bar to bar within the same day.
Overbought/Oversold Levels: The indicator retains standard RSI overbought (70) and oversold (30) levels, allowing traders to easily identify potential reversal zones.
Alerts for Crossovers: Built-in alert conditions trigger when the RSI crosses key levels (30 or 70), signaling potential buying or selling opportunities.
This indicator is particularly useful for traders looking to focus on intra-day price action and avoid the influence of gaps caused by overnight market activity. It is suitable for intraday trading strategies where consistency in price movement measurement is crucial.
AndreundCristianIndicator Overview:
The "Trade Signals with Volume" indicator is a custom script that generates buy and sell signals based on the crossover of two moving averages (a fast one and a slow one) and adds a volume filter to validate these signals. It plots these signals directly on the chart, using arrows or labels to indicate where buy and sell signals occur.
Key Features:
Moving Averages (MA):
The indicator uses two Simple Moving Averages (SMA): a fast SMA and a slow SMA.
A buy signal is triggered when the fast MA crosses above the slow MA, signaling potential bullish momentum.
A sell signal is triggered when the fast MA crosses below the slow MA, indicating potential bearish momentum.
Volume Filter:
To ensure that signals are more reliable, the indicator only triggers a buy or sell signal if the volume is above a certain threshold. This threshold can be adjusted by the user in the input settings.
For example, if the volume exceeds 100,000 (or any set value), and a crossover occurs, the signal is validated.
Visual Representation:
Buy signals are represented with green labels or arrows below the price bars.
Sell signals are represented with red labels or arrows above the price bars.
The MAs are also plotted on the chart for visual reference.
Input Parameters:
Fast Moving Average Length: The number of periods for the fast SMA (default is 9 periods).
Slow Moving Average Length: The number of periods for the slow SMA (default is 21 periods).
Volume Threshold: The minimum volume required to validate a buy or sell signal (default is 100,000).
NYSE, Euronext, and Shanghai Stock Exchange Hours IndicatorNYSE, Euronext, and Shanghai Stock Exchange Hours Indicator
This script is designed to enhance your trading experience by visually marking the opening and closing hours of major global stock exchanges: the New York Stock Exchange (NYSE), Euronext, and Shanghai Stock Exchange. By adding vertical lines and background fills during trading sessions, it helps traders quickly identify these critical periods, potentially informing better trading decisions.
Features of This Indicator:
NYSE, Euronext, and Shanghai Stock Exchange Hours: Displays vertical lines at market open and close times for these three exchanges. You can easily switch between showing or hiding the different exchanges to customize the indicator for your needs.
Background Fill: Highlights the trading hours of these exchanges using faint background colors, making it easy to spot when markets are in session. This feature is crucial for timing trades around overlapping trading hours and volume peaks.
Customizable Visuals: Adjust the color, line style (solid, dotted, dashed), and line width to match your preferences, making the indicator both functional and visually aligned with your chart's aesthetics.
How to Use the Indicator:
Add the Indicator to Your Chart: Add the script to your chart from the TradingView script library. Once added, the indicator will automatically plot vertical lines at the opening and closing times of the NYSE, Euronext, and Shanghai Stock Exchange.
Customize Display Settings: Choose which exchanges to display by enabling or disabling the NYSE, Euronext, or Shanghai sessions in the indicator settings. This allows you to focus only on the exchanges that are relevant to your trading strategy.
Adjust Visual Properties: Customize the appearance of the vertical lines and background fill through the settings. Modify the color of each exchange, adjust the line style (solid, dotted, dashed), and control the line thickness to suit your chart preferences. The background fill can also be customized to clearly highlight active trading sessions.
Identify Key Market Hours: Use the vertical lines and background fills to identify the market open and close times. This is particularly useful for understanding how price action changes during specific trading hours or for finding high liquidity periods when multiple markets are open simultaneously.
Adapt Trading Strategies: By knowing when major stock exchanges are open, you can adapt your trading strategy to take advantage of potential price movements, increased volatility, or volume. This can help you avoid low-liquidity times and capitalize on more active trading periods.
This indicator is especially valuable for traders focusing on cross-market dynamics or those interested in understanding how different sessions influence market liquidity and price action. With this tool, you can gain insight into market conditions and adapt your trading strategies accordingly. The clean visual separation of session times helps you maintain context, whether you're trading Forex, stocks, or cryptocurrencies.
Disclaimer: This script is intended for informational and educational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. Always conduct your own research and consult with a licensed financial advisor before making any trading decisions. Trading involves risk, and past performance is not indicative of future results.
Prometheus Fractal-Based TrendThe Fractal-Based Trend indicator is a tool that uses fractals to try and detect which direction an underlying will continue to go.
Calculation:
A bullish fractal occurs when the current bar's high is lower than the previous bar high, and the previous bar's high is higher than both the high from two bars ago and the high from three bars ago.
A bearish fractal happens when the current bar's low is higher than the previous bar's low, and the previous bar's low is lower than both the low from two bars ago and the low from three bars ago.
When a bullish or bearish fractal forms, the corresponding value stored is the previous bar high for a bearish fractal or the previous bar's low for a bullish fractal.
The trade scenarios are when these fractals occur, a green or red label being plotted on the chart for whatever direction it predicts.
Trade examples:
We see on this daily chart of AMEX:SPY that the fractals represent the potential for a directional trade that can last a few days. The more volatile a chart is the more of these fractals we can see.
We see on this 5 minute chart for NASDAQ:TSLA there is way more activity, there are more sporadic candles on a lower time frame, so we can see more anomalies in the price action.
We see this to be true for BITSTAMP:BTCUSD even on a daily time frame, since it is very volatile. There are a lot of these labels plotted.
This is the perspective we aim to provide. We encourage traders to not follow indicators blindly. No indicator is 100% accurate. This one can give you a different perspective of price strength with volatility. We encourage any comments about desired updates or criticism!
Market Phases [OmegaTools]The Market Phases indicator utilizes the Detrended Price Oscillator (DPO) to assess various asset classes, bonds, or stock sectors across different market phases. It offers users the ability to monitor and compare trends in multiple markets through a normalized DPO approach, providing insights into relative overbought or oversold conditions. The indicator supports three distinct modes: "Asset Classes," "Bonds," and "Stock Sectors," allowing flexibility in market analysis based on user preference.
Key Features:
Detrended Price Oscillator (DPO) Calculation: The DPO is computed to remove longer-term trends and focus on shorter-term cyclical behavior. The indicator applies normalization using linear interpolation to smooth out the values for better comparison across different markets.
Three Analysis Modes:
Asset Classes: Compares the DPO for major asset classes, including stocks (S&P 500), bonds (US 10-Year), commodities (Gold), and the US Dollar Index (DXY).
Bonds: Analyzes the DPO across various bond categories such as investment-grade bonds (LQD), high-yield bonds (HYG), emerging market bonds (EMB), and corporate bonds.
Stock Sectors: Provides insight into key stock sectors, including Technology (XLK), Utilities (XLU), Financials (XLF), and Healthcare (XLV).
Real-Time Plotting:
The indicator plots the DPO values of the selected assets, bonds, or sectors on the chart. It provides a visual representation of the market phases, helping to identify potential market reversals or trends. Each plot is color-coded for clarity:
Blue: Asset/Sector 1
Red: Asset/Sector 2
Green: Asset/Sector 3
Orange: Asset/Sector 4
Table Display:
A dynamic table is displayed on the chart, showing the DPO values for the selected mode's assets or sectors. This allows quick comparison and evaluation of market trends.
Inputs:
DPO Length: Defines the lookback period for DPO calculation, adjustable between 10 and 500.
Normalization Length: Sets the length for normalizing the DPO values, with options ranging from 100 to 2000.
Mode: Choose between "Asset Classes," "Bonds," or "Stock Sectors" for tailored market analysis.
This tool is perfect for traders seeking to identify cyclical market phases, compare different asset classes, or monitor sector rotation dynamics. Use it to align your trading strategies with broader market trends and uncover potential trading opportunities across multiple markets.
Hide Days"Hide Days" Pine Script Indicator
The "Hide Days" indicator is designed to make specific days of the week less visible by altering the candle colors, making them blend into the background. This can help traders focus on specific trading days by hiding unwanted candles from view.
Features:
Selectable Days: Users can choose which days of the week to hide (Sunday through Saturday).
Dark Mode Toggle: A built-in "Dark Mode" option provides an optimized display based on the user's TradingView theme, setting hidden candles to a nearly invisible color that matches the background.
Dark Mode ON: Candles are set to dark gray (#151924).
Dark Mode OFF: Candles are set to white (#ffffff).
Simple Inputs: The indicator provides checkboxes for each day, making customization quick and easy.
Enhanced Focus: Useful for traders who want to focus on specific trading sessions or eliminate less relevant days from their chart view.
Use Cases:
Hide weekend data on charts to focus on weekdays.
Remove non-trading days to analyze market movements more effectively.
Adjust the indicator to blend with either dark or light chart themes.
Ultimate Fibonacci Trading Tool [CHE]Ultimate Fibonacci Trading Tool – Your Key to More Precise Trading Decisions!
Description:
Discover the Ultimate Fibonacci Trading Tool , a powerful instrument designed to revolutionize your technical analysis. This tool is crafted to assist traders of all experience levels in better understanding market movements and making informed decisions. By utilizing a higher reference period from the past, it provides you with a clear advantage in identifying critical support and resistance levels.
🌟 Key Features in Detail:
1. Automatic Timeframe Selection:
- Auto Timeframe: The tool automatically detects the optimal higher reference period based on your current chart, providing more precise analysis without additional effort.
- Multiplier Mode: Define the higher timeframe using a multiplier. By default set to 5, this can be adjusted to suit your individual needs.
- Manual Selection: For maximum control, you can manually select the desired timeframe.
2. Customizable Fibonacci Levels:
- Enable/Disable Levels: Toggle specific Fibonacci levels (e.g., 0.236, 0.382, 0.5, 0.618, etc.) on or off to personalize your analysis.
- User-Defined Values: Input custom numerical values for each level to support specialized Fibonacci calculations.
- Color Customization: Choose individual colors for each level to keep your charts clear and visually appealing.
3. Automatic Trend Detection:
- The tool automatically identifies whether the market is in a bullish or bearish trend and adjusts the Fibonacci calculations accordingly, ensuring you always have the most relevant information at hand.
4. Period Separators with Start and Stop Labels:
- Customizable Separator Lines: Visualize the beginning of new time periods with lines that you can customize in style, color, and width.
- Start/Stop Labels: Clear markers help you instantly recognize critical time points and potential trend changes.
5. Flexible Label Management:
- Display Styles: Decide how Fibonacci levels are presented—percentage, price level, or both—so you get the information most important to you.
- Size Adjustment: Modify the size of the labels to optimize readability on your chart.
- Positioning: Place labels where they make the most sense for your analysis.
6. Informative Time Period Display:
- Customizable Info Box: Keep track of the reference period used with a customizable information box displayed directly on your chart.
- Layout Options: Determine the size, position, background, and text colors for seamless integration into your chart environment.
🔧 Detailed Settings Options:
- Timeframe Selection:
- Timeframe Type: Choose between "Auto Timeframe," "Multiplier," or "Manual" to control how the reference period is calculated.
- Multiplier: Set the multiplier when using the "Multiplier" mode; this value determines how many units of the current timeframe are used as the reference.
- Manual Resolution: If "Manual" is selected, you can input the exact timeframe (e.g., "60," "1D," "1W").
- Fibonacci Level Settings:
- Enabling Individual Levels: Toggle each Fibonacci level on or off according to your preference.
- Adjusting Level Values: Enter custom numerical values for each level to perform specialized calculations.
- Color Selection: Choose a unique color for each level to ensure clear differentiation.
- Period Separator Settings:
- Separator Color: Define the color of the separator lines to make them distinctly visible.
- Separator Style: Choose between "Solid," "Dashed," or "Dotted" to adjust the style of the separator lines.
- Separator Width: Set the width of the separator lines to match your chart aesthetics.
- Label Management:
- Label Style: Select how labels are displayed:
- Default: Shows both percentage and price.
- None: No labels are displayed.
- Percentage: Shows only the Fibonacci level percentage.
- Price: Shows only the price at the Fibonacci level.
- Label Size: Adjust the size of the labels (tiny, small, normal, large, huge) for optimal readability.
- Time Period Display:
- Show Time Period: Enable or disable the information box displaying the reference period.
- Size: Choose the size of the information box (tiny, small, normal, large, huge, auto).
- Positioning: Set the vertical (top, middle, bottom) and horizontal (left, center, right) position of the box.
- Color Customization: Select the background and text color of the information box to integrate it into your chart design.
📈 Why Is the Higher Reference Period Important?
The Ultimate Fibonacci Trading Tool leverages a higher reference period from the past to calculate Fibonacci levels. This approach offers several advantages:
- Deeper Market Analysis: By considering longer timeframes, you can uncover major market movements and trends that might be hidden in shorter periods.
- More Accurate Support and Resistance Levels: Higher timeframes provide more robust Fibonacci levels that are observed by many market participants.
- Better Decision-Making Foundation: With a comprehensive view of the market, you can make more informed trading decisions and minimize potential risks.
🎯 How This Tool Enhances Your Trading Strategy:
- Increased Efficiency: Automate complex calculations and save valuable time.
- Personalized Analysis: Adapt the tool to your individual needs and strategies.
- Enhanced Precision: Utilize precise Fibonacci levels to better determine entry and exit points.
- Improved Market Insight: Gain deeper understanding of market trends and structures by using higher timeframes.
🚀 Get Started Now!
Don't miss the opportunity to revolutionize your chart analysis. Integrate the Ultimate Fibonacci Trading Tool into your trading routine and benefit from more precise analyses and improved trading decisions.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Best regards
Chervolino
Leonid's Bitcoin Full Cycle Simple SMA IndicatorThis is a straight-forward and customizable indicator to track Bitcoin cycles, specifically used for helping investors understand where to buy and sell. This is done by using a two year SMA period as the base calculation. With that calculation you create lower and upper bounds for bull market peaks and bear market bottoms.
The novel idea here is that you can customize the SMA "strength" for both the upper and lower bounds as alpha decays over time and price get's less volatile with adoption increasing. The multiples are customizable for both the upper and lower bounds along with a mid-line that will adjust based on the settings input.
Indicators don't always have to rely on crazy math or outlandish ideas to be useful, sometimes even the simplest of inputs can give investors (especially those that are new) a great base case for their strategy. Something being simple does not diminish the idea or strength behind the data.
How to use this indicator: This script must be used on INDEX:BTCUSD (Bitcoin All-Time History Index) with the y-axis being set to Logarithmic scale.
Details & how to interpret: The price is colored green when Bitcoin enters a "value zone" meaning it is heavily oversold and likely near a bottom for the bear market cycle. The price is colored red when Bitcoin enters an "overbought zone" meaning it is heavily overbought and is likely near a top for the bull market cycle.
Along with the upper and lower bound I have plotted a mid-line (in orange) to establish a neutral zone which helps depict what phase of the cycle we're in (under mid-line = bearish/accumulation phase, over mid-line = bullish/distribution phase).
The inputs for the upper and lower bound are customizable and will need to be adjusted over time as alpha decay will occur as time goes on. Currently the numbers are as follows:
0.2 for the lower bound
4.675 for the upper bound
Both inputs can be modified depending on your risk tolerance. Mathematically it is safe to assume these numbers will decrease as time goes on and volatility during cycle peaks & troughs is reduced.
I've also plotted an upper bound "heat zone" which is shaded in green, this area is great for signaling when you should be preparing to begin taking profits. It takes the upper bound and subtracts the lower bound to derive the band.
All the colors are customizable and this indicator is best used on a line chart but can be customized to use on a bar chart/candlestick as well.
Simple Moving Averages are a very basic indicator but are often extremely powerful because the majority of traders/investors are looking at such levels which creates a psychological/herd effect. Another good example is the law of round numbers.
Regardless this script can be adapted with EMAs or additional standard deviations if necessary. If you have any questions or concerns please don't hesitate to message me.
Z-Scored Pi Cycle Top & BottomThis indicator calculates the Z-score of the Pi Cycle Top & Bottom indicator to identify potential market cycle tops and bottoms. It uses the relationship between two EMAs (111 and 350) to assess the price action and applies a Z-score to determine how far the current value deviates from the mean, providing a normalized measure of overbought and oversold conditions.
Summary:
The Z-Scored Pi Cycle Top & Bottom indicator is designed to help traders identify significant market cycle extremes by applying a Z-score to the Pi Cycle Top & Bottom ratio (EMA 111/EMA 350). This normalized score ranges between -2.99 and 2.99, with values near the extremes suggesting potential market tops or bottoms. Green shading indicates a positive Z-score (potential top), while red shading indicates a negative Z-score (potential bottom).
Use this indicator to gauge where the market stands relative to historical tops and bottoms, allowing for more informed decision-making in both bull and bear markets. The indicator also displays the absolute value of the Z-score in the label, helping traders easily visualize how far the current market is from historical extremes.
**I did not come up with or create this indicator I have just z scored it and made it easier for myself to use.***
Financial Crisis Predictor - Doomsday ClockThe **Financial Crisis Predictor - Doomsday Clock** is a composite indicator that evaluates multiple market conditions to determine financial risk levels. It combines four key metrics: market volatility (via VIX), yield curve spread, stock market momentum, and credit risk (via high-yield spread). Each metric contributes to a weighted "risk score," scaled between 0 and 100, which helps gauge the probability of a financial crisis. Here's a breakdown of how it works:
### 1. **Market Volatility (VIX)**
- **How it's measured:**
- Uses the VIX index, which represents expected market volatility.
- Applies two exponential moving averages (EMAs) to smooth out the data—one fast and one slow.
- Triggers a signal if the fast EMA crosses above the slow EMA and VIX exceeds a defined threshold (default is 30).
- **Weighting:**
- Contributes up to 35% of the total risk score when active.
### 2. **Yield Curve Spread**
- **How it's measured:**
- Takes the difference between the yields of 10-year and 2-year U.S. Treasury bonds (inversion indicates recession risk).
- If the spread drops below a certain threshold (default is 0.2), it signals a potential recession.
- **Weighting:**
- Contributes up to 25% of the risk score.
### 3. **Stock Market Momentum**
- **How it's measured:**
- Analyzes the S&P 500 (SPY) using a 20-day EMA for price momentum.
- Checks for a cross under the 20-day EMA and if the 5-day rate of change (ROC) is less than -2.
- This combination signals bearish market momentum.
- **Weighting:**
- Contributes up to 20% of the risk score.
### 4. **Credit Risk (High Yield Spread)**
- **How it's measured:**
- Assesses high-yield corporate bond spreads using EMAs, similar to the VIX logic.
- A crossover of the fast EMA above the slow EMA combined with spreads exceeding a defined threshold (default is 5.0) indicates increased credit risk.
- **Weighting:**
- Contributes up to 20% of the total risk score.
### 5. **Risk Score Calculation**
- The final **risk score** ranges from 0 to 100 and is calculated using the weighted sum of the four indicators.
- The score is smoothed to minimize false signals and maintain stability.
### 6. **Risk Zones**
- **Extreme Risk:** If the risk score is ≥ 75, indicating a severe crisis warning.
- **High Risk:** If the risk score is between 15 and 75, signaling heightened risk.
- **Moderate Risk:** If the risk score is between 10 and 15, representing potential concerns.
- **Low Risk:** If the risk score is < 10, suggesting stable conditions.
### 7. **Visual & Alerts**
- The indicator plots the risk score on a chart with color-coded backgrounds to indicate risk levels: green (low), yellow (moderate), orange (high), and red (extreme).
- Alert conditions are set for each risk zone, notifying users when the risk level transitions into a higher zone.
This indicator aims to quickly detect potential financial crises by aggregating signals from key market factors, making it a versatile tool for traders, analysts, and risk managers.
Altcoins vs BTC Market Cap HeatmapAltcoins vs BTC Market Cap Heatmap
"Ground control to major Tom" 🌙 👨🚀 🚀
This indicator provides a visual heatmap for tracking the relationship between the market cap of altcoins (TOTAL3) and Bitcoin (BTC). The primary goal is to identify potential market cycle tops and bottoms by analyzing how the TOTAL3 market cap (all cryptocurrencies excluding Bitcoin and Ethereum) compares to Bitcoin’s market cap.
Key Features:
• Market Cap Ratio: Plots the ratio of TOTAL3 to BTC market caps to give a clear visual representation of altcoin strength versus Bitcoin.
• Heatmap: Colors the background red when altcoins are overheating (TOTAL3 market cap equals or exceeds BTC) and blue when altcoins are cooling (TOTAL3 market cap is half or less than BTC).
• Threshold Levels: Includes horizontal lines at 1 (Overheated), 0.75 (Median), and 0.5 (Cooling) for easy reference.
• Alerts: Set alert conditions for when the ratio crosses key levels (1.0, 0.75, and 0.5), enabling timely notifications for potential market shifts.
How It Works:
• Overheated (Ratio ≥ 1): Indicates that the altcoin market cap is on par or larger than Bitcoin's, which could signal a top in the cycle.
• Cooling (Ratio < 0.5): Suggests that the altcoin market cap is half or less than Bitcoin's, potentially signaling a market bottom or cooling phase.
• Median (Ratio ≈ 0.75): A midpoint that provides insight into the market's neutral zone.
Use this tool to monitor market extremes and adjust your strategy accordingly when the altcoin market enters overheated or cooling phases.