Correlation Coefficient [Giang]### **Introduction to the "Correlation Coefficient" Indicator**
#### **Idea behind the Indicator**
The "Correlation Coefficient" indicator was developed to analyze the linear relationship between Bitcoin (**BTCUSD**) and other important economic indices or financial assets, such as:
- **SPX** (S&P 500 Index): Represents the U.S. stock market.
- **DXY** (Dollar Index): Reflects the strength of the USD against major currencies.
- **SPY** (ETF representing the S&P 500): A popular trading instrument.
- **GOLD** (Gold price): A traditional safe-haven asset.
The correlation between these assets can help traders understand how Bitcoin reacts to market movements of traditional financial instruments, providing opportunities for more effective trading decisions.
Additionally, the indicator allows users to **customize asset symbols for comparison**, not limited to the default indices (SPX, DXY, SPY, GOLD). This flexibility enables traders to tailor their analysis to specific goals and portfolios.
---
#### **Significance and Use of Correlation in Trading**
**Correlation** is a measure of the linear relationship between two data series. In the context of this indicator:
- **The correlation coefficient ranges from -1 to 1**:
- **1**: Perfect positive relationship (both increase or decrease together).
- **0**: No linear relationship.
- **-1**: Perfect negative relationship (one increases while the other decreases).
- **Use in trading**:
- Identify **strong relationships or unusual divergences** between Bitcoin and other assets.
- Help determine **market sentiment**: For example, if Bitcoin has a negative correlation with DXY, traders might expect Bitcoin to rise when the USD weakens.
- Provide a foundation for hedging strategies or investments based on inter-asset relationships.
---
#### **Components of the Indicator**
The "Correlation Coefficient" indicator consists of the following key components:
1. **Main Data (BTCUSD)**:
- The closing price of Bitcoin is used as the central asset for calculations.
2. **Comparison Data**:
- Users can select different asset symbols for comparison. By default, the indicator supports:
- **SPX**: Stock market index.
- **DXY**: Dollar Index.
- **SPY**: Popular ETF.
- **GOLD**: Gold price.
3. **Correlation Coefficients**:
- Calculated between BTC and each comparison index, based on a Weighted Moving Average (WMA) over a user-defined period.
4. **Graphical Representation**:
- Displays individual correlation coefficients with each comparison index, making it easier for traders to track and analyze.
---
#### **How to Analyze and Use the Indicator**
**1. Identify Key Correlations:**
- Observe the correlation lines between BTC and the indices to determine positive or negative relationships.
- Example:
- If the **Correlation Coefficient (BTC-DXY)** sharply declines to -1, this indicates that when USD strengthens, Bitcoin tends to weaken.
**2. Analyze the Strength of Correlations:**
- **Strong Correlations**: If the coefficient is close to 1 or -1, the relationship between the two assets is very clear.
- **Weak Correlations**: If the coefficient is near 0, Bitcoin may be influenced by other factors outside the compared index.
**3. Develop Trading Strategies:**
- Use correlations to predict Bitcoin's price movements:
- If BTC has an inverse relationship with **DXY**, traders might consider selling BTC when the USD strengthens.
- If BTC and **SPX** are strongly correlated, traders can monitor the stock market to predict Bitcoin's trend.
**4. Evaluate Changes Over Time:**
- Use different timeframes (daily, weekly) to track the correlation's fluctuations.
- Look for unusual signals, such as a breakdown or shift from positive to negative relationships.
---
#### **Conclusion**
The "Correlation Coefficient" indicator is a powerful tool that helps traders analyze the relationship between Bitcoin and major financial indices. The ability to customize asset symbols for comparison makes the indicator flexible and suitable for various trading strategies. When used correctly, this indicator not only provides insights into market sentiment but also supports the development of intelligent trading strategies and optimized profits.
Indicators and strategies
Did it move?That is the eternal question in trading.: Is the price moving? This indicators aims to answer that question. It is based on concepts from 2 Bars from "The Strat". This indicator measures the distance the current price is above the previous high or below the previous low and on two timeframes. The assumption is that the price is moving as long as the price is above or below the previous bar.
The distance the price moved is normalized by the standard deviation. This serves the trader in two ways: 1) you can quickly determine if a price movement is significant (score > 1), and 2) you can plan exits when the score falls below 1 (e.g., movement become insignificant). Movement upwards are colored green and down movements are red. When the price is also above the higher timeframe high (below the HTF low), the color are more intense. When the price is not moving, the background is highlighted.
Finally, there are two alert setting. One is for then the price stops moving (movement score falls below a threshold. The other is a exit/reversal warning. For example if there is a strong move in the opposite it will trigger that alert.
WVAD (Optimized Log Scaled)The WVAD (Optimized Log Scaled) indicator is a refined version of the classic Williams' Volume Accumulation/Distribution (WVAD). This version introduces logarithmic scaling for better visualization and usability, especially when dealing with large value ranges. It also includes EMA smoothing to highlight trends and reduce noise, providing traders with a more precise and clear representation of market dynamics.
Key Features:
1.Logarithmic Scaling:
Applies a log-based transformation to the WVAD values, ensuring extreme values are compressed while maintaining the overall structure of the data.
The log scaling allows better readability and interpretation, particularly for volatile or high-volume markets.
2.EMA Smoothing:
Uses an exponential moving average (EMA) to smooth the logarithmic WVAD values.
Helps reduce noise while preserving short-term trends, making it suitable for both trend-following and reversal strategies.
3.Customizable Parameters:
N (Lookback Period): Defines the accumulation period for calculating WVAD.
EMA Smoothing Period: Controls the sensitivity of the EMA applied to the logarithmic WVAD.
Decimal Places: Adjusts the precision of the displayed values for clearer visualization.
Line Colors: Fully customizable colors for both the raw WVAD line and the smoothed EMA.
4.Directional Preservation:
Keeps the positive and negative signs of WVAD to reflect accumulation (buying pressure) or distribution (selling pressure) in the market.
5.Zero Line Reference:
A horizontal zero line is plotted to help traders easily identify bullish (above 0) or bearish (below 0) market conditions.
How to Use:
Identify Trends: The smoothed WVAD line (EMA) can help detect trends or shifts in buying/selling pressure.
Crossovers: Use crossovers of the WVAD with the zero line as potential buy or sell signals.
Divergence: Spot divergences between price and the WVAD for early indications of reversals.
Applications:
Suitable for intraday, swing, or longer-term trading strategies.
Works across various asset classes, including stocks, commodities, and cryptocurrencies.
Chande Volatility-Based Trailing Stops This indicator is developed from a description outlined in the Chande - Kroll book, "The New Technical Trader". It is designed to help control risk by plotting two lines that function as long and short trailing stops.
How does it work?
"These stops are derived from recent highest high or lowest low. They adjust based on volatility. However, to avoid giving up a sizable chunk of profit before the stop is hit, it is modified in such a way that the stop can only advance with price, not retreat. This will lock in a greater portion of potential profits..."
Settings:
The default settings are those described in the book. They are described as being best for intermediate term trades. Use the multiplier to tighten or loosen the stop. A smaller multiplier will result in tighter stops. It is recommended to adjust this value for your preferred timeframe. You can toggle the trailing stop lines on or off as well as cross over marker.
SMT Divergence ICT 01 [TradingFinder] Smart Money Technique🔵 Introduction
SMT Divergence (short for Smart Money Technique Divergence) is a trading technique in the ICT Concepts methodology that focuses on identifying divergences between two positively correlated assets in financial markets.
These divergences occur when two assets that should move in the same direction move in opposite directions. Identifying these divergences can help traders spot potential reversal points and trend changes.
Bullish and Bearish divergences are clearly visible when an asset forms a new high or low, and the correlated asset fails to do so. This technique is applicable in markets like Forex, stocks, and cryptocurrencies, and can be used as a valid signal for deciding when to enter or exit trades.
Bullish SMT Divergence : This type of divergence occurs when one asset forms a higher low while the correlated asset forms a lower low. This divergence is typically a sign of weakness in the downtrend and can act as a signal for a trend reversal to the upside.
Bearish SMT Divergence : This type of divergence occurs when one asset forms a higher high while the correlated asset forms a lower high. This divergence usually indicates weakness in the uptrend and can act as a signal for a trend reversal to the downside.
🔵 How to Use
SMT Divergence is an analytical technique that identifies divergences between two correlated assets in financial markets.
This technique is used when two assets that should move in the same direction move in opposite directions.
Identifying these divergences can help you pinpoint reversal points and trend changes in the market.
🟣 Bullish SMT Divergence
This divergence occurs when one asset forms a higher low while the correlated asset forms a lower low. This divergence indicates weakness in the downtrend and can signal a potential price reversal to the upside.
In this case, when the correlated asset is forming a lower low, and the main asset is moving lower but the correlated asset fails to continue the downward trend, there is a high probability of a trend reversal to the upside.
🟣 Bearish SMT Divergence
Bearish divergence occurs when one asset forms a higher high while the correlated asset forms a lower high. This type of divergence indicates weakness in the uptrend and can signal a potential trend reversal to the downside.
When the correlated asset fails to make a new high, this divergence may be a sign of a trend reversal to the downside.
🟣 Confirming Signals with Correlation
To improve the accuracy of the signals, use assets with strong correlation. Forex pairs like OANDA:EURUSD and OANDA:GBPUSD , or cryptocurrencies like COINBASE:BTCUSD and COINBASE:ETHUSD , or commodities such as gold ( FX:XAUUSD ) and silver ( FX:XAGUSD ) typically have significant correlation. Identifying divergences between these assets can provide a strong signal for a trend change.
🔵 Settings
Second Symbol : This setting allows you to select another asset for comparison with the primary asset. By default, "XAUUSD" (Gold) is set as the second symbol, but you can change it to any currency pair, stock, or cryptocurrency. For example, you can choose currency pairs like EUR/USD or GBP/USD to identify divergences between these two assets.
Divergence Fractal Periods : This parameter defines the number of past candles to consider when identifying divergences. The default value is 2, but you can change it to suit your preferences. This setting allows you to detect divergences more accurately by selecting a greater number of candles.
Bullish Divergence Line : Displays a line showing bullish divergence from the lows.
Bearish Divergence Line : Displays a line showing bearish divergence from the highs.
Bullish Divergence Label : Displays the "+SMT" label for bullish divergences.
Bearish Divergence Label : Displays the "-SMT" label for bearish divergences.
🔵 Conclusion
SMT Divergence is an effective tool for identifying trend changes and reversal points in financial markets based on identifying divergences between two correlated assets. This technique helps traders receive more accurate signals for market entry and exit by analyzing bullish and bearish divergences.
Identifying these divergences can provide opportunities to capitalize on trend changes in Forex, stocks, and cryptocurrency markets. Using SMT Divergence along with risk management and confirming signals with other technical analysis tools can improve the accuracy of trading decisions and reduce risks from sudden market changes.
Pine Script Boilerplate ExampleI frequently receive questions about my coding style and logic, so I decided to publish a simple indicator that draws the OHLC of a higher timeframe as an example of my coding style. This example will also explain my approach to writing indicators.
This indicator showcases how I use Types and Methods to structure my code and maintain clarity in logic. It demonstrates how I collect input data, organize the flow of the code, and utilize the TradingView method feature.
The example illustrates:
1. The use of input settings within a settings object to keep configurations grouped together.
2. The use of Types to create an object that consolidates relevant data.
3. The collection of objects to create, update, and render elements on the chart.
Session Highs and Lows IndicatorThis indicator marks the high and low levels for key trading sessions, allowing traders to identify significant price zones across different markets. The default session times are defined in UTC and will automatically adjust to your local timezone:
- **London Session (07:00-09:00 UTC)**: Tracks intraday liquidity zones for potential highs/lows.
- **New York Session (12:00-14:00 UTC)**: Highlights volatility during market overlaps with Europe.
- **Asia Session (23:00-01:00 UTC)**: Confirms trend continuation and retracement opportunities.
- **New York Close Session (19:00-21:00 UTC)**: Focuses on reversals and breakout tests during global transitions.
The script dynamically updates session highs and lows with clear labels and dashed horizontal lines for better visualization. **Time ranges can be adjusted to suit your trading preferences.** This makes the indicator flexible and effective for liquidity hunting, trend trading, and breakout strategies.
1 Percent Range TrackerThis indicator is a simple yet effective tool designed to calculate and display ±1% levels relative to the current market price. These levels are dynamically updated in real time, providing clear horizontal lines on the chart to visualize the 1% range above and below the current price.
The indicator also displays the precise numerical values of these levels on the right-hand price axis, making it easy to monitor critical thresholds at a glance.
Ultra Smart TrailIntroduction
The Ultra Smart Trail indicator is a comprehensive tool for traders seeking to identify and follow market trends efficiently. Combining dynamic trend detection with adaptive price bands, this indicator simplifies the process of understanding market direction and strength. It provides clear visual cues and customizable settings, catering to both novice and experienced traders.
Detailed Description
The Ultra Smart Trail indicator works by calculating a Trend Flow Line (TFL) using a hybrid moving average technique. This TFL dynamically adjusts to market conditions, smoothing out price fluctuations while remaining responsive to significant market shifts.
.........
Trend Flow Line (TFL)
A color-coded line indicating bullish, bearish, or neutral trends based on price movement relative to the TFL.
The TFL uses a combination of weighted moving averages (WMA) and double-weighted moving averages (DWMA) for accuracy.
.....
Dynamic Price Bands
The indicator plots upper and lower bands around the TFL, based on customizable multipliers of standard deviation. These bands adapt dynamically to volatility, helping traders spot overbought or oversold conditions.
The script calculates standard deviation-based bands with customizable multipliers, enabling precise adjustment to trading styles or instruments.
.....
Uptrend/Downtrend Highlights
The background and price bands visually differentiate trending and ranging markets, making it easier to identify high-probability trade setups.
.....
Reversal Alerts
By analyzing the relationship between price and bands, the script highlights potential reversals or continuation zones with distinct levels and fills.
.........
This indicator is a powerful addition to any trader’s toolkit, simplifying market analysis and enhancing decision-making.
Volatility vs ATRVolatility vs ATR Indicator Description for TradingView
Volatility vs ATR is a powerful custom indicator designed to help traders analyze and compare market volatility with the Average True Range (ATR). This indicator provides valuable insights into the dynamic behavior of asset prices, enabling traders to make informed decisions about market trends, potential reversals, and risk management.
What Does It Measure?
Volatility: Represents the degree of price variation over a given period. Calculated using standard deviation or other measures, it highlights periods of heightened or reduced market activity.
Average True Range (ATR): Measures the average range of price movement over a specific period, providing a sense of the asset's price fluctuations and market activity.
How It Works
The indicator plots both Volatility and ATR on the same chart, making it easy to visualize how these metrics interact.
Rising Volatility often signals increased market uncertainty or the beginning of strong trends.
ATR Spikes typically accompany high volatility, helping identify potential breakout or breakdown scenarios.
By tracking the interplay between these metrics, traders can anticipate shifts in momentum, recognize consolidation phases, and plan trades more effectively.
Key Features
Dual-Line Display: Clearly plots both Volatility (red) and ATR (blue) for easy comparison.
Customizable Periods: Allows you to adjust the lookback period for both metrics to match your trading style.
Versatile Application: Works across all asset classes, including stocks, forex, crypto, and commodities.
Why Use Volatility vs ATR?
Trend Analysis: Identify trending vs. ranging markets by observing the relationship between Volatility and ATR.
Breakout Confirmation: Use Volatility and ATR spikes as confirmation signals for potential breakouts.
Risk Management: Plan stop-loss levels and position sizing based on ATR values.
How to Use It
Add the indicator to your chart.
Look for periods where Volatility diverges from ATR to spot potential market shifts.
Use the indicator in conjunction with price action and other technical tools for a comprehensive analysis.
This indicator is ideal for traders looking to enhance their strategies by understanding market dynamics through the lens of volatility and average price movement.
Let me know if you’d like further refinement!
Total Volume for Custom PeriodIndicator Description: Total Volume for Custom Period
This indicator calculates the total trading volume for a specified time period and displays the result in the top-right corner of the chart. It is designed for traders and analysts who want to see the cumulative volume over a defined range of time without needing to calculate it manually.
Features:
Customizable Time Period:
Define the start and end times of the calculation using the easy-to-use settings panel.
The indicator dynamically updates as you adjust the dates.
Accurate Volume Calculation:
Calculates the total trading volume for all candlesticks between the selected start and end dates.
Works on all assets and timeframes supported by TradingView (stocks, crypto, forex, etc.).
Fixed Display:
The result is displayed in the top-right corner of the chart inside a clear and simple table.
The value remains visible regardless of chart movement or zoom level.
Real-time Updates:
Automatically recalculates the volume when new data is added or the selected time period changes.
Customizable Design:
Black text with a transparent background ensures the display is clear and non-intrusive.
Large text size for easy readability.
Use Cases:
Volume Analysis: Quickly assess the total trading activity over a specific time period.
Historical Data Analysis: Compare volume data across different time intervals.
Custom Strategies: Use the total volume metric as part of a broader trading strategy or analysis.
How It Works:
Open the settings panel of the indicator and input the desired Start Date and End Date.
The indicator calculates the total trading volume for all candles within the selected range.
The result is displayed in the top-right corner of the chart.
This indicator is a simple yet powerful tool for traders who rely on volume analysis to make informed decisions. It enhances your ability to study market behavior during specific periods and provides insights into trading activity with ease.
Bullish and Bearish Harami DetectorHere’s a description of the script I built for you, designed for a **TradingView public indicator**:
### **Custom Bullish and Bearish Harami Detector with Timeframe Selection**
This custom Pine Script detects **Bullish Harami** and **Bearish Harami** candlestick patterns on the selected timeframe, with configurable settings for how many prior candles to consider for pattern detection.
---
### **Features:**
1. **Timeframe Selection:**
- **Input Field for Timeframe**: The script allows users to choose the timeframe for detecting patterns. For instance, you can set it to 1 hour, 4 hours, or even daily candles, ensuring the detection works as per your chosen market view.
- This is controlled by the `input.timeframe` function, and the user is prompted to select the desired timeframe (e.g., "1h", "4h", "1d").
2. **Enable/Disable Pattern Detection:**
- The user has the flexibility to enable or disable the detection of **Bullish Harami** and **Bearish Harami** patterns.
- The two toggles `detectBullishHarami` and `detectBearishHarami` allow users to turn on/off the detection for each pattern type.
3. **Customizable Bearish Candle Count for Bullish Harami:**
- The user can define how many prior **bearish candles** should be present before a **Bullish Harami** can be detected.
- The input variable `bearishCandleCountBullish` lets you choose how many previous bearish candles to consider for detecting a **Bullish Harami** (for example, the last 3, 5, or 6 bearish candles).
4. **Customizable Bullish Candle Count for Bearish Harami:**
- Similar to the Bullish Harami, the script allows the user to define how many prior **bullish candles** should be present before a **Bearish Harami** pattern is detected.
- The input variable `bearishCandleCountBearish` lets you select how many previous bullish candles to check for **Bearish Harami**.
5. **Pattern Detection Logic:**
- **Bullish Harami**: Detected when a bearish candle (open > close) is followed by a smaller bullish candle (open < close) where the entire body of the second candle is contained within the body of the first candle.
- **Bearish Harami**: Detected when a bullish candle (open < close) is followed by a smaller bearish candle (open > close) where the entire body of the second candle is contained within the body of the first candle.
- Both patterns are subject to the user-defined conditions (number of previous bearish or bullish candles).
6. **Visual Indicators:**
- **Bullish Harami**: A green label is plotted **below the bar** to indicate a **Bullish Harami** pattern.
- **Bearish Harami**: A red label is plotted **above the bar** to indicate a **Bearish Harami** pattern.
- The labels are displayed using the `plotshape` function with custom colors and text.
7. **Additional Settings**:
- The script includes tooltips and descriptions for each input to make the settings clear for users, allowing even those unfamiliar with candlestick patterns to understand and use the indicator effectively.
---
### **How It Works:**
- The script first checks the specified timeframe and identifies the current and previous candlesticks.
- It then applies the user-defined conditions for detecting the **Bullish Harami** and **Bearish Harami** patterns by checking the relative positions and sizes of the candlesticks over the selected number of previous candles.
- Once a pattern is detected, it plots a label on the chart (green for **Bullish Harami** and red for **Bearish Harami**) at the appropriate location (below or above the candle).
- The script updates dynamically as the price action unfolds.
---
### **Use Cases:**
- **Traders**: This script is useful for traders who want to identify reversal patterns like **Bullish Harami** and **Bearish Harami** on their chosen timeframes and adjust the sensitivity by changing the number of prior candles for pattern detection.
- **Customization**: Users can fine-tune the script’s settings based on their specific trading strategy, adjusting both the timeframe and the number of candles for pattern detection.
---
### **Conclusion:**
This indicator is an effective tool for detecting candlestick patterns, specifically **Bullish Harami** and **Bearish Harami**, on **TradingView**. By allowing customization in terms of timeframe and the number of prior candles to consider, users can tailor the script to fit their trading strategy and market conditions.
Breakaway Fair Value Gaps [LuxAlgo]The Breakaway Fair Value Gap (FVG) is a typical FVG located at a point where the price is breaking new Highs or Lows.
🔶 USAGE
In the screenshot above, the price range is visualized by Donchian Channels.
In theory, the Breakaway FVGs should generally be a good indication of market participation, showing favor in the FVG's breaking direction. This is a combination of buyers or sellers pushing markets quickly while already at the highest high or lowest low in recent history.
While this described reasoning seems conventional, looking into it inversely seems to reveal a more effective use of these formations.
When the price is pushed to the extremities of the current range, the price is already potentially off balance and over-extended. Then an FVG is created, extending the price further out of balance.
With this in consideration, After identifying a Breakaway FVG, we could logically look for a reversion to re-balance the gap.
However, it would be illogical to believe that the FVG will immediately mitigate after formation. Because of this, the dashboard display for this indicator shows the analysis for the mitigation likelihood and timeliness.
In the example above, the information in the dashboard would read as follows (Bearish example):
Out of 949 Bearish Breakaway FVGs, 80.19% are shown to be mitigated within 60 bars, with the average mitigation time being 13 bars.
The other 19.81% are not mitigated within 60 bars. This could mean the FVG was mitigated after 60 bars, or it was never mitigated.
The unmitigated FVGs within the analysis window will extend their mitigation level to the current bar. We can see the number of bars since the formation is represented to the right of the live mitigation level.
Utilizing the current distance readout helps to better judge the likelihood of a level being mitigated.
Additionally, when considering these mitigation levels as targets, an additional indicator or analysis can be used to identify specific entries, which would further aid in a system's reliability.
🔶 SETTINGS
Trend Length: Sets the (DC) Trend length to use for Identifying Breakaway FVGs.
Show Mitigation Levels: Optionally hide mitigation levels if you would prefer only to see the Breakaway FVGs.
Maximum Duration: Sets the analysis duration for FVGs, Past this length in bars, the FVG is counted as "Un-Mitigated".
Show Dashboard: Optionally hide the dashboard.
Use Median Duration: Display the Median of the Bar Length data set rather than the Average.
Triangular Moving AverageTriangular Moving Average (TMA)
The Triangular Moving Average (TMA) indicator is a versatile tool designed for traders seeking a smoother trend-following experience. By applying a double-smoothing technique, the TMA reduces market noise and highlights significant price trends, making it an ideal choice for identifying direction and potential reversals.
Key Features:
Customizable Period: Adjust the period length to suit your trading strategy.
Selectable Price Type: Choose from Close, Open, High, Low, Median, Typical, or Weighted prices.
Multi-Timeframe Capability: Analyze trends across different timeframes for confluence.
This indicator also dynamically changes color to reflect trend direction, helping traders visualize momentum shifts more effectively:
Green: Bullish trend (upward movement).
Red: Bearish trend (downward movement).
Gray: Neutral or flat movement.
Disclaimer
This indicator is a technical analysis tool and should not be considered financial advice. Trading involves substantial risk, and past performance is not indicative of future results. Always do your own research and consult with a licensed financial advisor before making trading decisions. The author is not responsible for any losses incurred through the use of this indicator.
10% Drop from Current High - Akshay10% Drop from Current High TradingView Indicator
Description:
The "10% Drop from Current High" indicator dynamically tracks the highest price within a user-defined period and highlights when the current price drops by a specified percentage. This tool is invaluable for traders looking to monitor significant pullbacks or corrections from recent highs.
Key Features:
Customizable Drop Percentage:
Allows users to set the percentage drop to track, with a default value of 10%.
Configurable via an input field to suit different trading strategies and market conditions.
Lookback Period:
Tracks the highest price over a user-defined lookback period (default is 20 bars).
This ensures the indicator adapts to short-term or long-term market conditions based on user preferences.
Dynamic Levels:
Current High Level: Plots the highest price within the lookback period in blue.
Drop Level: Plots the calculated drop level (e.g., 10% below the current high) in red.
Visual Alerts:
Background Highlighting:
A translucent red background appears when the current price is at or below the drop level, signaling a significant pullback.
Shape Marker:
A downward label is plotted below the bar when the price touches or falls below the drop level, providing cSet Alerts:lear visual feedback.
Overlay on Price Chart:
The indicator is plotted directly on the price chart (overlay=true), ensuring seamless integration with other technical analysis tools.
Use Case:
This indicator is designed for traders who want to:
Monitor Pullbacks:
Identify when the price of an asset experiences a defined percentage drop from its recent high, signaling potential reversal zones or buying opportunities.
Use visual cues to react quickly to price movements.
Analyze Trends:
Combine with other indicators to assess the strength of trends and corrections.
Customization Options:
Drop Percentage: Adjust the percentage drop to track based on asset volatility and trading strategy.
Lookback Period: Modify the lookback period to focus on short-term (e.g., 5 bars) or long-term (e.g., 50 bars) price highs.
This indicator provides a flexible and intuitive way to track price pullbacks, helping traders make informed decisions and stay ahead in dynamic market conditions.
Fancy Oscillator Screener [Daveatt]⬛ OVERVIEW
Building upon LeviathanCapital original RSI Screener (), this enhanced version brings comprehensive technical analysis capabilities to your trading workflow. Through an intuitive grid display, you can monitor multiple trading instruments simultaneously while leveraging powerful indicators to identify market opportunities in real-time.
⬛ FEATURES
This script provides a sophisticated visualization system that supports both cross rates and heat map displays, allowing you to track exchange rates and percentage changes with ease. You can organize up to 40 trading pairs into seven customizable groups, making it simple to focus on specific market segments or trading strategies.
If you overlay on any circle/asset on the chart, you'll see the accurate oscillator value displayed for that asset
⬛ TECHNICAL INDICATORS
The screener supports the following oscillators:
• RSI - the oscillator from the original script version
• Awesome Oscillator
• Chaikin Oscillator
• Stochastic RSI
• Stochastic
• Volume Oscillator
• CCI
• Williams %R
• MFI
• ROC
• ATR Multiple
• ADX
• Fisher Transform
• Historical Volatility
• External : connect your own custom oscillator
⬛ DYNAMIC SCALING
One of the key improvements in this version is the implementation of dynamic chart scaling. Unlike the original script which was optimized for RSI's 0-100 range, this version automatically adjusts its scale based on the selected oscillator.
This adaptation was necessary because different indicators operate on vastly different numerical ranges - for instance, CCI typically ranges from -200 to +200, while Williams %R operates from -100 to 0.
The dynamic scaling ensures that each oscillator's data is properly displayed within its natural range, making the visualization both accurate and meaningful regardless of which indicator you choose to use.
⬛ ALERTS
I've integrated a comprehensive alert system that monitors both overbought and oversold conditions.
Users can now set custom threshold levels for their alerts.
When any asset in your monitored group crosses these thresholds, the system generates an alert, helping you catch potential trading opportunities without constant manual monitoring.
em will help you stay informed of market movements and potential trading opportunities.
I hope you'll find this tool valuable in your trading journey
All the BEST,
Daveatt
Fourier Extrapolation of PriceThis advanced algorithm leverages Fourier analysis to predict price trends by decomposing historical price data into its frequency components. Unlike traditional algorithms that often operate in lower-dimensional spaces, this method harnesses a multidimensional approach to capture intricate market behaviors. By utilizing additional dimensions, the algorithm identifies and extrapolates subtle patterns and oscillations that are typically overlooked, providing a more robust and nuanced forecast.
Ideal for traders seeking a deeper understanding of market dynamics, this tool offers an enhanced predictive capability by aligning its calculations with the complexity of real-world financial systems.
Session High/Low Average & Range [1CG]The Session High/Low Average & Range indicator independently measures the average price movement from the opening price in each direction. It also displays the maximum high and low distance, called Range. Separating the averages and range into highs and lows helps analyze the volatility of the market as well as the direction.
USE EXAMPLES
Session Open
Session Close
Customization
Minimal - 1x and 2x Averages are replaced with custom lines, in order to show distance to3x.
Calculations
Average High: (high price of session - session opening price) / (session period)
Average Low: (session opening price - low price of session) / (session period)
Range High: The highest price of the last (session period)
Range Low: The lowest price of the last (session period)
INPUTS
Session
Here you can choose the hours for your session and time zone. The default is London session in New York time. Next, the session period determines how many sessions to sample from for the average and range lines, the default is 20. Lastly, you can choose the number of sessions to appear on the chart not including the current session if you are in one, 5 by default.
Lines
All of the lines allow you to change the color, width, and style. They also have a label option to choose to display the price. The bottom of the section allows you to change the location and size of the label text.
**Open Line** -Displays the opening price for the length of the session.
**Average Lines** - Displays the 1x, 2x, and 3x the average distance from open in each direction. Additionally, you can toggle a background color to highlight the area.
**Custom Lines** - Displays a customizable multiple of either the average or range. By default the first custom line displays the Range at a 1x multiplier and the second line displays an Average at a 1.5x multiplier
Display Distance
Here you can choose to display the distance from the lines to the open. This data is marked with a “Δ”. For the three Average lines this will display in the area between the line and the open in the position and size of your choice. The custom lines will have the distance information displayed on the line itself. This helps keep the data organized.
EMAs MTF (Miu)This indicator plots multiple EMA (Exponential Moving Average) on chart.
You can set up to 3 different EMA for the current timeframe and you can add up to 3 more different EMA with a different timeframe. So you can have up to 6 EMAs on your chart.
This way you can easily see multiple EMA lines with a single indicator to setup.
Indicator will automaticaly plot labels with symbol's price, timeframe and which EMA is set for easy identification.
You can also set an alert that will trigger anytime current price crosses any active EMA.
Alerts will provide detailed information such as:
1) Symbol
2) Which EMA and timeframe that has been crossed
3) Current symbol price
Feel free to give feedbacks on comments section below. Suggestions are welcome.
Enjoy!
Trend Stability Index (TSI)Overview
The Trend Stability Index (TSI) is a technical analysis tool designed to evaluate the stability of a market trend by analyzing both price movements and trading volume. By combining these two crucial elements, the TSI provides traders with insights into the strength and reliability of ongoing trends, assisting in making informed trading decisions.
Key Features
• Dual Analysis: Integrates price changes and volume fluctuations to assess trend stability.
• Customizable Periods: Allows users to set evaluation periods for both trend and volume based on their trading preferences.
• Visual Indicators: Displays the Trend Stability Index as a line chart, highlights neutral zones, and uses background colors to indicate trend stability or instability.
Configuration Settings
1. Trend Length (trendLength)
• Description: Determines the number of periods over which the price stability is evaluated.
• Default Value: 15
• Usage: A longer trend length smooths out short-term volatility, providing a clearer picture of the overarching trend.
2. Volume Length (volumeLength)
• Description: Sets the number of periods over which trading volume changes are assessed.
• Default Value: 15
• Usage: Adjusting the volume length helps in capturing significant volume movements that may influence trend strength.
Calculation Methodology
The Trend Stability Index is calculated through a series of steps that analyze both price and volume changes:
1. Price Change Rate (priceChange)
• Calculation: Utilizes the Rate of Change (ROC) function on the closing prices over the specified trendLength.
• Purpose: Measures the percentage change in price over the trend evaluation period, indicating the direction and momentum of the price movement.
2. Volume Change Rate (volumeChange)
• Calculation: Applies the Rate of Change (ROC) function to the trading volume over the specified volumeLength.
• Purpose: Assesses the percentage change in trading volume, providing insight into the conviction behind price movements.
3. Trend Stability (trendStability)
• Calculation: Multiplies priceChange by volumeChange.
• Purpose: Combines price and volume changes to gauge the overall stability of the trend. A higher positive value suggests a strong and stable trend, while negative values may indicate trend weakness or reversal.
4. Trend Stability Index (TSI)
• Calculation: Applies a Simple Moving Average (SMA) to the trendStability over the trendLength period.
• Purpose: Smooths the trend stability data to create a more consistent and interpretable index.
Trend/Ranging Determination
• Stable Trend (isStable)
• Condition: When the TSI value is greater than 0.
• Interpretation: Indicates that the current trend is stable and likely to continue in its direction.
• Unstable Trend / Range-bound Market
• Condition: When the TSI value is less than or equal to 0.
• Interpretation: Suggests that the trend may be weakening, reversing, or that the market is moving sideways without a clear direction.
Visualization
The TSI indicator employs several visual elements to convey information effectively:
1. TSI Line
• Representation: Plotted as a blue line.
• Purpose: Displays the Trend Stability Index values over time, allowing traders to observe trend stability dynamics.
2. Neutral Horizontal Line
• Representation: A gray horizontal line at the 0 level.
• Purpose: Serves as a reference point to distinguish between stable and unstable trends.
3. Background Color
• Stable Trend: Green background with 80% transparency when isStable is true.
• Unstable Trend: Red background with 80% transparency when isStable is false.
• Purpose: Provides an immediate visual cue about the current trend’s stability, enhancing the interpretability of the indicator.
Usage Guidelines
• Identifying Trend Strength: Utilize the TSI to confirm the strength of existing trends. A consistently positive TSI suggests strong trend momentum, while a negative TSI may signal caution or a potential reversal.
• Volume Confirmation: The integration of volume changes helps in validating price movements. Significant price changes accompanied by corresponding volume shifts can reinforce the reliability of the trend.
• Entry and Exit Signals: Traders can use crossovers of the TSI with the neutral line (0 level) as potential entry or exit points. For instance, a crossover from below to above 0 may indicate a bullish trend initiation, while a crossover from above to below 0 could suggest bearish momentum.
• Combining with Other Indicators: To enhance trading strategies, consider using the TSI in conjunction with other technical indicators such as Moving Averages, RSI, or MACD for comprehensive market analysis.
Example Scenario
Imagine analyzing a stock with the following observations using the TSI:
• The TSI has been consistently above 0 for the past 30 periods, accompanied by increasing trading volume. This scenario indicates a strong and stable uptrend, suggesting that buying opportunities may be favorable.
• Conversely, if the TSI drops below 0 while the price remains relatively flat and volume decreases, it may imply that the current trend is losing momentum, and the market could be entering a consolidation phase or preparing for a trend reversal.
Conclusion
The Trend Stability Index is a valuable tool for traders seeking to assess the reliability and strength of market trends by integrating price and volume dynamics. Its customizable settings and clear visual indicators make it adaptable to various trading styles and market conditions. By incorporating the TSI into your trading analysis, you can enhance your ability to identify and act upon stable and profitable trends.
MktCumTickThis script is a market sentiment indicator that calculates the cumulative TICK (Trade Imbalance Sentiment) for four major markets: NYSE (New York Stock Exchange), NASDAQ (National Association of Securities Dealers Automated Quotations), Dow Jones, and AMEX (American Stock Exchange).
Here's a breakdown of the script:
1. Market data requests: The script requests data for the four markets, including:
- TICK (Trade Imbalance Sentiment) data
- HLC3 (High, Low, Close) data
- ADVN (Advancing issues), DECL (Declining issues), and UNCH (Unchanged issues) data
2. Cumulative TICK calculation: The script calculates the cumulative TICK for each market by dividing the TICK data by the maximum TICK value for each market.
3. Plotting: The script plots the cumulative TICK values for each market as separate lines on the chart.
4. Background color: The script changes the background color of the chart based on the cumulative TICK values. If all four markets have decreasing cumulative TICK values, the background color turns red. If all four markets have increasing cumulative TICK values, the background color turns green.
The purpose of this indicator is to provide a visual representation of market sentiment across multiple markets. By analyzing the cumulative TICK values, traders can gain insights into market trends and make more informed trading decisions.
Some possible uses of this indicator include:
- Identifying market trends and sentiment
- Confirming trade entries and exits
- Monitoring market conditions and adjusting trading strategies accordingly
Top-Down Trend and Key Levels with Swing Points//by antaryaami0
Overview
The “Top-Down Trend and Key Levels with Swing Points” indicator is a comprehensive tool designed to enhance your technical analysis by integrating multiple trading concepts into a single, easy-to-use script. It combines higher timeframe trend analysis, key price levels, swing point detection, and ranging market identification to provide a holistic view of market conditions. This indicator is particularly useful for traders who employ multi-timeframe analysis, support and resistance levels, and price action strategies.
Key Features
1. Higher Timeframe Trend Background Shading:
• Purpose: Identifies the prevailing trend on a higher timeframe to align lower timeframe trading decisions with the broader market direction.
• How it Works: The indicator compares the current higher timeframe close with the previous one to determine if the trend is up, down, or ranging.
• Customization:
• Trend Timeframe: Set your preferred higher timeframe (e.g., Daily, Weekly).
• Up Trend Color & Down Trend Color: Customize the background colors for uptrends and downtrends.
• Ranging Market Color: A separate color to indicate when the market is moving sideways.
2. Key Price Levels:
• Previous Day High (PDH) and Low (PDL):
• Purpose: Identifies key support and resistance levels from the previous trading day.
• Visualization: Plots horizontal lines at PDH and PDL with labels.
• Customization: Option to show or hide these levels and customize their colors.
• Pre-Market High (PMH) and Low (PML):
• Purpose: Highlights the price range during the pre-market session, which can indicate potential breakout levels.
• Visualization: Plots horizontal lines at PMH and PML with labels.
• Customization: Option to show or hide these levels and customize their colors.
3. First 5-Minute Marker (F5H/F5L):
• Purpose: Marks the high or low of the first 5 minutes after the market opens, which is significant for intraday momentum.
• How it Works:
• If the first 5-minute high is above the Pre-Market High (PMH), an “F5H” label is placed at the first 5-minute high.
• If the first 5-minute high is below the PMH, an “F5L” label is placed at the first 5-minute low.
• Visualization: Labels are placed at the 9:35 AM candle (closing of the first 5 minutes), colored in purple by default.
• Customization: Option to show or hide the marker and adjust the marker color.
4. Swing Points Detection:
• Purpose: Identifies significant pivot points in price action to help recognize trends and reversals.
• How it Works: Uses left and right bars to detect pivot highs and lows, then determines if they are Higher Highs (HH), Lower Highs (LH), Higher Lows (HL), or Lower Lows (LL).
• Visualization: Plots small markers (circles) with labels (HH, LH, HL, LL) at the corresponding swing points.
• Customization: Adjust the number of left and right bars for pivot detection and the size of the markers.
5. Ranging Market Detection:
• Purpose: Identifies periods when the market is consolidating (moving sideways) within a defined price range.
• How it Works: Calculates the highest high and lowest low over a specified period and determines if the price range is within a set percentage threshold.
• Visualization: Draws a gray box around the price action during the ranging period and labels the high and low prices at the end of the range.
• Customization: Adjust the range detection period and threshold, as well as the box color.
6. Trend Coloring on Chart:
• Purpose: Provides a visual cue for the short-term trend based on a moving average.
• How it Works: Colors the candles green if the price is above the moving average and red if below.
• Customization: Set the moving average length and customize the uptrend and downtrend colors.
How to Use the Indicator
1. Adding the Indicator to Your Chart:
• Copy the Pine Script code provided and paste it into the Pine Script Editor on TradingView.
• Click “Add to Chart” to apply the indicator.
2. Configuring Inputs and Settings:
• Access Inputs:
• Click on the gear icon next to the indicator’s name on your chart to open the settings.
• Customize Key Levels:
• Show Pre-Market High/Low: Toggle on/off.
• Show Previous Day High/Low: Toggle on/off.
• Show First 5-Minute Marker: Toggle on/off.
• Set Trend Parameters:
• Trend Timeframe for Background: Choose the higher timeframe for trend analysis.
• Moving Average Length for Bar Color: Set the period for the moving average used in bar coloring.
• Adjust Ranging Market Detection:
• Range Detection Period: Specify the number of bars to consider for range detection.
• Range Threshold (%): Set the maximum percentage range for the market to be considered ranging.
• Customize Visuals:
• Colors: Adjust colors for trends, levels, markers, and ranging market boxes.
• Label Font Size: Choose the size of labels displayed on the chart.
• Level Line Width: Set the thickness of the lines for key levels.
3. Interpreting the Indicator:
• Background Shading:
• Green Shade: Higher timeframe is in an uptrend.
• Red Shade: Higher timeframe is in a downtrend.
• Gray Box: Market is ranging (sideways movement).
• Key Levels and Markers:
• PDH and PDL Lines: Represent resistance and support from the previous day.
• PMH and PML Lines: Indicate potential breakout levels based on pre-market activity.
• F5H/F5L Labels: Early indication of intraday momentum after market open.
• Swing Point Markers:
• HH (Higher High): Suggests bullish momentum.
• LH (Lower High): May indicate a potential bearish reversal.
• HL (Higher Low): Supports bullish continuation.
• LL (Lower Low): Indicates bearish momentum.
• Ranging Market Box:
• Gray Box Around Price Action: Highlights consolidation periods where breakouts may occur.
• Range High and Low Labels: Provide the upper and lower bounds of the consolidation zone.
4. Applying the Indicator to Your Trading Strategy:
• Trend Alignment:
• Use the higher timeframe trend shading to align your trades with the broader market direction.
• Key Levels Trading:
• Watch for price reactions at PDH, PDL, PMH, and PML for potential entry and exit points.
• Swing Points Analysis:
• Identify trend continuations or reversals by observing the sequence of HH, HL, LH, and LL.
• Ranging Market Strategies:
• During ranging periods, consider range-bound trading strategies or prepare for breakout trades when the price exits the range.
• Intraday Momentum:
• Use the F5H/F5L marker to gauge early market sentiment and potential intraday trends.
Practical Tips
• Adjust Settings to Your Trading Style:
• Tailor the indicator’s inputs to match your preferred timeframes and trading instruments.
• Combine with Other Indicators:
• Use in conjunction with volume indicators, oscillators, or other technical tools for additional confirmation.
• Backtesting:
• Apply the indicator to historical data to observe how it performs and refine your settings accordingly.
• Stay Updated on Market Conditions:
• Be aware of news events or economic releases that may impact market behavior and the effectiveness of technical levels.
Customization Options
• Time Zone Adjustment:
• The script uses “America/New_York” time zone by default. Adjust the timezone variable in the script if your chart operates in a different time zone.
var timezone = "Your/Timezone"
• Session Times:
• Modify the Regular Trading Session and Pre-Market Session times in the indicator settings to align with the trading hours of different markets or exchanges.
• Visual Preferences:
• Colors: Personalize the indicator’s colors to suit your visual preferences or to enhance visibility.
• Label Sizes: Adjust label sizes if you find them too intrusive or not prominent enough.
• Marker Sizes: Further reduce or enlarge the swing point markers by modifying the swing_marker_size variable.
Understanding the Indicator’s Logic
1. Higher Timeframe Trend Analysis:
• The indicator retrieves the closing prices of a higher timeframe using the request.security() function.
• It compares the current higher timeframe close with the previous one to determine the trend direction.
2. Key Level Calculation:
• Previous Day High/Low: Calculated by tracking the highest and lowest prices of the previous trading day.
• Pre-Market High/Low: Calculated by monitoring price action during the pre-market session.
3. First 5-Minute Marker Logic:
• At 9:35 AM (end of the first 5 minutes after market open), the indicator evaluates whether the first 5-minute high is above or below the PMH.
• It then places the appropriate label (F5H or F5L) on the chart.
4. Swing Points Detection:
• The script uses ta.pivothigh() and ta.pivotlow() functions to detect pivot points.
• It then determines the type of swing point based on comparisons with previous swings.
5. Ranging Market Detection:
• The indicator looks back over a specified number of bars to find the highest high and lowest low.
• It calculates the percentage difference between these two points.
• If the difference is below the set threshold, the market is considered to be ranging, and a box is drawn around the price action.
Limitations and Considerations
• Indicator Limitations:
• Maximum Boxes and Labels: Due to Pine Script limitations, there is a maximum number of boxes and labels that can be displayed simultaneously.
• Performance Impact: Adding multiple visual elements (boxes, labels, markers) can affect the performance of the script on lower-end devices or with large amounts of data.
• Market Conditions:
• False Signals: Like any technical tool, the indicator may produce false signals, especially during volatile or erratic market conditions.
• Not a Standalone Solution: This indicator should be used as part of a comprehensive trading strategy, including risk management and other forms of analysis.
Conclusion
The “Top-Down Trend and Key Levels with Swing Points” indicator is a versatile tool that integrates essential aspects of technical analysis into one script. By providing insights into higher timeframe trends, highlighting key price levels, detecting swing points, and identifying ranging markets, it equips traders with valuable information to make more informed trading decisions. Whether you are a day trader looking for intraday opportunities or a swing trader aiming to align with the broader trend, this indicator can enhance your chart analysis and trading strategy.
Disclaimer
Trading involves significant risk, and it’s important to understand that past performance is not indicative of future results. This indicator is a tool to assist in analysis and should not be solely relied upon for making trading decisions. Always conduct thorough research and consider seeking advice from financial professionals before engaging in trading activities.
Daily High/Low Levels with mitigationThis Pine Script script defines a TradingView indicator named "Daily High/Low Levels" designed to track and display the daily high and low levels of a trading session, with added functionality for marking levels as mitigated when certain conditions are met. Here's a breakdown of its functionality:
Key Features
Session Start Time: The script allows you to specify a custom session start time in 24-hour format. This ensures the levels align with your trading session preferences.
Daily Highs and Lows:
Tracks the high and low levels for each session.
Retains the highs and lows for a configurable number of previous days.
Visualization:
Creates horizontal lines for each session's high and low levels.
Supports customization of line colors and styles.
Mitigation Tracking:
Monitors whether a high or low level has been "mitigated" (touched or exceeded by subsequent price action).
Changes the line style and color to indicate mitigation.
Provides an alert when mitigation occurs.
Configurable Extensions:
Lines can be extended beyond mitigation or stopped at the bar index where mitigation occurs, depending on user preference.
Efficient Array Management:
Uses arrays to manage daily highs, lows, their respective indices, and lines.
Ensures the size of stored data does not exceed the configured limit (daysToTrack).
Alerts:
Sends alerts when high or low levels are mitigated, which can be used for trading decisions.
Inputs
Session Start Hour/Minute: Defines when a new session starts.
Days to Track: Sets the number of previous days to display high/low levels.
Colors: Allows customization of line colors for unmitigated and mitigated levels.
Extend Lines: Toggles whether lines should extend past the mitigation point.
Code Highlights
New Session Detection: The script detects the start of a new session based on the configured session start time and resets daily highs/lows.
Line Management: Horizontal rays are created for highs and lows, and mitigated lines are updated with a dashed style and faded color.
Mitigation Logic: The script checks whether current price action exceeds stored high or low levels and updates their status and appearance accordingly.
Memory Management: Ensures the size of the arrays (highs, lows, lines) does not exceed the configured daysToTrack, deleting the oldest elements as necessary.
This indicator is highly customizable and useful for traders who want to track and analyze daily support and resistance levels, incorporating mitigation as a dynamic feature.