Reversal rehersal v1This indicator was designed to identify potential market reversal zones using a combination of RSI thresholds (shooting range/falling range), candlestick patterns, and Fair Value Gaps (FVGs). By combining all these elements into one indicator, it allow for outputting high probability buy/sell signals for use by scalpers on low timeframes like 1-15 mins, for quick but small profits.
Note: that this has been mainly tested on DE40 index on the 1 min timeframe, and need to be adjusted to whichever timeframe and symbol you intend to use. Refer to the backtester feature for checking if this indicator may work for you.
The indicator use RSI ranges from two timeframes to highlight where momentum is building up. During these areas, it will look for certain candlestick patterns (Sweeps as the primary one) and check for existance of fair value gaps to further enhance the hitrate of the signal.
The logic for FVG detection was based on ©pmk07's work with MTF FVG tiny indicator. Several major changes was implemented though and incorporated into this indicator. Among these are:
Automatically adjustments of FVG boxes when mitigated partially and options to extend/cull boxes for performance and clarity.
Backtesting Table (Experimental):
This indicator also features an optional simplified table to review historical theoretical performance of signals, including win rate, profit/loss, and trade statistics. This does not take commision or slippage into consideration.
Usage Notes:
Setup:
1. Add the indicator to your chart.
2. Decide if you want to use Long or Short (or both).
3. If you're scalping on ie. 1 min time frame, make sure to set FVG's to higher timeframes (ie. 5, 15, 60).
4. Enable the 'Show backtest results' and adjust the 'Signals' og 'Take profit' and 'Stop loss' values until you are satisfied with the results.
Use:
1. Setup an alert based on either of the 'BullishShooting range' or 'BearishFalling range' alerts. This will draw your attention to watch for the possible setups.
2. Verify if there's a significant imbalance prior to the signal before taking the trade. Otherwise this may invalidate the setup.
3. Once a signal is shown on the graph (either Green arrow up for buys/Red arrow down for sells) - you should enter a trade with the given 'Take profit' and 'Stop loss' values.
4. (optional) Setup an alert for either the Strong/Weak signals. Which corresponds to when one of the arrows are printed.
Important: This is the way I use it myself, but use at own risk and remember to combine with other indicators for further confluence. Remember this is no crystal ball and I do not guarantee profitable results. The indicator merely show signals with high probability setups for scalping.
المؤشرات والاستراتيجيات
Hyper MA Loop | QuantEdgeBIntroducing Hyper MA Loop by QuantEdgeB
Hyper MA Loop | QuantEdgeB is an advanced trend-following indicator that leverages a custom Hyper Moving Average (HyMA) and an innovative loop-based scoring system to assess trend strength and direction. This tool is designed to provide a dynamic perspective on market momentum, allowing traders to capture trends effectively while filtering out market noise.
Key Features:
1. Hyper Moving Average (HyMA) 🟣
- A weighted moving average that enhances trend responsiveness by applying a custom
weight function.
- Ensures smoother trend detection while maintaining reactivity to price changes.
2. Loop-Based Trend Scoring 🔄
- Utilizes a for-loop function to analyze the movement of HyMA over a specified period.
- Compares current values to past values, generating a cumulative score indicating bullish or
bearish momentum.
- Dynamic thresholds adjust to market conditions for better trend filtering.
3. Threshold-Based Signal System ✅❌
- Long Signals: Triggered when the loop score exceeds the long threshold.
- Short Signals: Activated when the score falls below the short threshold.
- Avoids false signals by requiring sustained strength before confirming a trend.
4. Customizable Visualization & Colors 🎨
- Multiple color modes (Default, Solar, Warm, Cool, Classic) for tailored aesthetics.
- Extra plot options enhance visualization of market structure and volatility.
________
How It Works:
- HyMA Calculation : A unique moving average with a specialized weighting function to
smooth out price action.
- Loop Function : Iterates over past HyMA values, assessing whether price is consistently
higher or lower.
- Threshold Comparison : The loop score is compared against pre-set thresholds to
determine bullish or bearish conditions.
- Signal Generation :
1. Bullish (🔵): If the score crosses the long threshold
2. Bearish (🔴): If the score drops below the short threshold.
- Plotting & Styling : Dynamic candles and gradient overlays provide an intuitive
visualization of rend shifts.
________
Use Cases:
✅ Ideal for trend-following traders looking for solid trends confirmation.
✅ Helps filter out choppy market conditions by adjusting sensitivity dynamically.
✅ Works well with other indicators (e.g., ADX, volume-based filters) for added confirmation.
✅ Suitable for both short-term and long-term trend analysis.
________
Customization Options:
- Adjustable HyMA Length: Modify the responsiveness of the moving average. Default se to 2.
- For-Loop Parameters: Fine-tune how far back the trend analysis should consider. Default se to Start = 1 , End = -1.
- Thresholds for Long & Short: Control signal sensitivity to market fluctuations. Default set to Long = 40, Short = 8.
- Color Modes & Extra Plots: Personalize visualization for better clarity.
________
Conclusion:
The Hyper MA Loop | QuantEdgeB is a powerful, adaptive indicator that combines custom moving averages with loop-based trend analysis to deliver accurate, visually intuitive market signals. Whether you're looking to ride strong trends or filter out weak setups, this tool provides the precision and flexibility needed for effective decision-making. 🚀📈
🔹 Disclaimer: Past performance is not indicative of future results. No trading indicator can guarantee success in financial markets.
🔹 Strategic Consideration: As always, backtesting and strategic adjustments are essential to fully optimize this indicator for real-world trading. Traders should consider risk management practices and adapt settings to their specific market conditions and trading style.
Custom Time K-barCustom Time K-bar Indicator
This custom indicator highlights specific times on the chart, helping traders identify key moments based on user-defined time intervals. The script is designed to highlight two distinct times with different colors, which can be customized to suit the trader's needs.
Features:
Custom Time Inputs: Set two specific times in hours and minutes (e.g., 09:00 and 22:30).
Highlighting on Chart: The chart background changes color when the current time matches the defined times. Green for the first time and red for the second time.
Dynamic Labels: Labels display the exact time at the lowest and highest points of the corresponding candles, showing the user-defined times in a clear and visible format.
Timezone Adjustment: The indicator is adjusted for the GMT+8 timezone.
Customization:
Easily adjust the two key times and customize the colors for highlighting.
The script allows for easy tracking of key time events, which can be crucial for strategies that rely on specific timings during market hours.
This indicator is ideal for traders who want to track and visualize important times dynamically on the chart. Whether you're focusing on specific market events or just want to see certain time intervals highlighted, this script can help streamline your analysis.
Fibonacci Retracement/ExtensionThis Pine Script code implements Fibonacci retracement and extension levels based on a ZigZag pattern. Below is a breakdown of its functionality:
Overview
The script calculates Fibonacci retracement and extension levels by identifying swing highs and swing lows using the ZigZag algorithm. It then plots these levels on the chart for trend analysis.
1. ZigZag Length Input
Defines the ZigZag length, which determines the sensitivity of peak and trough identification.
2. Fibonacci Retracement Calculation
Computes Fibonacci retracement levels using swing highs and lows.
Uses pre-defined Fibonacci ratios (0.236, 0.382, 0.5, 0.618, 0.786, 1.0).
Adjusts line positions dynamically as the trend evolves.
3. Fibonacci Extension Calculation
Identifies Fibonacci extension levels for future price targets.
Uses previous ZigZag patterns to estimate potential price movements.
4. Trend and Fibonacci Configuration
Allows the user to configure Fibonacci trend analysis.
TrendSw: Sets the trend direction (1 = Bullish, -1 = Bearish, 0 = None).
ZigZagleg: Determines the countback value for retracement calculations.
Percentage Retracement from ATH█ OVERVIEW
The Percentage Retracement from ATH indicator is a dynamic trading utility designed to help traders gauge market pullbacks from the peak price. By calculating key retracement levels based on the All-Time High (ATH) and user‑defined percentage inputs, it offers clear visual cues to assist in identifying potential support and resistance zones.
█ KEY FEATURES
Custom Date — Use a custom start date so the indicator only considers specified price action.
Retracement Calculation — Determines ATH and calculates levels based on user‑defined percentages (0% to –100%).
Visual Customisation — Plots configurable horizontal lines and labels showing retracement percentages and prices.
Time Filtering — Uses time filtering to base levels on the desired data period.
█ PURPOSE
Assist traders in visualising the depth of price retracements from recent or historical peaks.
Identify critical zones where the market may find support or resistance after reaching an ATH.
Facilitate more informed entry and exit decisions by clearly demarcating retracement levels on the chart.
█ IDEAL USERS
Swing Traders — Looking to exploit pullbacks following strong upward moves.
Technical Analysts — Interested in pinpointing key retracement levels as potential reversal or continuation points.
Price Action Traders — Focused on the nuances of market peaks and subsequent corrections.
Strategy Developers — Keen to backtest and refine approaches centred on retracement dynamics.
Position Tracker 1.0Position Tracker 1.0 allows users to input their position using USD, quantity, or a DCA approach while setting take profit (TP) and stop loss (SL) levels based on either fixed dollar values or percentages. The indicator provides optional markers for TP/SL crossings and an entry label showing key trade details. A live tracker can be enabled for real-time P&L updates, and all visual elements are customizable for clarity and preference.
Instructions for Position Tracker 1.0
1. Input Method & Position Details:
* Choose between USD, Quantity, or DCA.
* Enter your entry price, entry time, investment amount, or quantity as needed.
2. TP & SL Setup:
* For each TP (up to 5) and the SL, select whether to use a fixed dollar target or a percentage
target relative to your entry price.
* Enter the corresponding price (if using Dollar) or percentage (if using Percentage).
* For TPs, specify the percentage of your position to sell when the level is hit.
3. Marker & Display Options:
* Toggle the TP and SL crossing markers on or off.
* Adjust which details (Price, Diff, Sell for TP; Price, Diff, Loss for SL) are shown on the labels.
* The entry label always shows the Avg. Cost and can optionally include the quantity, invested
amount, and live tracker (real-time P&L).
4. Visual Customization:
* Change text size, marker size, and colors for profit, loss, TP, and SL lines as desired.
Volume & Trend Confluence OscillatorVolume & Trend Confluence Oscillator (VTCO)
Overview:
The Volume & Trend Confluence Oscillator (VTCO) is a technical analysis tool designed to help traders assess market conditions by integrating volume analysis, momentum, and trend direction into a single oscillator. This indicator provides traders with additional confirmation when evaluating potential trade entries and exits.
Key Features:
Volume Analysis: Calculates a Z-score to detect unusual trading activity.
Momentum Measurement: Evaluates the rate of price change to gauge market velocity.
Trend Confirmation: Utilizes an Exponential Moving Average (EMA) to assess overall market direction.
Signal Filtering: Incorporates minimum movement thresholds and a confirmation period to reduce false signals.
Visual Enhancements: Background shading indicates trend direction, and buy/sell markers highlight key signals.
How It Works:
The VTCO applies a volume multiplier to momentum readings when volume activity significantly deviates from its historical norm. Additionally, it prioritizes momentum moves that align with the prevailing market trend. A smoothing mechanism refines the oscillator’s signal line, ensuring a more stable and actionable output. The indicator generates alerts when key conditions are met, assisting traders in identifying potential trend shifts.
Signal Generation:
Buy Signal: Triggered when the oscillator crosses above zero after an oversold condition, ideally within an uptrend.
Sell Signal: Triggered when the oscillator crosses below zero after an overbought condition, ideally within a downtrend.
Alerts: Configurable alerts notify traders when key market conditions are met.
Usage Considerations:
Works effectively across various timeframes but may provide more reliable signals on higher timeframes.
Best utilized in conjunction with additional technical indicators and risk management strategies.
No indicator guarantees future performance; proper analysis and trade management remain essential.
Disclaimer:
This indicator is provided for educational purposes only and should not be considered financial advice. Trading involves risk, and past performance is not indicative of future results. Always conduct independent analysis before making trading decisions.
prime rsiThe "PRIME RSI" is a custom variation of the traditional RSI (Relative Strength Index) that offers enhanced flexibility and precision. This indicator provides an adaptable approach for tracking market conditions across different timeframes, making it an ideal tool for both short-term and long-term traders.
Key Features:
Custom Timeframe Selection: Users can select any timeframe to calculate the RSI, providing the ability to analyze data beyond the current chart's timeframe.
Smoothing Methods: Choose between Exponential Moving Average (EMA), Simple Moving Average (SMA), or the Relative Moving Average (RMA) for smoother, more accurate RSI values.
Signal Line: The signal line is smoothed using the selected method and visualized with dynamic coloring to indicate bullish (green) or bearish (red) market conditions.
Overbought/Oversold Levels: Clear levels at 70 (overbought) and 30 (oversold), with fill zones to highlight extreme market conditions, helping traders spot potential reversal points.
Midline at 50: The centerline at 50 serves as a neutral zone, allowing traders to identify shifts in market momentum quickly.
Practical Use:
Trend Confirmation: Use the PRIME RSI to confirm the prevailing market trend, with signals above 50 suggesting bullish momentum and signals below 50 indicating bearish trends.
Overbought/Oversold Conditions: The indicator’s overbought and oversold regions help pinpoint potential market reversals, giving traders valuable entry and exit signals.
Ideal For: All types of traders who want a more flexible and customizable RSI for better trend analysis, especially those working with smaller timeframes or seeking a more responsive momentum indicator.
Relative Strength Index With Range ZoneRSI (Relative Strength Index) with 45-55 Range Zone
1. Introduction and Historical Background
The Relative Strength Index (RSI) is a momentum indicator developed in 1978 by J. Welles Wilder Jr. It measures the speed and magnitude of price changes to assess overbought and oversold conditions of an asset. This widely used oscillator ranges between 0 and 100.
Historically, the RSI was mainly used to detect trend reversals by identifying extreme levels: above 70 (overbought) and below 30 (oversold). However, its application has evolved, and new approaches refine its interpretation, such as adding a 45-55 neutral zone to identify consolidation (range) periods.
2. RSI Calculation
The RSI is calculated using the following formula:
RSI=100−(1001+RS)RSI=100−(1+RS100)
Where:
RS=Average gain over N periodsAverage loss over N periodsRS=Average loss over N periodsAverage gain over N periods
• RS (Relative Strength) is the ratio between the average gains and the average losses over N periods (typically 14 periods).
• Gains and losses are calculated based on daily price variations.
Example calculation with a 14-day period:
1. Compute daily gains and losses.
2. Take an exponential or simple moving average of these values over 14 days.
3. Apply the formula to get the RSI value.
3. Classic RSI Usage
The RSI is typically interpreted as follows:
• RSI > 70: Overbought → Possible correction or bearish reversal.
• RSI < 30: Oversold → Possible rebound or bullish reversal.
• RSI between 50 and 70: Bullish momentum.
• RSI between 30 and 50: Bearish momentum.
4. Adding the 45-55 Zone to Identify Range Phases
Adding a neutral zone between 45 and 55 helps identify consolidation periods, when price moves sideways without a strong trend.
• RSI between 45 and 55: The market is in a range, meaning neither buyers nor sellers dominate.
• RSI breaking out of this zone:
o Above 55: Indicates the start of a bullish trend.
o Below 45: Indicates the start of a bearish trend.
This zone is particularly useful for:
• Avoiding false signals by waiting for trend confirmation.
• Identifying ranging markets, favoring range trading strategies (buying at support, selling at resistance).
• Filtering trend-based entries, waiting for the RSI to exit the 45-55 zone.
5. Trading Strategies Using RSI with the 45-55 Range Zone
1. Range Trading:
• When the RSI oscillates between 45 and 55, it signals a lack of strong trend.
• Strategy:
o Identify a support and resistance level.
o Buy near support when the RSI touches 45.
o Sell near resistance when the RSI touches 55.
2. Breakout Trading:
• If the RSI exits the 45-55 zone:
o Above 55 → Buy (start of a bullish trend).
o Below 45 → Sell (start of a bearish trend).
• This breakout can be used as a confirmed entry signal.
3. Confirmation with Divergences:
• A bullish divergence (price making lower lows while RSI makes higher lows) is more relevant if the RSI moves above 55.
• A bearish divergence (price making higher highs while RSI makes lower highs) is stronger if the RSI drops below 45.
6. Conclusion
The RSI is a powerful tool for analyzing price momentum. Adding a 45-55 zone enhances its usage by clearly distinguishing:
• Consolidation phases (range markets).
• Trend beginnings when RSI breaks out of this range.
This approach improves RSI reliability by filtering out false signals and allowing traders to adapt their strategy based on market conditions.
First 9:15-9:20 Candle Levels (Daily)This indicator captures the closing price of the first 5-minute candle (9:15 - 9:20 AM) every trading day. It then calculates 0.09% above and below this closing price and plots horizontal lines. The indicator resets daily at 9:15 AM, ensuring it always tracks the latest market open. After 9:20 AM, the calculated levels remain visible throughout the day. The upper level is displayed in green, while the lower level is in red. This tool helps traders identify key price levels early in the session, useful for setting stop-losses, take-profit zones, or identifying potential breakout points.
TDI 7 MA and HISTOGRAMTDI %K Histogram with 7 MA
Overview
This indicator enhances trend and momentum analysis using the %K line from the Traders Dynamic Index (TDI), combined with a 7-period moving average (MA) and a histogram.
How It Works
The script calculates %K (similar to Stochastic RSI), representing the relative price position within a given range.
A 7-period Simple Moving Average (SMA) is applied to smooth the %K line, reducing noise and improving trend clarity.
A histogram is plotted based on the difference between %K and the 7-period MA:
Green bars indicate that %K is above the 7-period MA, suggesting bullish momentum.
Red bars indicate that %K is below the 7-period MA, suggesting bearish momentum.
Key Features
-%K Line (Blue) – Reflects short-term momentum shifts.
-7-period MA (Purple) – Helps smooth out fluctuations in %K for better trend identification.
-Histogram (Green/Red Columns) – Highlights momentum shifts visually.
Overbought (68), Midpoint (50), and Oversold (32) Levels – Provides reference points for potential reversals or trend continuation.
How to Use
Bullish Confirmation: When the histogram turns green and %K is above the 7 MA, it suggests upward momentum.
Bearish Confirmation: When the histogram turns red and %K is below the 7 MA, it suggests downward momentum.
Overbought/Oversold Conditions: Use the 68 and 32 levels as potential reversal zones, but always confirm with price action.
Midpoint (50 Level): Acts as a dynamic support/resistance area for momentum shifts.
This indicator is suitable for trend-following and momentum-based trading strategies, whether on lower timeframes for scalping or higher timeframes for swing trading.
Try it out and integrate it with your trading system to refine your entries and exits!
Investment Tracker Profit/lossThe Investment Tracker is a custom-built indicator designed to help traders and investors track their performance in real time. With this tool, you can easily monitor the gains or losses from your initial investment based on the price movement of a specific token. The indicator dynamically updates to show how much you've earned or lost, providing valuable insights into your investment strategy.
Key Features:
Profit/Loss Tracking: Instantly see whether you're in profit (green) or loss (red) based on the token's price movement.
Current Value Calculation: Tracks your investment’s current value by comparing the price at which you bought the token with its current price.
Visual Representation: Displays your initial investment, current value, and profit/loss on the chart with dynamic color coding (green for profit, red for loss).
Top-Right Display: Profit/loss data is conveniently displayed in the top-right corner of the chart, providing a clean and non-intrusive way to monitor your position.
Transparency: The indicator's lines have reduced opacity, allowing you to view your position without obstructing the price action.
How to Use:
Input your initial investment amount (in USD or your desired currency).
Set the buy price of the token when you made the purchase.
Watch the indicator update as the price of the token changes, providing real-time tracking of your profit or loss.
Whether you're holding a single position or monitoring multiple investments, this tracker gives you a clear and up-to-date view of how your portfolio is performing.
Perfect For:
Crypto traders who want to monitor their positions in real time.
Long-term investors looking to track the performance of their investments.
Anyone who wants a simple, visual way to measure their gains and losses in the market.
waves█ OVERVIEW
This library intended for use in Bar Replay provides functions to generate various wave forms (sine, cosine, triangle, square) based on time and customizable parameters. Useful for testing and in creating oscillators, indicators, or visual effects.
█ FUNCTIONS
• getSineWave()
• getCosineWave()
• getTriangleWave()
• getSquareWave()
█ USAGE EXAMPLE
//@version=6
indicator("Wave Example")
import kaigouthro/waves/1
plot(waves.getSineWave(cyclesPerMinute=15))
█ NOTES
* barsPerSecond defaults to 10. Adjust this if not using 10x in Bar Replay.
* Phase shift is in degrees.
---
Library "waves"
getSineWave(cyclesPerMinute, bar, barsPerSecond, amplitude, verticalShift, phaseShift)
`getSineWave`
> Calculates a sine wave based on bar index, cycles per minute (BPM), and wave parameters.
Parameters:
cyclesPerMinute (float) : (float) The desired number of cycles per minute (BPM). Default is 30.0.
bar (int) : (int) The current bar index. Default is bar_index.
barsPerSecond (float) : (float) The number of bars per second. Default is 10.0 for Bar Replay
amplitude (float) : (float) The amplitude of the sine wave. Default is 1.0.
verticalShift (float) : (float) The vertical shift of the sine wave. Default is 0.0.
phaseShift (float) : (float) The phase shift of the sine wave in radians. Default is 0.0.
Returns: (float) The calculated sine wave value.
getCosineWave(cyclesPerMinute, bar, barsPerSecond, amplitude, verticalShift, phaseShift)
`getCosineWave`
> Calculates a cosine wave based on bar index, cycles per minute (BPM), and wave parameters.
Parameters:
cyclesPerMinute (float) : (float) The desired number of cycles per minute (BPM). Default is 30.0.
bar (int) : (int) The current bar index. Default is bar_index.
barsPerSecond (float) : (float) The number of bars per second. Default is 10.0 for Bar Replay
amplitude (float) : (float) The amplitude of the cosine wave. Default is 1.0.
verticalShift (float) : (float) The vertical shift of the cosine wave. Default is 0.0.
phaseShift (float) : (float) The phase shift of the cosine wave in radians. Default is 0.0.
Returns: (float) The calculated cosine wave value.
getTriangleWave(cyclesPerMinute, bar, barsPerSecond, amplitude, verticalShift, phaseShift)
`getTriangleWave`
> Calculates a triangle wave based on bar index, cycles per minute (BPM), and wave parameters.
Parameters:
cyclesPerMinute (float) : (float) The desired number of cycles per minute (BPM). Default is 30.0.
bar (int) : (int) The current bar index. Default is bar_index.
barsPerSecond (float) : (float) The number of bars per second. Default is 10.0 for Bar Replay
amplitude (float) : (float) The amplitude of the triangle wave. Default is 1.0.
verticalShift (float) : (float) The vertical shift of the triangle wave. Default is 0.0.
phaseShift (float) : (float) The phase shift of the triangle wave in radians. Default is 0.0.
Returns: (float) The calculated triangle wave value.
getSquareWave(cyclesPerMinute, bar, barsPerSecond, amplitude, verticalShift, dutyCycle, phaseShift)
`getSquareWave`
> Calculates a square wave based on bar index, cycles per minute (BPM), and wave parameters.
Parameters:
cyclesPerMinute (float) : (float) The desired number of cycles per minute (BPM). Default is 30.0.
bar (int) : (int) The current bar index. Default is bar_index.
barsPerSecond (float) : (float) The number of bars per second. Default is 10.0 for Bar Replay
amplitude (float) : (float) The amplitude of the square wave. Default is 1.0.
verticalShift (float) : (float) The vertical shift of the square wave. Default is 0.0.
dutyCycle (float) : (float) The duty cycle of the square wave (0.0 to 1.0). Default is 0.5 (50% duty cycle).
phaseShift (float) : (float) The phase shift of the square wave in radians. Default is 0.0.
Returns: (float) The calculated square wave value.
Source StrategyThis strategy converts indicator signals into long and short entries and exits. It looks for non-zero values from your chosen entry sources to enter positions, and from exit sources to close positions.
The strategy supports both longs and shorts. For long trades, it looks at your selected long source and long exit source; for short trades, it looks at your chosen short source and short exit source. The strategy enters a position when either source produces any value except zero.
Stop loss and take profit orders are incorporated for risk management. These orders are calculated as a percentage of your position's value, providing dynamic risk management as price moves. The percentage levels for stop loss and take profit orders are configurable in the settings, allowing you to adjust your risk parameters based on market conditions and trading style.
To use the strategy, add it to your chart. The input parameters can be configured in the strategy's settings panel, including your signal sources for long and short entries and exits, and the percentage levels for stop loss and take profit orders.
KalmanfilterLibrary "Kalmanfilter"
A sophisticated Kalman Filter implementation for financial time series analysis
@author Rocky-Studio
@version 1.0
initialize(initial_value, process_noise, measurement_noise)
Initializes Kalman Filter parameters
Parameters:
initial_value (float) : (float) The initial state estimate
process_noise (float) : (float) The process noise coefficient (Q)
measurement_noise (float) : (float) The measurement noise coefficient (R)
Returns: A tuple containing
update(prev_state, prev_covariance, measurement, process_noise, measurement_noise)
Update Kalman Filter state
Parameters:
prev_state (float)
prev_covariance (float)
measurement (float)
process_noise (float)
measurement_noise (float)
calculate_measurement_noise(price_series, length)
Adaptive measurement noise calculation
Parameters:
price_series (array)
length (int)
calculate_measurement_noise_simple(price_series)
Parameters:
price_series (array)
update_trading(prev_state, prev_velocity, prev_covariance, measurement, volatility_window)
Enhanced trading update with velocity
Parameters:
prev_state (float)
prev_velocity (float)
prev_covariance (float)
measurement (float)
volatility_window (int)
model4_update(prev_mean, prev_speed, prev_covariance, price, process_noise, measurement_noise)
Kalman Filter Model 4 implementation (Benhamou 2018)
Parameters:
prev_mean (float)
prev_speed (float)
prev_covariance (array)
price (float)
process_noise (array)
measurement_noise (float)
model4_initialize(initial_price)
Initialize Model 4 parameters
Parameters:
initial_price (float)
model4_default_process_noise()
Create default process noise matrix for Model 4
model4_calculate_measurement_noise(price_series, length)
Adaptive measurement noise calculation for Model 4
Parameters:
price_series (array)
length (int)
Daily COC Strategy with SHERLOCK WAVESThis indicator implements a unique trading strategy known as the "Daily COC (Candle Over Candle) Strategy" enhanced with "SHERLOCK WAVES" for pattern recognition. It's designed for traders looking to capitalize on specific candlestick formations with a negative risk-reward ratio, with the aim of achieving a high win rate (over 70%) through numerous trading opportunities, despite each trade having a higher risk relative to the reward.
Key Features:
Pattern Recognition: Identifies a setup based on three consecutive candles - a red candle followed by a shooting star, then an entry candle that does not break below the shooting star's low.
Negative Risk/Reward Trade Selection: Focuses on entries where the potential stop loss is greater than the take profit, banking on a high win rate to offset the individual trade's negative risk-reward ratio.
Visual Signals:
Green Label: Marks potential entry points at the high of the candle before the entry.
Green Dot: Indicates a winning trade closure.
Red Dot: Signals a losing trade closure.
Blue Circle: Warns when the current candle is within 2% of breaking above the previous candle's high, suggesting a potential setup is developing.
Green Circle: Plots the take profit level.
Red Circle: Plots the stop loss level.
Dynamic Statistics: A live updating label showing the number of trades, wins, losses, open trades, current account balance, and win percentage.
Customizable Parameters:
Risk % per Trade: Adjust the percentage of your account balance you're willing to risk on each trade.
Initial Account Balance: Set your starting balance for tracking performance.
Start Date for Strategy: Define when the strategy should start calculating from, allowing for backtesting.
Alerts:
An alert condition is set for when a potential trade setup is developing, helping traders prepare for entries.
Usage Tips:
This strategy is predicated on the idea that a high win rate can compensate for the negative risk-reward ratio of individual trades. It might not suit all market conditions or traders' risk profiles.
Use this strategy in conjunction with other analysis methods to validate trade setups.
Note: Always backtest thoroughly before applying to live markets. Consider this tool as part of a broader trading strategy, not a standalone solution. Monitor your win rate and adjust your risk management accordingly to ensure the strategy remains profitable over time.
This description now correctly explains the purpose behind the negative risk-reward ratio in the context of your trading strategy.
Dow Theory Swing Trading-DexterThis Pine Script strategy that implements a basic price action-based trading system inspired by Dow Theory, focusing on swing highs and swing lows. This strategy will generate buy and sell signals based on the formation of higher highs (HH) and higher lows (HL) for an uptrend, and lower highs (LH) and lower lows (LL) for a downtrend.
Swing Highs and Swing Lows:
The script identifies swing highs and swing lows using the ta.highest and ta.lowest functions over a specified lookback period.
A swing high is identified when the high of the current bar is the highest high over the lookback period.
A swing low is identified when the low of the current bar is the lowest low over the lookback period.
Trend Detection:
An uptrend is detected when the current low is higher than the last identified swing low.
A downtrend is detected when the current high is lower than the last identified swing high.
Buy and Sell Signals:
A buy signal is generated when the price closes above the last swing high during an uptrend.
A sell signal is generated when the price closes below the last swing low during a downtrend.
Plotting:
Swing highs and swing lows are plotted on the chart using plotshape.
Buy and sell signals are also plotted on the chart for visual reference.
How to Use:
Copy and paste the script into the Pine Script editor in TradingView.
Adjust the lookback period as needed to suit your trading style and timeframe.
Apply the script to your chart and it will generate buy and sell signals based on the price action.
NOTE: Please uncheck the all the unwanted symbol from chart for clear view .
Global M2 Index Percentage### **Global M2 Index Percentage**
**Description:**
The **Global M2 Index Percentage** is a custom indicator designed to track and visualize the global money supply (M2) in a normalized percentage format. It aggregates M2 data from major economies (e.g., the US, EU, China, Japan, and the UK) and adjusts for exchange rates to provide a comprehensive view of global liquidity. This indicator helps traders and investors understand the broader macroeconomic environment, identify trends in money supply, and make informed decisions based on global liquidity conditions.
---
### **How It Works:**
1. **Data Aggregation**:
- The indicator collects M2 data from key economies and adjusts it using exchange rates to calculate a global M2 value.
- The formula for global M2 is:
\
2. **Normalization**:
- The global M2 value is normalized into a percentage (0% to 100%) based on its range over a user-defined period (default: 13 weeks).
- The formula for normalization is:
\
3. **Visualization**:
- The indicator plots the M2 Index as a line chart.
- Key reference levels are highlighted:
- **10% (Red Line)**: Oversold level (low liquidity).
- **50% (Black Line)**: Neutral level.
- **80% (Green Line)**: Overbought level (high liquidity).
---
### **How to Use the Indicator:**
#### **1. Understanding the M2 Index:**
- **Below 10%**: Indicates extremely low liquidity, which may signal economic contraction or tight monetary policy.
- **Above 80%**: Indicates high liquidity, which may signal loose monetary policy or potential inflationary pressures.
- **Between 10% and 80%**: Represents a neutral to moderate liquidity environment.
#### **2. Trading Strategies:**
- **Long-Term Investing**:
- Use the M2 Index to assess global liquidity trends.
- **High M2 Index (e.g., >80%)**: Consider investing in risk assets (stocks, commodities) as liquidity supports growth.
- **Low M2 Index (e.g., <10%)**: Shift to defensive assets (bonds, gold) as liquidity tightens.
- **Short-Term Trading**:
- Combine the M2 Index with technical indicators (e.g., RSI, MACD) for timing entries and exits.
- **M2 Index Rising + RSI Oversold**: Potential buying opportunity.
- **M2 Index Falling + RSI Overbought**: Potential selling opportunity.
#### **3. Macroeconomic Analysis**:
- Use the M2 Index to monitor the impact of central bank policies (e.g., quantitative easing, rate hikes).
- Correlate the M2 Index with inflation data (CPI, PPI) to anticipate inflationary or deflationary trends.
---
### **Key Features:**
- **Customizable Timeframe**: Adjust the lookback period (e.g., 13 weeks, 26 weeks) to suit your trading style.
- **Multi-Economy Data**: Aggregates M2 data from the US, EU, China, Japan, and the UK for a global perspective.
- **Normalized Output**: Converts raw M2 data into an easy-to-interpret percentage format.
- **Reference Levels**: Includes key levels (10%, 50%, 80%) for quick analysis.
---
### **Example Use Case:**
- **Scenario**: The M2 Index rises from 49% to 62% over two weeks.
- **Interpretation**: Global liquidity is increasing, potentially due to central bank stimulus.
- **Action**:
- **Long-Term**: Increase exposure to equities and commodities.
- **Short-Term**: Look for buying opportunities in oversold assets (e.g., RSI < 30).
---
### **Why Use the Global M2 Index Percentage?**
- **Macro Insights**: Understand the broader economic environment and its impact on financial markets.
- **Risk Management**: Identify periods of high or low liquidity to adjust your portfolio accordingly.
- **Enhanced Timing**: Combine with technical analysis for better entry and exit points.
---
### **Conclusion:**
The **Global M2 Index Percentage** is a powerful tool for traders and investors seeking to incorporate macroeconomic data into their strategies. By tracking global liquidity trends, this indicator helps you make informed decisions, whether you're trading short-term or planning long-term investments. Add it to your TradingView charts today and gain a deeper understanding of the global money supply!
---
**Disclaimer**: This indicator is for informational purposes only and should not be considered financial advice. Always conduct your own research and consult with a professional before making investment decisions.
On Balance Volume with Cross DetectionThis indicator enhances the On Balance Volume (OBV) indicator by detecting and visually highlighting crossovers and crossunders between the OBV and its smoothed moving average. The script colors the background of the chart to make these key events more noticeable: red highlights a bearish crossunder when the OBV crosses below the smoothed OBV, while green marks a bullish crossover when the OBV crosses above the smoothed OBV. By focusing on these significant interactions, the script provides traders with a clear visual cue to help identify potential buying and selling opportunities based on the relationship between OBV and its smoothed trend.
This script offers several customizable features to suit different trading preferences. The main editable parameter is the type of moving average used to smooth the OBV: you can choose from options such as Simple Moving Average (SMA), Exponential Moving Average (EMA), Smoothed Moving Average (RMA), Weighted Moving Average (WMA), or Volume Weighted Moving Average (VWMA). The length of the moving average can also be adjusted to better match the trader’s desired sensitivity, with the default set to 14 periods. These options allow traders to tailor the script to their preferred smoothing method and time frame, making it a flexible tool for a variety of strategies. The ability to switch between different moving averages and adjust their lengths ensures that the script can be adapted to various market conditions and trading styles.
This indicator enhances the analysis of the On Balance Volume (OBV) indicator by visually highlighting key crossovers and crossunders with its smoothed moving average. With customizable settings for different moving averages and lengths, traders can tailor the script to their specific strategies. By offering clear visual cues through background coloring, it helps quickly identify potential buy and sell signals. When combined with other technical analysis tools, this script can further improve trading decisions by providing additional context and confirmation, allowing traders to create a more robust and comprehensive trading strategy.
Binance Pseudo Funding FeeThe indicator calculates the Funding Fee for Binance based on the Premium Index provided by TradingView. The calculation formula can be found here: Binance Funding Rate Introduction . This is NOT the official rate visible on binance.com and used for settlements, but rather an estimated rate, which is inherently INACCURATE . The accuracy of the calculation heavily depends on the timeframe, with almost perfect results on minute-based timeframes.
For the most accurate calculations, you need to visit Binance Funding History and fill in the corresponding Interval , Interest Rate , and Funding Cap/Floor settings for the specific symbol in the indicator's settings. I understand this is not convenient, but for now, this is how it works.
The blue bars indicate the settlement time. Funding can be smoothed using moving averages. Both the funding rate and the moving averages are displayed using plot and are labeled, so you can set alerts on them.
Displaced MAsDisplaced Moving Averages with Customizable Bands
Overview
The "Displaced Moving Averages with Customizable Bands" indicator is a powerful and versatile tool designed to provide a comprehensive view of price action in relation to various moving averages (MAs) and their volatility. It offers a high degree of customization, allowing traders to tailor the indicator to their specific needs and trading styles. The indicator features a primary moving average with multiple configurable percentage-based displacement bands. It also includes additional moving averages with standard deviation bands for a more in-depth analysis of different timeframes.
Key Features
Multiple Moving Average Types:
Choose from a wide range of popular moving average types for the primary MA calculation:
WMA (Weighted Moving Average)
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
HMA (Hull Moving Average)
VWAP (Volume-Weighted Average Price)
Smoothed VWAP
Rolling VWAP
The flexibility to select the most appropriate MA type allows you to adapt the indicator to different market conditions and trading strategies.
Smoothed VWAP with Customizable Smoothing:
When "Smoothed VWAP" is selected, you can further refine it by choosing a smoothing type: SMA, EMA, WMA, or HMA.
Customize the smoothing period based on the chart's timeframe (1H, 4H, D, W) or use a default period. This feature offers fine-grained control over the responsiveness of the VWAP calculation.
Rolling VWAP with Adjustable Lookback:
The "Rolling VWAP" option calculates the VWAP over a user-defined lookback period.
Customize the lookback length for different timeframes (1H, 4H, D, W) or use a default period. This provides a dynamic VWAP calculation that adapts to the chosen timeframe.
Customizable Lookback Lengths:
Define the lookback period for the primary moving average calculation.
Tailor the lookback lengths for different timeframes (1H, 4H, D, W) or use a default value.
This allows you to adjust the sensitivity of the MA to recent price action based on the timeframe you are analyzing. Also has inputs for 5m, and 15m timeframes.
Percentage-Based Displacement Bands:
The core feature of this indicator is the ability to plot multiple displacement bands above and below the primary moving average.
These bands are calculated as a percentage offset from the MA, providing a clear visualization of price deviations.
Visibility Toggles: Independently show or hide each band (+/- 2%, 5%, 7%, 10%, 15%, 20%, 25%, 30%, 40%, 50%, 60%, 70%).
Customizable Colors: Assign unique colors to each band for easy visual identification.
Adjustable Multipliers: Fine-tune the percentage displacement for each band using individual multiplier inputs.
The bands are useful for identifying potential support and resistance levels, overbought/oversold conditions, and volatility expansions/contractions.
Labels for Displacement Bands:
The indicator displays labels next to each plotted band, clearly indicating the percentage displacement (e.g., "+7%", "-15%").
Customize the label text color for optimal visibility.
The labels can be horizontally offset by a user-defined number of bars.
Additional Moving Averages with Standard Deviation Bands:
The indicator includes three additional moving averages, each with upper and lower standard deviation bands. These are designed to provide insights into volatility on different timeframes.
Timeframe Selection: Choose the timeframes for these additional MAs (e.g., Weekly, 4-Hour, Daily).
Sigma (Standard Deviation Multiplier): Adjust the standard deviation multiplier for each MA.
MA Length: Set the lookback period for each additional MA.
Visibility Toggles: Show or hide the lower band of MA1, the middle/upper/lower bands of MA2, and the bands of MA3.
4h Bollinger Middle MA is unticked by default to provide a less cluttered chart
These additional MAs are particularly useful for multi-timeframe analysis and identifying potential trend reversals or volatility shifts.
How to Use
Add the indicator to your TradingView chart.
Customize the settings:
Select the desired Moving Average Type for the primary MA.
If using Smoothed VWAP, choose the Smoothing Type and adjust the Smoothing Period for different timeframes.
If using Rolling VWAP, adjust the Lookback Length for different timeframes.
Set the Lookback Length for the primary MA for different timeframes.
Toggle the visibility of the Displacement Bands and adjust their Colors and Multipliers.
Customize the Label Text Color and Offset.
Configure the Timeframes, Sigma, and MA Length for the additional moving averages.
Toggle the visibility of the additional MA bands.
Interpret the plotted lines and bands:
Primary MA: Represents the average price over the selected lookback period, calculated using the chosen MA type.
Displacement Bands: Indicate potential support and resistance levels, overbought/oversold conditions, and volatility ranges. Price trading outside these bands may signal significant deviations from the average.
Additional MAs with Standard Deviation Bands: Provide insights into volatility on different timeframes. Wider bands suggest higher volatility, while narrower bands indicate lower volatility.
Potential Trading Applications
Trend Identification: Use the primary MA to identify the overall trend direction.
Support and Resistance: The displacement bands can act as dynamic support and resistance levels.
Overbought/Oversold: Price reaching the outer displacement bands may suggest overbought or oversold conditions, potentially indicating a pullback or reversal.
Volatility Analysis: The standard deviation bands of the additional MAs can help assess volatility on different timeframes.
Multi-Timeframe Analysis: Combine the primary MA with the additional MAs to gain a broader perspective on price action across multiple timeframes.
Entry and Exit Signals: Use the interaction of price with the MA and bands to generate potential entry and exit signals. For example, a bounce off a lower band could be a buy signal, while a rejection from an upper band could be a sell signal.
Disclaimer
This indicator is for informational and educational purposes only and should not be considered financial advice. Trading involves risk, and past performance is not indicative of future results. Always conduct thorough research and consider your risk tolerance before making any trading decisions.
Enjoy using the "Displaced Moving Averages with Customizable Bands" indicator!
Higher Timeframe SeparatorThis script helps visually identify when a higher timeframe candle starts by drawing a vertical line. It also shades the area above or below the opening price, making it easier to track price movement relative to the higher timeframe.
Why It's Useful
If you use multiple timeframes, this indicator provides a clear visual reference for where the price is relative to the higher timeframe. This is much more convenient than constantly switching between charts. You can see in the screenshot below how much clearer the price action becomes when the indicator is enabled:
Additional Benefit
If you trade on a lower timeframe and notice that the number of bars between separators is inconsistent, it means there weren’t enough trades during that period—indicating low liquidity. Illiquid instruments can be riskier to trade. For example, observe how the vertical lines on the left side of the image below are densely packed:
HTC peppermint_07 CCI w signal + s&r RSI
This CCI version enhances the traditional Commodity Channel Index (CCI) by integrating a dynamically calculated Relative Strength Index (RSI) that acts as support and resistance as shown in the screenshot, it can add as a confirmation to the divergence found in the CCI.
Key Features:
Enhanced CCI: The primary plot (black line but customizable) represents the standard CCI, providing insight into price momentum and potential overbought/oversold conditions.
Dynamic RSI Support/Resistance: The upper and lower bands (medium cyan line) are derived from a smoothed RSI, dynamically adjusting to the current market volatility. These bands serve as potential support and resistance levels for the CCI as additional confirmation for the divergence.
Overbought/Oversold Zones: The traditional overbought (+100) and oversold (-100) levels for CCI are marked with horizontal dotted lines.
Benefits:
Improved Entry/Exit Signals: Combining CCI with dynamic RSI support/resistance may offer more precise trading signals compared to using CCI alone.
Dynamic Adaptation: The RSI-based bands adapt to changing market conditions, potentially providing more relevant support and resistance levels.
Divergence Confirmation: dynamic s&r RSI adds confluence to potential trend reversals identified by the CCI.
Potential Usage:
Traders might use this indicator to:
Identify potential overbought/oversold conditions using the CCI and its relationship to the dynamic RSI bands.
Look for breakouts beyond the dynamic support/resistance levels as potential entry points.
Confirm potential trend reversals using RSI divergence (cyan and red label above divergence) signals.
Further Development Considerations:
Customizable Parameters: Allowing users to adjust the CCI length, RSI periods, and smoothing factors would enhance flexibility.
Alert Conditions: Adding alerts for breakouts, overbought/oversold conditions, and divergence signals would improve usability.
Backtesting: Thoroughly backtesting the indicator's performance across different assets and timeframes is essential before using it for live trading.
DISCLAIMER: !!
indicator is a custom technical analysis tool designed for educational and informational purposes only. It should not be construed as financial advice or a recommendation to buy or sell any security. Trading involves substantial risk of loss and may not be suitable for all investors.
Key Points to Consider:
No Guarantee of Profitability: The indicator's past performance is not indicative of future results. No trading strategy can guarantee profits or eliminate the risk of losses. You could lose some or all of your investment.
Use at Your Own Risk: Use of this indicator is solely at your own discretion and risk. You are responsible for your trading decisions. The developers and distributors of this indicator are not liable for any losses incurred as a result of using it.
Not Financial Advice: This indicator does not provide financial advice. Consult with a qualified financial advisor before making any investment decisions.
Backtesting Limitations: Backtested results, if presented, should be viewed with caution. Past performance may not reflect future results due to various factors, including changing market conditions and the limitations of backtesting methodologies.
Indicator Limitations: Technical indicators, including this one, are not perfect. They can generate false signals, and their effectiveness can vary depending on market conditions and the specific parameters used.
Parameter Optimization: Optimizing indicator parameters for past performance can lead to overfitting, which may not translate to future profitability.
No Warranty: The indicator is provided "as is" without any warranty of any kind, either express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.
Changes and Updates: The developers may make changes or updates to the indicator without notice.
By using the "HTC peppermint_07 CCI w signal + s&r RSI" indicator, you acknowledge and agree to the terms of this disclaimer. If you do not agree with these terms, do not use the indicator.