Adaptive Kalman filter - Trend Strength Oscillator (Zeiierman)█ Overview
The Adaptive Kalman Filter - Trend Strength Oscillator by Zeiierman is a sophisticated trend-following indicator that uses advanced mathematical techniques, including vector and matrix operations, to decompose price movements into trend and oscillatory components. Unlike standard indicators, this model assumes that price is driven by two latent (unobservable) factors: a long-term trend and localized oscillations around that trend. Through a dynamic "predict and update" process, the Kalman Filter leverages vectors to adaptively separate these components, extracting a clearer view of market direction and strength.
█ How It Works
This indicator operates on a trend + local change Kalman Filter model. It assumes that price movements consist of two underlying components: a core trend and an oscillatory term, representing smaller price fluctuations around that trend. The Kalman Filter adaptively separates these components by observing the price series over time and performing real-time updates as new data arrives.
Predict and Update Procedure: The Kalman Filter uses an adaptive predict-update cycle to estimate both components. This cycle allows the filter to adjust dynamically as the market evolves, providing a smooth yet responsive signal. The trend component extracted from this process is plotted directly, giving a clear view of the prevailing direction. The oscillatory component indicates the tendency or strength of the trend, reflected in the green/red coloration of the oscillator line.
Trend Strength Calculation: Trend strength is calculated by comparing the current oscillatory value against a configurable number of past values.
█ Three Kalman filter Models
This indicator offers three distinct Kalman filter models, each designed to handle different market conditions:
Standard Model: This is a conventional Kalman Filter, balancing responsiveness and smoothness. It works well across general market conditions.
Volume-Adjusted Model: In this model, the filter’s measurement noise automatically adjusts based on trading volume. Higher volumes indicate more informative price movements, which the filter treats with higher confidence. Conversely, low-volume movements are treated as less informative, adding robustness during low-activity periods.
Parkinson-Adjusted Model: This model adjusts measurement noise based on price volatility. It uses the price range (high-low) to determine the filter’s sensitivity, making it ideal for handling markets with frequent gaps or spikes. The model responds with higher confidence in low-volatility periods and adapts to high-volatility scenarios by treating them with more caution.
█ How to Use
Trend Detection: The oscillator oscillates around zero, with positive values indicating a bullish trend and negative values indicating a bearish trend. The further the oscillator moves from zero, the stronger the trend. The Kalman filter trend line on the chart can be used in conjunction with the oscillator to determine the market's trend direction.
Trend Reversals: The blue areas in the oscillator suggest potential trend reversals, helping traders identify emerging market shifts. These areas can also indicate a potential pullback within the prevailing trend.
Overbought/Oversold: The thresholds, such as 70 and -70, help identify extreme conditions. When the oscillator reaches these levels, it suggests that the trend may be overextended, possibly signaling an upcoming reversal.
█ Settings
Process Noise 1: Controls the primary level of uncertainty in the Kalman filter model. Higher values make the filter more responsive to recent price changes, but may also increase susceptibility to random noise.
Process Noise 2: This secondary noise setting works with Process Noise 1 to adjust the model's adaptability. Together, these settings manage the uncertainty in the filter's internal model, allowing for finely-tuned adjustments to smoothness versus responsiveness.
Measurement Noise: Sets the uncertainty in the observed price data. Increasing this value makes the filter rely more on historical data, resulting in smoother but less reactive filtering. Lower values make the filter more responsive but potentially more prone to noise.
O sc Smoothness: Controls the level of smoothing applied to the trend strength oscillator. Higher values result in a smoother oscillator, which may cause slight delays in response. Lower values make the oscillator more reactive to trend changes, useful for capturing quick reversals or volatility within the trend.
Kalman Filter Model: Choose between Standard, Volume-Adjusted, and Parkinson-Adjusted models. Each model adapts the Kalman filter for specific conditions, whether balancing general market data, adjusting based on volume, or refining based on volatility.
Trend Lookback: Defines how far back to look when calculating the trend strength, which impacts the indicator's sensitivity to changes in trend strength. Shorter values make the oscillator more reactive to recent trends, while longer values provide a smoother reading.
Strength Smoothness: Adjusts the level of smoothing applied to the trend strength oscillator. Higher values create a more gradual response, while lower values make the oscillator more sensitive to recent changes.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Penunjuk dan strategi
Machine Learning RSI [BackQuant]Machine Learning RSI
The Machine Learning RSI is a cutting-edge trading indicator that combines the power of Relative Strength Index (RSI) with Machine Learning (ML) clustering techniques to dynamically determine overbought and oversold thresholds. This advanced indicator adapts to market conditions in real-time, offering traders a robust tool for identifying optimal entry and exit points with increased precision.
Core Concept: Relative Strength Index (RSI)
The RSI is a well-known momentum oscillator that measures the speed and change of price movements, oscillating between 0 and 100. Typically, RSI values above 70 are considered overbought, and values below 30 are considered oversold. However, static thresholds may not be effective in all market conditions.
This script enhances the RSI by integrating a dynamic thresholding system powered by Machine Learning clustering, allowing it to adapt thresholds based on historical RSI behavior and market context.
Machine Learning Clustering for Dynamic Thresholds
The Machine Learning (ML) component uses clustering to calculate dynamic thresholds for overbought and oversold levels. Instead of relying on fixed RSI levels, this indicator clusters historical RSI values into three groups using a percentile-based initialization and iterative optimization:
Cluster 1: Represents lower RSI values (typically associated with oversold conditions).
Cluster 2: Represents mid-range RSI values.
Cluster 3: Represents higher RSI values (typically associated with overbought conditions).
Dynamic thresholds are determined as follows:
Long Threshold: The upper centroid value of Cluster 3.
Short Threshold: The lower centroid value of Cluster 1.
This approach ensures that the indicator adapts to the current market regime, providing more accurate signals in volatile or trending conditions.
Smoothing Options for RSI
To further enhance the effectiveness of the RSI, this script allows traders to apply various smoothing methods to the RSI calculation, including:
Simple Moving Average (SMA)
Exponential Moving Average (EMA)
Weighted Moving Average (WMA)
Hull Moving Average (HMA)
Linear Regression (LINREG)
Double Exponential Moving Average (DEMA)
Triple Exponential Moving Average (TEMA)
Adaptive Linear Moving Average (ALMA)
T3 Moving Average
Traders can select their preferred smoothing method and adjust the smoothing period to suit their trading style and market conditions. The option to smooth the RSI reduces noise and makes the indicator more reliable for detecting trends and reversals.
Long and Short Signals
The indicator generates long and short signals based on the relationship between the RSI value and the dynamic thresholds:
Long Signals: Triggered when the RSI crosses above the long threshold, signaling bullish momentum.
Short Signals: Triggered when the RSI falls below the short threshold, signaling bearish momentum.
These signals are dynamically adjusted to reflect real-time market conditions, making them more robust than static RSI signals.
Visualization and Clustering Insights
The Machine Learning RSI provides an intuitive and visually rich interface, including:
RSI Line: Plotted in real-time, color-coded based on its position relative to the dynamic thresholds (green for long, red for short, gray for neutral).
Dynamic Threshold Lines: The script plots the long and short thresholds calculated by the ML clustering process, providing a clear visual reference for overbought and oversold levels.
Cluster Plots: Each RSI cluster is displayed with distinct colors (green, orange, and red) to give traders insights into how RSI values are grouped and how the dynamic thresholds are derived.
Customization Options
The Machine Learning RSI is highly customizable, allowing traders to tailor the indicator to their preferences:
RSI Settings : Adjust the RSI length, source price, and smoothing method to match your trading strategy.
Threshold Settings : Define the range and step size for clustering thresholds, allowing you to fine-tune the clustering process.
Optimization Settings : Control the performance memory, maximum clustering steps, and maximum data points for ML calculations to ensure optimal performance.
UI Settings : Customize the appearance of the RSI plot, dynamic thresholds, and cluster plots. Traders can also enable or disable candle coloring based on trend direction.
Alerts and Automation
To assist traders in staying on top of market movements, the script includes alert conditions for key events:
Long Signal: When the RSI crosses above the long threshold.
Short Signal: When the RSI crosses below the short threshold.
These alerts can be configured to notify traders in real-time, enabling timely decisions without constant chart monitoring.
Trading Applications
The Machine Learning RSI is versatile and can be applied to various trading strategies, including:
Trend Following: By dynamically adjusting thresholds, this indicator is effective in identifying and following trends in real-time.
Reversal Trading: The ML clustering process helps identify extreme RSI levels, offering reliable signals for reversals.
Range-Bound Trading: The dynamic thresholds adapt to market conditions, making the indicator suitable for trading in sideways markets where static thresholds often fail.
Final Thoughts
The Machine Learning RSI represents a significant advancement in RSI-based trading indicators. By integrating Machine Learning clustering techniques, this script overcomes the limitations of static thresholds, providing dynamic, adaptive signals that respond to market conditions in real-time. With its robust visualization, customizable settings, and alert capabilities, this indicator is a powerful tool for traders seeking to enhance their momentum analysis and improve decision-making.
As always, thorough backtesting and integration into a broader trading strategy are recommended to maximize the effectiveness!
Smooth Price Oscillator [BigBeluga]The Smooth Price Oscillator by BigBeluga leverages John Ehlers' SuperSmoother filter to produce a clear and smooth oscillator for identifying market trends and mean reversion points. By filtering price data over two distinct periods, this indicator effectively removes noise, allowing traders to focus on significant signals without the clutter of market fluctuations.
🔵 KEY FEATURES & USAGE
● SuperSmoother-Based Oscillator:
This oscillator uses Ehlers' SuperSmoother filter, applied to two different periods, to create a smooth output that highlights price momentum and reduces market noise. The dual-period application enables a comparison of long-term and short-term price movements, making it suitable for both trend-following and reversion strategies.
// @function SuperSmoother filter based on Ehlers Filter
// @param price (float) The price series to be smoothed
// @param period (int) The smoothing period
// @returns Smoothed price
method smoother_F(float price, int period) =>
float step = 2.0 * math.pi / period
float a1 = math.exp(-math.sqrt(2) * math.pi / period)
float b1 = 2 * a1 * math.cos(math.sqrt(2) * step / period)
float c2 = b1
float c3 = -a1 * a1
float c1 = 1 - c2 - c3
float smoothed = 0.0
smoothed := bar_index >= 4
? c1 * (price + price ) / 2 + c2 * smoothed + c3 * smoothed
: price
smoothed
● Mean Reversion Signals:
The indicator identifies two types of mean reversion signals:
Simple Mean Reversion Signals: Triggered when the oscillator moves between thresholds of 1 and Overbought or between thresholds -1 and Ovesold, providing additional reversion opportunities. These signals are useful for capturing shorter-term corrections in trending markets.
Strong Mean Reversion Signals: Triggered when the oscillator above the overbought (upper band) or below oversold (lower band) thresholds, indicating a strong reversal point. These signals are marked with a "+" symbol on the chart for clear visibility.
Both types of signals are plotted on the oscillator and the main chart, helping traders to quickly identify potential trade entries or exits.
● Dynamic Bands and Thresholds:
The oscillator includes overbought and oversold bands based on a dynamically calculated standard deviation and EMA. These bands provide visual boundaries for identifying extreme price conditions, helping traders anticipate potential reversals at these levels.
● Real-Time Labels:
Labels are displayed at key thresholds and bands to indicate the oscillator’s status: "Overbought," "Oversold," and "Neutral". Mean reversion signals are also displayed on the main chart, providing an at-a-glance summary of current indicator conditions.
● Customizable Threshold Levels:
Traders can adjust the primary threshold and smoothing length according to their trading style. A higher threshold can reduce signal frequency, while a lower setting will provide more sensitivity to market reversals.
The Smooth Price Oscillator by BigBeluga is a refined, noise-filtered indicator designed to highlight mean reversion points with enhanced clarity. By providing both strong and simple reversion signals, as well as dynamic overbought/oversold bands, this tool allows traders to spot potential reversals and trend continuations with ease. Its dual representation on the oscillator and the main price chart offers flexibility and precision for any trading strategy focused on capturing cyclical market movements.
Heiken Ashi ProThis Heikin Ashi Pro script is an open-source indicator that combines the power of Heikin Ashi-based trend analysis into the standard candlestick chart, allowing traders to view Heikin Ashi trends with predictive close information.
Heikin Ashi is a different method of calculating candlesticks. It has several advantages:
➡️It can help to show the dominant trend in a smoother way than normal candles.
➡️Flips in direction can show either trend reversal, or a pause and continuation, which can be a place to join a trend.
Disadvantages of using Heikin Ashi include:
➡️Having to change to a different chart layout
➡️Difficulties working directly with Heikin Ashi values, because the values of the Open, Low, High, and Close displayed are different to the "real" prices.
This indicator solves this problem by bringing trend information from Heikin Ashi candles onto your normal candle chart. Additionally, this script is packed with features and visual customization, aimed at helping traders improve trend identification and decision-making based on Heikin Ashi insights.
==Key Features==
➖Color Schemes: Choose between two customizable color schemes for displaying Heikin Ashi trends for both the regular candles and the smoothed HA candles overlay
➖Smoothed Heikin Ashi Candles: Offers double-smoothed Heikin Ashi candles, with selectable color schemes, transparency settings, and smoothing lengths for trend filtering.
➖Double Smoothing: Applies two EMA-based smoothing steps, creating a trend visualization that reduces noise and highlights major trend movements. Ideal for trend-following strategies, particularly on higher timeframes
➖HA Trend Circles: Shows trend circles above/below each candle, indicating Heikin Ashi trends with options for size, offset, and conditional display (all candles or trend flips only).
➖Predictive Close Line aka real-time trend flip prediction: This feature calculates and plots the price level required for the current candle to flip trend direction, giving insight into the strength of the current trend.
➖Alerts for Trend Flips: Bull and bear trend flip notifications. Alerts are non-repainting and designed to activate on the bar close, preventing false signals.
How to Use
➖Market Versatility: Works across all markets and timeframes, from intraday to daily or weekly.
➖Trend Analysis: Identify trend direction and potential reversal points based on Heikin Ashi principles, using color-coded bars or trend circles.
➖Support & Resistance Insight: The predictive close line serves as an estimated support/resistance level, especially useful in confirming trend strength.
Trading Strategies
➖Trend Following: Use the color-coded candles and smoothed Heikin Ashi to follow and stay in trends longer, filtering out minor retracements.
➖Reversal Spotting: Utilize HA trend flip alerts to catch potential reversals, adding these signals into your broader trading strategy.
➖Dynamic Stop Levels: The predictive close line provides a real-time level that the price must surpass to potentially confirm a trend change, which can guide stop-loss adjustments.
Example Use Cases
➖Intraday Traders: Combine predictive close levels with trend circles to manage trades in fast-paced environments, knowing exactly where the trend may shift.
➖Swing Traders: Rely on smoothed Heikin Ashi candles for more stable trend direction, staying in trades longer without being affected by minor fluctuations.
➖Scalpers: Utilize trend flip alerts to capture quick trend reversals and capitalize on short-term momentum.
This indicator offers both beginners and experienced traders an intuitive and powerful tool to integrate Heikin Ashi-based trend analysis into their existing chart setups, enabling more informed trading decisions aligned with various trading styles.
==========
Credits: Heikin Ashi formulas developed by and with insights from SimpleCryptoLife (HA function and predictive close) and jackvmk (smoothed HA).
Responsibility: Trading decisions remain the user's responsibility; it’s recommended to practice professional-level risk management.
Auto Fibonacci ModePurpose of the Code:
This Pine Script™ code defines an indicator called "Auto Fibonacci Mode" that automatically plots Fibonacci retracement and extension levels based on recent price data, providing traders with reference levels for potential support and resistance. It also offers an "Auto" mode that determines levels based on the selected moving average type (e.g., EMA, SMA) for added flexibility in trend identification.
Key Components and Functionalities:
Inputs:
lookback (Lookback): Determines how many bars back to look when identifying the highest and lowest prices.
reverse: Reverses the direction of Fibonacci calculations, which is helpful for analyzing both uptrends and downtrends.
auto: When enabled, this option automatically adjusts Fibonacci levels based on a moving average.
mod: Allows the user to select a specific moving average type (EMA, SMA, RMA, HMA, or WMA) for use in "Auto" mode.
Label and Color Options: Customize the display of Fibonacci labels, colors, and whether to show the highest and lowest levels on the chart.
Fibonacci Levels:
Sixteen Fibonacci levels are configurable in the input options, allowing users to choose traditional retracement levels (e.g., 0.236, 0.5, 1.618) as well as custom levels.
These levels are calculated dynamically and adjusted based on the highest and lowest price range within the lookback period.
Calculation of Direction and Fibonacci Levels:
Moving Average Direction: Using the specified moving average, the code evaluates the price direction to determine the trend (upward or downward). This direction can be reversed if the user selects the reverse option.
Fibonacci Level Calculation: Each level is computed based on the highest and lowest prices over the lookback range and adjusted according to the selected trend direction and moving average type.
Plotting Fibonacci Levels:
The script generates lines on the chart to represent each Fibonacci level, with customizable gradient colors.
Labels displaying level values and prices can be enabled, providing easy identification of each level on the chart.
Additional Lines:
Lines representing the highest and lowest prices within the lookback range can also be displayed, highlighting recent support and resistance levels for added context.
Usage:
The Auto Fibonacci Mode indicator is designed for traders interested in Fibonacci retracement and extension levels, particularly those seeking automatic trend detection based on moving averages.
This indicator enables:
Automatic adjustment of Fibonacci levels based on selected moving average type.
Quick visualization of support and resistance areas without manual adjustments.
Analysis flexibility with customizable levels and color gradients for easier trend and reversal identification.
This tool is valuable for traders who rely on Fibonacci analysis and moving averages as part of their technical analysis strategy.
Important Note:
This script is provided for educational purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
Monique's Trading Strategy V2Used Open A.I. to help create this script.
It is a merge of the RSI and the Williams %R.
In strong uptrends, we go from RSI overbought to RSI overbought, but it hardly gets oversold. (the same in the opposite direction)
To find a better entry point, Williams %R is used to find oversold conditions in an uptrend or overbought in a downtrend.
=> When RSI goes from overbought back to normal it will tell you to buy the dip. In a downtrend it will tell you to sell the tops.
-Monique Renee
MERCURY by DrAbhiramSivprasad"MERCURY by DrAbhiramSivprasad"
Developed from over 10 years of personal trading experience, the Mercury Indicator is a strategic tool designed to enhance accuracy in trading decisions. Think of it as a guiding light—a supportive tool that helps traders refine and build more robust strategies by integrating multiple powerful elements into a single indicator. I’ll be sharing some examples to illustrate how I use this indicator in my own trading journey, highlighting its potential to improve strategy accuracy.
Reason behind the combination of emas , cpr and vwap is it provides very good support and resistance in my trading carrier so now i brought them together in one plate
How It Works:
Mercury combines three essential elements—EMA, VWAP, and CPR—each of which plays a vital role in detecting support and resistance:
Exponential Moving Averages (EMAs): Known for their strength in providing dynamic support and resistance levels, EMAs help in identifying trends and shifts in momentum. This indicator includes a dashboard with up to nine customizable EMAs, showing whether each is acting as support or resistance based on real-time price movement.
Volume Weighted Average Price (VWAP): VWAP also provides valuable support and resistance, often regarded as a fair price level by institutional traders. Paired with EMAs, it forms a dual-layered support/resistance system, adding an additional level of confirmation.
Central Pivot Range (CPR): By combining CPR with EMAs and VWAP, Mercury highlights “traffic blocks” in your target journey. This means it identifies zones where price is likely to stall or reverse, providing additional guidance for navigating entries and exits.
Why This Combination Matters:
Using these three tools together gives you a more complete view of the market. VWAP and EMAs offer dynamic trend direction and support/resistance, while CPR pinpoints critical price zones. This combination helps you find high-probability trades, adding clarity to complex market situations and enabling stronger confirmation on trend or reversal decisions.
How to Use:
Trend Confirmation: Check if all EMAs are aligned (green for uptrend, red for downtrend), which is visible in the EMA dashboard. An alignment across VWAP, CPR, and EMAs signifies high confidence in trend direction.
Breakouts & Breakdowns: Mercury has an alert system to signal when a price breakout or breakdown occurs across VWAP, EMA1, and EMA2. This can help in spotting strong directional moves.
Example Application: In my trading, I use Mercury to identify support/resistance zones, confirming trends with EMA/VWAP alignment and using CPR as a checkpoint. I find this especially useful for day trading and swing setups.
Recommended Timeframes:
Day Trading: 5 to 15-minute charts for swift, actionable insights.
Swing Trading: 1-hour or 4-hour charts for broader trend analysis.
Note:
The Mercury Indicator should be used as a supportive tool rather than a standalone strategy, guiding you toward informed decisions in line with your trading style and goals.
EXAMPLE OF TRADE
you can see the cart of XAUUSD on 11th nov 2024
1.SHORT POSITION - TIME FRAME 15 MIN
So here for a short position you need to wait for a breakdown candle which will print in orange post the candle you need to check ema dashboard is completly red that indicates no traffic blocks in your journey to destiny target from ema's and you can take the target from nearest cpr support line
TAKEN IN XAUUSD you can see in chart of XAUUSD on 7th nov
2.LONG POSITION - TIME FRAME 15 MIN -
So here for long position you need to wait for a breakout candle from indicator thats here is blue and check all ema boxes are green and candle body should close above all the 3 lines here it is the both ema 1 and 2 and the vwap line then you can take and entry and your target will be the nearest resistance from the daily cpr
3. STOP LOSS CRITERIA
After the entry any candle close below any of the last line from entry for example we have 3 lines vwap and ema 1 and 2 lines and u have made an entry and the last line before the entry is vwap then if any candle closes below vwap can be considered as stoploss like wise in any lines
The MERCURY indicator is a comprehensive trading tool designed to enhance traders' ability to identify trends, breakouts, and reversals effectively. Created by Dr. Abhiram Sivprasad, this indicator integrates several technical elements, including Central Pivot Range (CPR), EMA crossovers, VWAP levels, and a table-based EMA dashboard, to offer a holistic trading view.
Core Components and Functionality:
Central Pivot Range (CPR):
The CPR in MERCURY provides a central pivot level along with Below Central (BC) and Top Central (TC) pivots. These levels act as potential support and resistance, useful for identifying reversal points and zones where price may consolidate.
Exponential Moving Averages (EMAs):
MERCURY includes up to nine EMAs, with a customizable EMA crossover alert system. This feature enables traders to see shifts in trend direction, especially when shorter EMAs cross longer ones.
VWAP (Volume-Weighted Average Price):
VWAP is incorporated as a dynamic support/resistance level and, combined with EMA crossovers, helps refine entry and exit points for higher probability trades.
Breakout and Breakdown Alerts:
MERCURY monitors conditions for upside and downside breakouts. For an upside breakout, all EMAs turn green and a candle closes above VWAP, EMA1, and EMA2. Similarly, all EMAs turning red, combined with a close below VWAP and EMA1/EMA2, signals a downside breakdown. Continuous alerts are available until the trend shifts.
Real-Time EMA Dashboard:
A table displays each EMA’s relative position (Above or Below), helping traders quickly gauge trend direction. Colors in the table adjust to long/short conditions based on EMA alignment.
Usage Recommendations:
Trend Confirmation:
Use the CPR, EMA alignments, and VWAP to confirm uptrends and downtrends. The table highlights trends, making it easy to spot long or short setups at a glance.
Breakout and Breakdown Alerts:
The alert system is customizable for continuous notifications on critical price levels. When all EMAs align in one direction (green for long, red for short) and the close is above or below VWAP and key EMAs, the indicator confirms a breakout/breakdown.
Adaptable for Different Styles:
Day Trading: Traders can set shorter EMAs for quick insights.
Swing Trading: Longer EMAs combined with CPR offer insights into sustained trends.
Recommended Settings:
Timeframes: MERCURY is suitable for timeframes as low as 5 minutes for intraday traders, up to daily charts for trend analysis.
Symbols: Works across forex, stocks, and crypto. Adjust EMA lengths for asset volatility.
Example Strategy:
Long Entry: When the price crosses above CPR and closes above both EMA1 and EMA2.
Short Entry: When the price falls below CPR with a close below both EMA1 and EMA2.
Moving Average Pullback Signals [UAlgo]The "Moving Average Pullback Signals " indicator is designed to identify potential trend continuation or reversal points based on moving average (MA) pullback patterns. This tool combines multiple types of moving averages, customized trend validation parameters, and candlestick wick patterns to provide reliable buy and sell signals. By leveraging several advanced MA methods (such as TEMA, DEMA, ZLSMA, and McGinley-D), this script can adapt to different market conditions, providing traders with flexibility and more precise trend-based entries and exits. The addition of a gradient color-coded moving average line and wick validation logic enables traders to visualize market sentiment and trend strength dynamically.
🔶 Key Features
Multiple Moving Average (MA) Calculation Methods: This indicator offers various MA calculation types, including SMA, EMA, DEMA, TEMA, ZLSMA, and McGinley-D, allowing traders to select the MA that best fits their strategy.
Trend Validation and Pattern Recognition: The indicator includes a customizable trend validation length, ensuring that the trend is consistent before buy/sell signals are generated. The "Trend Pattern Mode" setting provides flexibility between "No Trend in Progress," "Trend Continuation," and "Both," tailoring signals to the trader’s preferred style.
Wick Validation Logic: To enhance the accuracy of entries, this indicator identifies specific wick patterns for bullish or bearish pullbacks, which signal potential trend continuation or reversal. Wick length and validation factor are adjustable to suit various market conditions and timeframes.
Gradient Color-coded MA Line: This feature provides a quick visual cue for trend strength, with color changes reflecting relative highs and lows of the MA, enhancing market sentiment interpretation.
Alerts for Buy and Sell Signals: Alerts are triggered when either a bullish or bearish pullback is detected, allowing traders to receive instant notifications without continuously monitoring the chart.
Visual Labels for Reversal Points: The indicator plots labels ("R") at potential reversal points, with color-coded labels for bullish (green) and bearish (red) pullbacks, highlighting pullback opportunities that align with the trend or reversal potential.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Bullish Breaker with StoplossThis script highlights a large bullish candle that closes above the previous 2 candles , then plots the high of the previous candle for the FVG, and also plots the 50% and 61.8% fib levels on the bullish candle. It also plots a stop loss line below the "Breaker" candle with the loss amount calculated if you took an entry at the FVG Level so you can quickly gauge risk and size accordingly, this script was specifically made for trading on NQ 5 min, but works on other instruments as well. Too enter a trade wait for a pullback after the highlighted "Breaker" on the next 2 candles into the discount zone between the 50% and FVG levels. For best results only make long entries when the 15min is above its 21 EMA or has confirmed a reversal off of Support levels, I may add support levels in a future update.
Disclaimer, This script is for educational and informational purposes, trading is risky , we do not guarantee the accuracy or reliability of this script, past performance is not indicative of future results.
Dynamic Time Period CandlesThis indicator gives the dynamic history of the current price over various time frames as a series of candles on the right of the display, with optional lines on the chart, so that you can assess the current trend more easily.
In the library I found lots of indicators that looked at the previous xx time period candle, but they then immediately switched to the new xx time candle when it started to be formed. This indicator looks back at the rolling previous time period. With this indicator, you can clearly see how price has been behaving over time.
IMPORTANT SETUP INFO:
Initially, you must go into the settings and select the timeframe (in minutes) that your chart is displaying. If you don't do this then the indicator will look back the wrong number of candles and give you totally wrong results.
You can then setup how high you want the candle labels to be on the chart.
Then you can select settings for each candle that you want displayed. Anywhere between 1 and 5 different timeframes can be displayed on the chart at once.
I initially published an indicator called 'Dynamic 4-Hour Candle (Accurate Highs and Lows)', but this new indicator is so different that it needs to be forked and published as a separate indicator. The reasons for this are below:
The original indicator only looked at the previous 4 hour time period. This indicator allows the user to select any time period that they choose.
The original indicator only looked at one time period. This indicator allows to select between one and five time periods on the chart at once.
The original indicator did not put lines on the chart to show the lookback period and the highs and lows of that time period. This indicator does both those things.
The name of the original indicator in no way now describes what this new indicator is capable of, and would be very misleading to anyone who came across it. This new indicator has a name that much more accurately reflects what its' purpose and functionality is.
TrigWave Suite [InvestorUnknown]The TrigWave Suite combines Sine-weighted, Cosine-weighted, and Hyperbolic Tangent moving averages (HTMA) with a Directional Movement System (DMS) and a Relative Strength System (RSS).
Hyperbolic Tangent Moving Average (HTMA)
The HTMA smooths the price by applying a hyperbolic tangent transformation to the difference between the price and a simple moving average. It also adjusts this value by multiplying it by a standard deviation to create a more stable signal.
// Function to calculate Hyperbolic Tangent
tanh(x) =>
e_x = math.exp(x)
e_neg_x = math.exp(-x)
(e_x - e_neg_x) / (e_x + e_neg_x)
// Function to calculate Hyperbolic Tangent Moving Average
htma(src, len, mul) =>
tanh_src = tanh((src - ta.sma(src, len)) * mul) * ta.stdev(src, len) + ta.sma(src, len)
htma = ta.sma(tanh_src, len)
Sine-Weighted Moving Average (SWMA)
The SWMA applies sine-based weights to historical prices. This gives more weight to the central data points, making it responsive yet less prone to noise.
// Function to calculate the Sine-Weighted Moving Average
f_Sine_Weighted_MA(series float src, simple int length) =>
var float sine_weights = array.new_float(0)
array.clear(sine_weights) // Clear the array before recalculating weights
for i = 0 to length - 1
weight = math.sin((math.pi * (i + 1)) / length)
array.push(sine_weights, weight)
// Normalize the weights
sum_weights = array.sum(sine_weights)
for i = 0 to length - 1
norm_weight = array.get(sine_weights, i) / sum_weights
array.set(sine_weights, i, norm_weight)
// Calculate Sine-Weighted Moving Average
swma = 0.0
if bar_index >= length
for i = 0 to length - 1
swma := swma + array.get(sine_weights, i) * src
swma
Cosine-Weighted Moving Average (CWMA)
The CWMA uses cosine-based weights for data points, which produces a more stable trend-following behavior, especially in low-volatility markets.
f_Cosine_Weighted_MA(series float src, simple int length) =>
var float cosine_weights = array.new_float(0)
array.clear(cosine_weights) // Clear the array before recalculating weights
for i = 0 to length - 1
weight = math.cos((math.pi * (i + 1)) / length) + 1 // Shift by adding 1
array.push(cosine_weights, weight)
// Normalize the weights
sum_weights = array.sum(cosine_weights)
for i = 0 to length - 1
norm_weight = array.get(cosine_weights, i) / sum_weights
array.set(cosine_weights, i, norm_weight)
// Calculate Cosine-Weighted Moving Average
cwma = 0.0
if bar_index >= length
for i = 0 to length - 1
cwma := cwma + array.get(cosine_weights, i) * src
cwma
Directional Movement System (DMS)
DMS is used to identify trend direction and strength based on directional movement. It uses ADX to gauge trend strength and combines +DI and -DI for directional bias.
// Function to calculate Directional Movement System
f_DMS(simple int dmi_len, simple int adx_len) =>
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = ta.rma(ta.tr, dmi_len)
plus = fixnan(100 * ta.rma(plusDM, dmi_len) / trur)
minus = fixnan(100 * ta.rma(minusDM, dmi_len) / trur)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adx_len)
dms_up = plus > minus and adx > minus
dms_down = plus < minus and adx > plus
dms_neutral = not (dms_up or dms_down)
signal = dms_up ? 1 : dms_down ? -1 : 0
Relative Strength System (RSS)
RSS employs RSI and an adjustable moving average type (SMA, EMA, or HMA) to evaluate whether the market is in a bullish or bearish state.
// Function to calculate Relative Strength System
f_RSS(rsi_src, rsi_len, ma_type, ma_len) =>
rsi = ta.rsi(rsi_src, rsi_len)
ma = switch ma_type
"SMA" => ta.sma(rsi, ma_len)
"EMA" => ta.ema(rsi, ma_len)
"HMA" => ta.hma(rsi, ma_len)
signal = (rsi > ma and rsi > 50) ? 1 : (rsi < ma and rsi < 50) ? -1 : 0
ATR Adjustments
To minimize false signals, the HTMA, SWMA, and CWMA signals are adjusted with an Average True Range (ATR) filter:
// Calculate ATR adjusted components for HTMA, CWMA and SWMA
float atr = ta.atr(atr_len)
float htma_up = htma + (atr * atr_mult)
float htma_dn = htma - (atr * atr_mult)
float swma_up = swma + (atr * atr_mult)
float swma_dn = swma - (atr * atr_mult)
float cwma_up = cwma + (atr * atr_mult)
float cwma_dn = cwma - (atr * atr_mult)
This adjustment allows for better adaptation to varying market volatility, making the signal more reliable.
Signals and Trend Calculation
The indicator generates a Trend Signal by aggregating the output from each component. Each component provides a directional signal that is combined to form a unified trend reading. The trend value is then converted into a long (1), short (-1), or neutral (0) state.
Backtesting Mode and Performance Metrics
The Backtesting Mode includes a performance metrics table that compares the Buy and Hold strategy with the TrigWave Suite strategy. Key statistics like Sharpe Ratio, Sortino Ratio, and Omega Ratio are displayed to help users assess performance. Note that due to labels and plotchar use, automatic scaling may not function ideally in backtest mode.
Alerts and Visualization
Trend Direction Alerts: Set up alerts for long and short signals
Color Bars and Gradient Option: Bars are colored based on the trend direction, with an optional gradient for smoother visual feedback.
Important Notes
Customization: Default settings are experimental and not intended for trading/investing purposes. Users are encouraged to adjust and calibrate the settings to optimize results according to their trading style.
Backtest Results Disclaimer: Please note that backtest results are not indicative of future performance, and no strategy guarantees success.
Economic Seasons [Daveatt]Ever wondered what season your economy is in?
Just like Mother Nature has her four seasons, the economy cycles through its own seasons! This indicator helps you visualize where we are in the economic cycle by tracking two key metrics:
📊 What We're Tracking:
1. Interest Rates (USIRYY) - The yearly change in interest rates
2. Inflation Rate (USINTR) - The rate at which prices are rising
The magic happens when we normalize these values (fancy math that makes the numbers play nice together) and compare them to their recent averages. We use a lookback period to calculate the standard deviation and determine if we're seeing higher or lower than normal readings.
🔄 The Four Economic Seasons & Investment Strategy:
1. 🌸 Goldilocks (↑Growth, ↓Inflation)
"Not too hot, not too cold" - The economy is growing steadily without overheating.
BEST TIME TO: Buy growth stocks, technology, consumer discretionary
WHY: Companies can grow earnings in this ideal environment of low rates and stable prices
2. 🌞 Reflation (↑Growth, ↑Inflation)
"Party time... but watch your wallet!" - The economy is heating up.
BEST TIME TO: Buy commodities, banking stocks, real estate
WHY: These sectors thrive when inflation rises alongside growth
3. 🌡️ Inflation (↓Growth, ↑Inflation)
"Ouch, my purchasing power!" - Growth slows while prices keep rising.
BEST TIME TO: Rotate into value stocks, consumer staples, healthcare
WHY: These defensive sectors maintain pricing power during inflationary periods
4. ❄️ Deflation (↓Growth, ↓Inflation)
"Winter is here" - Both growth and inflation are falling.
BEST TIME TO: Focus on quality bonds, cash positions, and dividend aristocrats
WHY: Capital preservation becomes key; high-quality fixed income provides safety
🎯 Strategic Trading Points:
- BUY AGGRESSIVELY: During late Deflation/early Goldilocks (the spring thaw)
- HOLD & ACCUMULATE: Throughout Goldilocks and early Reflation
- START TAKING PROFITS: During late Reflation/early Inflation
- DEFENSIVE POSITIONING: Throughout Inflation and Deflation
⚠️ Warning Signs to Watch:
- Goldilocks → Reflation: Time to reduce growth stock exposure
- Reflation → Inflation: Begin rotating into defensive sectors
- Inflation → Deflation: Quality becomes crucial
- Deflation → Goldilocks: Start building new positions
The blue dot shows you where we are right now in this cycle.
The red arrows in the middle remind us that this is a continuous cycle - one season flows into the next, just like in nature!
💡 Pro Tip: The transitions between seasons often provide the best opportunities - but also the highest risks. Use additional indicators and fundamental analysis to confirm these shifts.
Remember: Just like you wouldn't wear a winter coat in summer, you shouldn't use a Goldilocks strategy during Inflation! Time your trades with the seasons. 🎯
Happy Trading! 📈
Enhanced Keltner TrendThe Enhanced Keltner Trend (EKT) indicator builds on the classic Keltner Channel, using volatility to define potential trend channels around a central moving average. It combines customizable volatility measures moving average, giving traders flexibility to adapt the trend channel to various market conditions.
How It Works?
MA Calculation:
A user-defined moving average forms the central line (or price basis) of the Keltner Channel.
Channel Width:
The width of the Keltner Channel depends on market volatility.
You can choose between two methods for measuring the volatility:
ATR-based Width: Uses the Average True Range (ATR) with customizable periods and multipliers.
Price Range Width: Uses the high and low price range over a defined period.
Trend Signal:
The trend is evaluated by price in relation to the Keltner Channel:
Bullish Trend (Blue Line): When the price crosses above the upper band, it signals upward momentum.
Bearish Trend (Orange Line): When the price crosses below the lower band, it signals downward momentum.
What Is Unique?
This Enhanced version of the Keltner Trend is for investors who want to have more control over the Keltner's channels calculation, so they can calibrate it to provide them more alpha when combined with other Technical Indicators.
Use ATR: Gives the user the choice to use the ATR for the channel width calculation, or use the default High - Low over specified period.
ATR Period: Users can modify ATR length to calculate the channels width (Volatility).
ATR Multiplier: Users can fine-tune how much of the volatility they want to factor into the channels, providing more control over the final calculation.
MA Period: Smoothing period for the Moving Averages.
MA Type: Choosing from different Moving Averages types providing different smoothing types.
Setting Alerts:
Built-in alerts for trend detection:
Bullish Trend: When price crosses the upper band, it signals a Bullish Signal (Blue Color)
Bearish Trend: When price crosses the lower band, it signals a Bearish Signal (Orange Color)
Credits to @jaggedsoft , it's a modified version of his.
Buy&Sell Hollow CandlesThe Hollow Candles Script is a type of candlestick analysis script designed to highlight the following:
Purpose of the Script: This script provides the user with buy and sell signals based on candlesticks that show an upward or downward reversal.
Mechanism of the Script: When a hollow (unfilled) red candle appears, it signals a potential entry, provided that this candle is at a low point, following a series of red candles with higher volume than previous days. Similarly, it gives a sell signal when a green candle appears at a peak with high sell volume surpassing that of prior days. However, the appearance of these candles alone should not prompt an immediate buy or sell; you should wait for a confirming candle to validate the signal.
Sideways Movement Caution: If these signals appear during a sideways or flat trend, it is not advisable to proceed with buying or selling.
Chart Insights: The chart demonstrates certain buy and sell operations along with some non-ideal signals where decision-making should be based on fundamental analytical experience.
Weighted CG Oscillator with ATRATR-Weighted CG Oscillator
The ATR-Weighted CG Oscillator is an enhanced version of the Center of Gravity (CG) Oscillator, originally developed by John Ehlers . By adding the Average True Range (ATR) to dynamically adjust the oscillator’s values based on market volatility, this indicator aims to make trend signals more responsive to price changes, offering an adaptive tool for trend analysis.
Functionality Overview :
The CG Oscillator, a classic trend-following indicator, has been modified here to incorporate the ATR for improved context and adaptability in different market conditions. The indicator calculates the CG Oscillator and scales it by dividing the ATR by the closing price to normalize for volatility. This creates a “weighted” CG Oscillator that generates more contextually relevant signals. A colored line shows green for long signals (above the long threshold), red for short signals (below the short threshold), and gray for neutral conditions.
Input Parameters :
CGO Length : Sets the period of the CG Oscillator calculation.
ATR Length : Determines the period of the ATR calculation. Longer periods smooth out the volatility impact.
Long Threshold : The threshold that triggers a long signal; a long (green) signal occurs when the weighted CG Oscillator crosses above this level.
Short Threshold : The threshold that triggers a short signal; a short (red) signal occurs when the weighted CG Oscillator crosses below this level.
Source : Specifies the data source for CG Oscillator calculations, with the default set to the closing price.
Recommended Use :
This indicator is designed to be an adaptive tool, not your sole resource. To ensure its effectiveness, it’s essential to backtest the indicator on your chosen asset over your preferred timeframe. Market dynamics vary, so testing the indicator’s parameters—especially the thresholds—will allow you to find the settings that best suit your strategy. While the default values work well for some scenarios, customizing the settings will help align the indicator with your unique trading style and the asset’s characteristics.
Next Trend ChannelThis indicator shows you the overall market trend across various time frames, allowing you to identify the future trend direction. The uptrend is displayed in green, and before it begins, a green dot appears below the starting candle to signal the trend’s initiation. The downtrend is shown in red, with an orange dot appearing just before the downtrend starts, informing you of the continuation. A gray trend signifies a ranging market, and it’s recommended not to trade in this zone. Please backtest before using.
Babil34 RSI - Adaptive Trend IndicatorBabil34 RSI is an advanced adaptive RSI indicator based on the Jurik RSX algorithm. Unlike traditional RSI, this indicator is designed to respond faster to price fluctuations and provide smoother signals, making it an ideal tool for identifying trend reversals and strength with greater accuracy. With customizable overbought and oversold levels, it highlights critical points where price action may reverse, giving traders an edge in market analysis.
Key Features:
Customizable Overbought/Oversold Levels: Allows traders to adjust overbought and oversold thresholds (default: 85 for overbought, 15 for oversold) to better suit their trading strategies.
Color-Coded Signals: Highlights overbought conditions in red and oversold conditions in green, with neutral conditions in a distinct color for easy visualization.
Level Highlights: Adds background highlights for overbought and oversold zones to enhance focus on key reversal points.
User-Defined Input Options: Users can adjust the source (hlc3 by default) and period length, as well as toggle level highlighting for greater control.
How It Works:
Babil34 RSI uses a modified RSX calculation that smooths out noise and provides cleaner signals in volatile markets. It calculates trend momentum by comparing the current level with previous values, identifying potential overbought and oversold zones more effectively than standard RSI.
This indicator is beneficial for traders focused on trend strength, momentum analysis, and reversal detection. By integrating Babil34 RSI into your trading strategy, you gain a clearer view of market dynamics and potential entry/exit points.
Kalman Based VWAP [EdgeTerminal]Kalman VWAP is a different take on volume-weighted average price (VWAP) indicator where we enhance the results with Kalman filtering and dynamic wave visualization for a more smooth and improved trend identification and volatility analysis.
A little bit about Kalman Filter:
Kalman filtering (also known as linear quadratic estimation) is an algorithm that uses a series of measurements observed over time, including statistical noise and other inaccuracies, to produce estimates of unknown variables that tend to be more accurate than those based on a single measurement, by estimating a joint probability distribution over the variables for each time-step. The filter is constructed as a mean squared error minimiser, but an alternative derivation of the filter is also provided showing how the filter relates to maximum likelihood statistics
This indicator combines:
Volume-Weighted Average Price (VWAP) for institutional price levels
Kalman filtering for noise reduction and trend smoothing
Dynamic wave visualization for volatility zones
This creates a robust indicator that helps traders identify trends, support/resistance zones, and potential reversal points with high precision.
What makes this even more special is the fact that we use open price as a data source instead of usual close price. This allows you to tune the indicator more accurately when back testing it and generally get results that are closer to real time market data.
The math:
In case if you're interested in the math of this indicator, the indicator employs a state-space Kalman filter model:
State Equation: x_t = x_{t-1} + w_t
Measurement Equation: z_t = x_t + v_t
x_t is the filtered VWAP state
w_t is process noise ~ N(0, Q)
v_t is measurement noise ~ N(0, R)
z_t is the traditional VWAP measurement
The Kalman filter recursively updates through:
Prediction: x̂_t|t-1 = x̂_{t-1}
Update: x̂_t = x̂_t|t-1 + K_t(z_t - x̂_t|t-1)
Where K_t is the Kalman gain, optimally balancing between prediction and measurement.
Input Parameters
Measurement Noise: Controls signal smoothing (0.0001 to 1.0)
Process Noise: Adjusts trend responsiveness (0.0001 to 1.0)
Wave Size: Multiplier for volatility bands (0.1 to 5.0)
Trend Lookback: Period for trend determination (1 to 100)
Bull/Bear Colors: Customizable color schemes
Application:
I recommend using this along other indicators. This is best used for assets that don't have a close time, such as BTC but can be used with anything as long as the data is there.
With default settings, this works better for swing trades but you can adjust it for day trading as well, by adjusting the lookback and also process noise.
Fibonacci Channel Simple Average and Trend Tracking with EMAFibonacci channel Simple average and trend tracking with ema
We create a channel by taking the fibonacci average of the 20 simple average and follow the trend.
We understand that the trend is bullish or bearish with the 200 ema.
In case of a pullback to the 20 sma channel, we open a position in the direction of the trend.
Suitable values for BTC;
It gives the best results in 15-minute candles.
Not recommended for scalping.
Fib Ratio 1: 1
Fib Ratio 2: 2.8
Fib Ratio 3: 4
Sma and fib ratios should be updated according to the volatility of altcoins and tested until the strategy is profitable.
Not investment advice.
Key Prices & LevelsThis indicator is designed to visualize key price levels & areas for NY trading sessions based on the price action from previous day, pre-market activity and key areas from NY session itself. The purpose is to unify all key levels into a single indicator, while allowing a user to control which levels they want to visualize and how.
The indicator identifies the following:
Asia Range High/Lows, along with ability to visualize with a box
London Range High/Lows, along with ability to visualize with a box
Previous Day PM Session High/Lows
Current Day Lunch Session High/Lows, starts appearing after 12pm EST once the lunch session starts
New York Open (8:30am EST) price
9:53 Open (root candle) price
New York Midnight (12:00am EST) price
Previous Day High/Lows
First 1m FVG after NY Session Start (after 9:30am), with the ability to configure minimum FVG size.
Opening Range Gap, showing regular market hours close price (previous day 16:15pm EST close), new session open price (9:30am EST open) and optionally the mid-point between the two
Asia Range 50% along with 2, 2.5, 4 and 4.5 deviations of the Asia range in both directions
Configurability:
Each price level can be turned off
Styles in terms of line type, color
Ability to turn on/off labels for price levels and highlighting of prices on price scale
Ability to control label text for price levels
The reasoning and how each price level can be used is explained in this video
youtu.be