Forex Hammer and Hanging Man StrategyThe strategy is based on two key candlestick chart patterns: Hammer and Hanging Man. These chart patterns are widely used in technical analysis to identify potential reversal points in the market. Their relevance in the Forex market, known for its high liquidity and volatile price movements, is particularly pronounced. Both patterns provide insights into market sentiment and trader psychology, which are critical in currency trading, where short-term volatility plays a significant role.
1. Hammer:
• Typically occurs after a downtrend.
• Signals a potential trend reversal to the upside.
• A Hammer has:
• A small body (close and open are close to each other).
• A long lower shadow, at least twice as long as the body.
• No or a very short upper shadow.
2. Hanging Man:
• Typically occurs after an uptrend.
• Signals a potential reversal to the downside.
• A Hanging Man has:
• A small body, similar to the Hammer.
• A long lower shadow, at least twice as long as the body.
• A small or no upper shadow.
These patterns are a manifestation of market psychology, specifically the tug-of-war between buyers and sellers. The Hammer reflects a situation where sellers tried to push the price down but were overpowered by buyers, while the Hanging Man shows that buyers failed to maintain the upward movement, and sellers could take control.
Relevance of Chart Patterns in Forex
In the Forex market, chart patterns are vital tools because they offer insights into price action and market sentiment. Since Forex trading often involves large volumes of trades, chart patterns like the Hammer and Hanging Man are important for recognizing potential shifts in market momentum. These patterns are a part of technical analysis, which aims to forecast future price movements based on historical data, relying on the psychology of market participants.
Scientific Literature on the Relevance of Candlestick Patterns
1. Behavioral Finance and Candlestick Patterns:
Research on behavioral finance supports the idea that candlestick patterns, such as the Hammer and Hanging Man, are relevant because they reflect shifts in trader psychology and sentiment. According to Lo, Mamaysky, and Wang (2000), patterns like these could be seen as representations of collective investor behavior, influenced by overreaction, optimism, or pessimism, and can often signal reversals in market trends.
2. Statistical Validation of Chart Patterns:
Studies by Brock, Lakonishok, and LeBaron (1992) explored the profitability of technical analysis strategies, including candlestick patterns, and found evidence that certain patterns, such as the Hammer, can have predictive value in financial markets. While their study primarily focused on stock markets, their findings are generally applicable to the Forex market as well.
3. Market Efficiency and Candlestick Patterns:
The efficient market hypothesis (EMH) posits that all available information is reflected in asset prices, but some studies suggest that markets may not always be perfectly efficient, allowing for profitable exploitation of certain chart patterns. For instance, Jegadeesh and Titman (1993) found that momentum strategies, which often rely on price patterns and trends, could generate significant returns, suggesting that patterns like the Hammer or Hanging Man may provide a slight edge, particularly in short-term Forex trading.
Testing the Strategy in Forex Using the Provided Script
The provided script allows traders to test and evaluate the Hammer and Hanging Man patterns in Forex trading by entering positions when these patterns appear and holding the position for a specified number of periods. This strategy can be tested to assess its performance across different currency pairs and timeframes.
1. Testing on Different Timeframes:
• The effectiveness of candlestick patterns can vary across different timeframes, as market dynamics change with the level of detail in each timeframe. Shorter timeframes may provide more frequent signals, but with higher noise, while longer timeframes may produce more reliable signals, but with fewer opportunities. This multi-timeframe analysis could be an area to explore to enhance the strategy’s robustness.
2. Exit Strategies:
• The script incorporates an exit strategy where positions are closed after holding them for a specified number of periods. This is useful for testing how long the reversal patterns typically take to play out and when the optimal exit occurs for maximum profitability. It can also help to adjust the exit logic based on real-time market behavior.
Conclusion
The Hammer and Hanging Man patterns are widely recognized in technical analysis as potential reversal signals, and their application in Forex trading is valuable due to the market’s high volatility and liquidity. This strategy leverages these candlestick patterns to enter and exit trades based on shifts in market sentiment and psychology. Testing and optimization, as offered by the script, can help refine the strategy and improve its effectiveness.
For further refinement, it could be valuable to consider combining candlestick patterns with other technical indicators or using multi-timeframe analysis to confirm patterns and increase the probability of successful trades.
References:
• Lo, A. W., Mamaysky, H., & Wang, J. (2000). Foundations of Technical Analysis: Computational Algorithms, Statistical Inference, and Empirical Implementation. The Journal of Finance, 55(4), 1705-1770.
• Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. The Journal of Finance, 47(5), 1731-1764.
• Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65-91.
This provides a theoretical basis for the use of candlestick patterns in trading, supported by academic literature and research on market psychology and efficiency.
Поиск скриптов по запросу "chart"
SAI SUBHASH BITRA (OD) OPEN DRIVEThis indicator identifies a specific opening price pattern based on a 5-minute chart. It analyzes the first candle of the new trading day relative to the previous day’s price levels and provides visual alerts for significant price movements.
20, 50, 200 MA Crossover### **Description of the 20, 50, 200 MA Crossover Script**
This script is a custom **Moving Average (MA) crossover indicator** designed for TradingView. It uses three moving averages: **20-day**, **50-day**, and **200-day**, and generates **Buy** and **Sell signals** based on specific crossover conditions.
#### **Features:**
1. **Moving Averages:**
- **20 MA (Short-Term):** Tracks short-term price trends (green line).
- **50 MA (Mid-Term):** Tracks medium-term trends (orange line).
- **200 MA (Long-Term):** Tracks long-term trends (blue line).
2. **Buy Signal:**
- Triggered when the **20 MA crosses above the 50 MA**, and the **50 MA is above the 200 MA**.
- Indicates a potential bullish trend.
3. **Sell Signal:**
- Triggered when the **20 MA crosses below the 50 MA**, and the **50 MA is below the 200 MA**.
- Indicates a potential bearish trend.
4. **Buy/Sell Labels:**
- Displays "Buy" and "Sell" labels directly on the chart at crossover points.
5. **Alerts:**
- Alerts can be enabled to notify you of Buy or Sell signals.
---
### **Use Cases:**
- Helps traders identify short-term and long-term trends.
- Useful for swing trading, day trading, or identifying key market movements.
- Provides visual and actionable signals directly on the chart.
This script is ideal for traders who want to automate trend detection using the popular 20, 50, and 200 moving averages. 🚀
HTF CandlesHTF Candles, Plot of a Higher/Lower Timeframe Candles on any chart.
This HTF / LTF candle plot displays the previous 3 daily candles with the current update of the price with reference to a lower time frame.
Candles includes 3 Candles of HTF
last HTF candle includes 4 previous candles from LTF
Candle High Low Open Close are plotted.
these OHLC values act as Support and Resistance With reference to current Price.
very useful in making HTF and LTF analysis with reference to current timeframe.
3 Moving AverageThe 3 Moving Averages Indicator (SMA) script, provided by Money Ocean, is a dynamic tool designed for Trading View charts. It features three Simple Moving Averages (SMAs) with predefined periods: SMA-9, SMA-33, and SMA-66, all based on closing prices. This configuration delivers a clear visualization of short-term, medium-term, and long-term market trends. By analyzing the crossovers and alignment of these SMAs, traders can identify trend reversals, confirm market direction, and optimize entry and exit points. Tailored for traders seeking precision and clarity, this indicator is ideal for improving decision-making in trending markets.
The 3 Moving Averages Indicator (SMA) script on Trading View uses three Simple Moving Averages (SMAs) with preset periods of 9, 33, and 66, all calculated using the closing prices. This setup offers a balanced view of short-term, medium-term, and long-term market trends. The SMA-9 captures recent price action, SMA-33 provides an intermediate perspective, and SMA-66 smooths out long-term trends. By analyzing the alignment and crossovers of these SMAs, traders can identify potential trend reversals, confirm market direction, and spot trading opportunities with greater precision. It's an effective tool for trend-followers and swing traders.
Gold Analysis and Scalping TradesIn this section, we opened three trades by analyzing waves and structures on the chart.
Gold could repeat this type of movement tomorrow as well, so be prepared.
Eksiradwin k CCI with Zero SignalCCI with Zero Signal by Edwin K is a custom Commodity Channel Index (CCI) indicator designed for traders to analyze market trends and momentum more effectively. It combines the CCI calculation with a visually distinct histogram and color-coded candlestick bars for enhanced clarity and decision-making.
Key Features:
CCI Line:
Plots the CCI line based on the specified length (default: 21).
Helps identify overbought or oversold conditions, momentum shifts, and trend reversals.
Zero Signal Line:
A horizontal line at 0 serves as a reference point to distinguish between bullish and bearish momentum.
Histogram:
Displays a histogram that reflects the CCI's values.
Histogram bars change colors dynamically based on their relation to the zero line and the trend's direction.
Green/Lime: Positive momentum (above zero).
Red/Maroon: Negative momentum (below zero).
Candlestick Coloring:
Automatically paints candlesticks based on the histogram's color.
Provides an intuitive visual cue for momentum shifts directly on the price chart.
Use Cases:
Trend Confirmation: Use the histogram and candlestick colors to confirm the strength and direction of trends.
Momentum Shifts: Identify transitions between bullish and bearish momentum when the CCI crosses the zero line.
Entry and Exit Points: Combine this indicator with other tools to pinpoint optimal trade entries and exits.
This indicator offers a user-friendly yet powerful visualization of the CCI, making it an excellent tool for traders aiming to enhance their technical analysis.
Fibonacci RepulseFibonacci Repulse with Trend Table 📉📈
Description: The "Fibonacci Repulse" indicator for TradingView combines Fibonacci retracement levels with dynamic support/resistance detection, providing real-time price action insights. 🔄 This powerful tool plots critical Fibonacci retracement levels (23.6%, 38.2%, and 50%) based on the highest and lowest swing points over a user-defined lookback period. The indicator automatically detects bullish retests, alerting you when the price touches and closes above any of the Fibonacci levels, indicating potential upward momentum. 🚀
Key Features:
Fibonacci Retracement Levels 📊: Plots key levels (23.6%, 38.2%, 50%) dynamically based on the highest and lowest price swings over a customizable lookback period.
Bullish Retests Alerts ⚡: Identifies and marks bullish retests when the price touches the Fibonacci levels and closes above them, signaling potential upward movement.
Real-Time Trend Detection 🔍: Displays the current market trend as "Bullish," "Bearish," or "Sideways" in a clear, easy-to-read table in the bottom right corner of the chart. This is determined based on the price's position relative to the Fibonacci levels.
Customizable Settings ⚙️: Adjust the lookback period and label offsets for optimal visual customization.
How It Works:
The indicator calculates the Fibonacci retracement levels between the highest high and the lowest low within a user-defined period. 🧮
It draws extended lines at the 23.6%, 38.2%, and 50% retracement levels, updating them as the chart moves. 📉
When the price touches a Fibonacci level and closes above it, a "Bullish Retest" label appears, signaling a potential buy opportunity. 💡
A real-time trend status table updates automatically in the chart's bottom-right corner, helping traders quickly assess the market's trend direction: Bullish, Bearish, or Sideways. 🔄
Why Use It: This indicator is perfect for traders looking for a clear and visual way to incorporate Fibonacci levels into their trading strategies, with real-time feedback on trend direction and price action signals. Whether you are a novice or an experienced trader, "Fibonacci Repulse" provides a powerful tool for identifying potential reversal points and confirming trends, enhancing your trading strategy. 📈💪
Daytrading ES Wick Length StrategyThis Pine Script strategy calculates the combined length of upper and lower wicks of candlesticks and uses a customizable moving average (MA) to identify potential long entry points. The strategy compares the total wick length to the MA with an added offset. If the wick length exceeds the offset-adjusted MA, the strategy enters a long position. The position is automatically closed after a user-defined holding period.
Key Features:
1. Calculates the sum of upper and lower wicks for each candlestick.
2. Offers four types of moving averages (SMA, EMA, WMA, VWMA) for analysis.
3. Allows the user to set a customizable MA length and an offset to shift the MA.
4. Automatically exits positions after a specified number of bars.
5. Visualizes the wick length as a histogram and the offset-adjusted MA as a line.
References:
• Candlestick wick analysis: Nison, S. (1991). Japanese Candlestick Charting Techniques.
• Moving averages: Brock, W., Lakonishok, J., & LeBaron, B. (1992). “Simple Technical Trading Rules and the Stochastic Properties of Stock Returns”. Journal of Finance.
This strategy is suitable for identifying candlesticks with significant volatility and long wicks, which can indicate potential trend reversals or continuations.
Parabolic SAR This script provides an enhanced implementation of the Parabolic SAR (Stop and Reverse) indicator, a popular tool for identifying potential trend reversals in financial markets. The script incorporates additional features for improved usability and trading decision-making:
Key Features:
Customizable Parameters:
Initial Acceleration Factor: Start value for the SAR calculation.
Increment: Step value that increases the SAR during a trend.
Maximum Acceleration Factor: Cap for the SAR to prevent over-adjustment.
Buy & Sell Signals:
Buy Signal: Triggered when the price crosses above the SAR.
Sell Signal: Triggered when the price crosses below the SAR.
Signals are displayed as visually intuitive labels ("Buy" and "Sell") on the chart.
Alerts Integration:
Configurable alerts for buy and sell signals, allowing users to stay informed without actively monitoring the chart.
Dynamic Candle Coloring:
Candlesticks are dynamically colored based on the most recent signal:
Green: Buy signal (bullish trend).
Red: Sell signal (bearish trend).
Elegant SAR Plot:
The SAR is plotted as cross-style markers with a visually appealing magenta color.
How to Use:
Adjust the Initial Acceleration Factor, Increment, and Maximum Acceleration Factor in the input settings to match your trading style.
Enable alerts to receive notifications when buy or sell signals are generated.
Use the colored candlesticks as an additional confirmation tool to visualize market trends directly on the chart.
EMA + Stochastic Strategy (day trading)Setup Instructions
Exponential Moving Averages (EMA):
Use two EMAs:
50-period EMA for the overall trend.
20-period EMA for shorter-term movements.
Trend Confirmation:
If the 20 EMA is above the 50 EMA, focus on buy opportunities.
If the 20 EMA is below the 50 EMA, focus on sell opportunities.
Stochastic Oscillator:
Set Stochastic to a 14, 3, 3 period (default).
Overbought level = 80; Oversold level = 20.
Look for crossovers:
Buy: Stochastic %K crosses above %D in the oversold zone (below 20).
Sell: Stochastic %K crosses below %D in the overbought zone (above 80).
Entry and Exit Rules
Buy Signal:
The 20 EMA is above the 50 EMA, confirming an uptrend.
The Stochastic Oscillator is in the oversold zone (below 20), and %K crosses above %D.
Enter when the price retraces to and bounces off the 20 EMA in the direction of the trend.
Sell Signal:
The 20 EMA is below the 50 EMA, confirming a downtrend.
The Stochastic Oscillator is in the overbought zone (above 80), and %K crosses below %D.
Enter when the price retraces to and rejects off the 20 EMA in the direction of the trend.
Stop Loss and Take Profit
Stop Loss:
For buy trades: Place the stop loss below the recent swing low.
For sell trades: Place the stop loss above the recent swing high.
Take Profit:
Use a risk-to-reward ratio of 1:2 or higher.
Alternatively, exit the trade when Stochastic reaches the opposite extreme (80 for buys, 20 for sells).
Example
Scenario: GBP/USD on a 15-minute chart.
The 20 EMA is above the 50 EMA, indicating an uptrend.
The Stochastic Oscillator dips below 20, and %K crosses above %D.
Enter a buy trade when the price bounces off the 20 EMA.
Place a stop loss below the nearest swing low and a take profit at twice the risk.
Tips for Success
Avoid Choppy Markets: Ensure the EMAs are diverging, and there’s a clear trend.
Use Stochastic for Confirmation: Only take trades when the Stochastic Oscillator aligns with the EMA trend.
Combine with Price Action:
Watch for candlestick patterns (e.g., pin bars, engulfing candles) near the 20 EMA for additional confirmation.
Practice Discipline: Stick to your stop-loss and take-profit rules.
Squeeze Momentum Indicator [CHE] Squeeze Momentum Indicator
The Squeeze Momentum Indicator is an improved and simplified version of the classic Squeeze Momentum Indicator by LazyBear. It focuses on precise detection of squeeze phases without relying on Keltner Channels (KC) or complex momentum calculations. Instead, it emphasizes the dynamic analysis of Bollinger Band widths and their distance changes to provide clear and intuitive signals.
What is the Squeeze Momentum Indicator ?
This indicator helps you identify periods of low volatility (squeeze phases) when the market is often poised for significant moves. With its clear visualization and innovative methods, it enables traders to spot breakout opportunities early and trade strategically.
Differences from the Original LazyBear Indicator
1. Use of Bollinger Bands (BB):
- LazyBear Indicator combines Bollinger Bands with Keltner Channels. A squeeze is detected when the Bollinger Bands fall inside the Keltner Channels.
- CHE Indicator relies solely on Bollinger Bands and an additional analysis of their width (distance between the upper and lower bands). This makes the calculation more straightforward and reduces dependency on multiple indicator families.
2. Squeeze Detection:
- LazyBear: A squeeze is defined based on the relationship between Bollinger Bands and Keltner Channels. It has three states: “Squeeze On,” “Squeeze Off,” and “No Squeeze.”
- CHE: A squeeze is detected when the width of the Bollinger Bands falls below the lower "Distance Bollinger Bands." It only has two states: Squeeze Active and No Squeeze.
3. Momentum Calculation:
- LazyBear: Uses linear regression (LinReg) to calculate momentum and displays it as color-coded histograms.
- CHE: Does not include momentum calculations. The focus is entirely on volatility visualization and squeeze detection.
4. Visualization:
- LazyBear: Displays momentum histograms and horizontal lines to signal different states.
- CHE: Visualizes the width of the Bollinger Bands and their Distance Bollinger Bands as lines on the chart. The chart background turns green when a squeeze is detected, simplifying interpretation.
What Is Plotted?
1. Bollinger Band Width:
- A line representing the distance between the upper and lower Bollinger Bands, measuring market volatility.
2. Distance Bollinger Bands:
- Two additional lines (upper and lower Distance Bollinger Bands) based on the Bollinger Band width, defining thresholds for squeeze conditions.
3. Session-Specific Box:
- A dynamic box is drawn on the chart during a squeeze phase. The box marks the high and low of the market for the squeeze duration. It visually frames the range, helping traders monitor breakouts beyond these levels.
4. Max/Min Markers:
- The indicator dynamically updates and marks the maximum and minimum price levels during a squeeze. These levels can serve as breakout thresholds or critical reference points for price action.
5. Background Color:
- The chart background turns green when a squeeze is active (Bollinger Band width falls below the lower Distance Bollinger Bands). This highlights potential breakout conditions.
How to Use the CHE Indicator
1. Add the Indicator:
- Add the indicator to your chart and customize settings such as Bollinger Band length (`sqz_length`) and multiplier (`sqz_multiplier`) to fit your strategy.
2. Identify Squeeze Conditions:
- Watch for the green background, which signals a squeeze—indicating a period of low volatility where significant market moves often follow.
3. Monitor the Box and Max/Min Levels:
- During a squeeze, the box outlines the trading range, and the maximum and minimum levels are updated in real time. Use these as breakout triggers or support/resistance zones.
4. Session-Specific Analysis:
- The indicator can highlight squeezes during specific trading sessions (e.g., market open), allowing you to focus on key time frames.
5. Additional Confirmation:
- Combine the CHE Indicator with price action analysis or momentum tools to determine the direction of potential breakouts.
Why Use the Squeeze Momentum Indicator ?
- Simplicity: Clear visualization and reduced complexity by eliminating Keltner Channels and momentum calculations.
- Flexibility: Suitable for all markets—stocks, forex, crypto, and more.
- Enhanced Visualization: The box and max/min markers provide real-time visual cues for range-bound trading and breakout strategies.
- Efficiency: Focuses on what matters most—identifying volatility and squeeze phases.
With the Squeeze Momentum Indicator , you can take your trading strategy to the next level. Thanks to its clear design, dynamic range visualization, and innovative methods, you’ll recognize breakout opportunities earlier and trade with greater precision. Try it out and experience its user-friendliness and effectiveness for yourself!
GROK - 40 Day High BreakoutTitle: GROK - Customizable High Breakout Detector
To scan base breakout with Pine Screener
Description:
This Pine Script indicator identifies high breakout patterns based on a user-defined lookback period. By default, it checks for a breakout of the 40-day high, but the period can be adjusted to suit your trading strategy. Key features include:
Custom Lookback Period: Easily modify the number of days for high breakout detection. Lookback period is length of base you want to scan using pine screener.
Visual Alerts: Displays a green triangle above the price bar when a breakout is detected.
Alert Conditions: Built-in alert notifications for automated breakout detection.
Screener Compatibility: Plots breakout signals as a histogram for screener use.
This script is ideal for traders looking to identify strong breakout patterns and incorporate them into their strategies.
How to Use:
Adjust the lookback period in the settings to match your desired breakout criteria.
Add alerts for automated notifications when a breakout is detected.
Use the visual markers and histogram to analyze breakout patterns on your chart.
12 Month Difference - YoY ComparisonEste script foi desenvolvido para calcular e exibir a variação percentual do preço de um ativo nos últimos 12 meses, de forma simples e visual. Ele utiliza dados históricos de preços e apresenta o resultado diretamente no gráfico, permitindo ao usuário acompanhar a relação entre o valor atual e o valor de 12 meses atrás.
O cálculo é baseado em um período de 12 meses, que equivale a 252 dias úteis no mercado financeiro. O script primeiro identifica o preço atual do ativo e o compara com o preço registrado há exatamente 252 dias úteis. A diferença entre esses dois valores é transformada em uma variação percentual, o que facilita a análise de desempenho do ativo ao longo do período.
Além disso, o script define uma cor para destacar o resultado:
Verde, se a variação percentual for positiva (indicando crescimento).
Vermelho, se a variação for negativa (indicando queda).
O valor calculado é exibido de forma prática no canto inferior direito do gráfico, como uma tabela flutuante. Essa tabela contém o texto "Relação 12M" e o valor percentual correspondente, permitindo uma leitura rápida.
Embora o resultado seja calculado para todos os momentos no gráfico, ele é mostrado apenas como uma tabela no último ponto confirmado da série histórica, ou seja, no momento mais recente com dados disponíveis. Além disso, o script inclui o valor da relação na legenda do gráfico, mas ele está oculto visualmente para evitar sobrecarregar o layout.
Esse indicador é útil para analisar rapidamente o desempenho de um ativo ao longo de um ano, ajudando investidores e analistas a entenderem tendências e mudanças no mercado.
This script was developed to calculate and display the percentage change in the price of an asset over the last 12 months, in a simple and visual way. It uses historical price data and displays the result directly on the chart, allowing the user to monitor the relationship between the current value and the value from 12 months ago.
The calculation is based on a 12-month period, which is equivalent to 252 business days in the financial market. The script first identifies the current price of the asset and compares it with the price recorded exactly 252 business days ago. The difference between these two values is transformed into a percentage change, which makes it easier to analyze the asset's performance over the period.
In addition, the script defines a color to highlight the result:
Green, if the percentage change is positive (indicating growth).
Red, if the change is negative (indicating a decline).
The calculated value is displayed conveniently in the bottom right corner of the chart, as a floating table. This table contains the text "12M Ratio" and the corresponding percentage value, allowing for quick reading.
Although the result is calculated for all points in time on the chart, it is only displayed as a table at the last confirmed point in the historical series, i.e. the most recent point in time with available data. In addition, the script includes the ratio value in the chart legend, but it is visually hidden to avoid cluttering the layout.
This indicator is useful for quickly analyzing the performance of an asset over a year, helping investors and analysts understand trends and changes in the market.
1-3-1 Strat Combo with 50% Level (12h)Logic Explanation
1-3-1 Combo Detection:
The script detects the 1-3-1 pattern using the previous 3 candles:
Candle 4: Inside Bar (Type 1).
Candle 3: Outside Bar (Type 3).
Candle 2: Inside Bar (Type 1).
4th Candle Behavior:
If the 4th candle (current bar):
Stays an inside bar (Type 1) → isFourthInsideBar is true.
Becomes a directional bar (Type 2) → isFourthDirectional is true.
If either of these conditions is true, the script stops calculating and waits for the next valid 1-3-1 setup.
50% Level Calculation:
If the conditions are not met (e.g., the 4th candle doesn’t stop the pattern), the script:
Plots a dotted line at the 50% level of the 3rd candle.
Adds a label showing the 50% level.
Stop Calculations:
No line, box, or label is drawn if the 4th candle is a Type 1 (inside bar) or Type 2 (directional bar).
Visual Outputs:
Dotted Box: Marks the 1-3-1 combo setup.
50% Line: Drawn only if the 4th candle does not invalidate the pattern.
Label: Displays the 50% level of the 3rd candle.
How to Use:
Apply this script on the 12-hour chart.
The script will:
Detect valid 1-3-1 patterns.
Stop drawing any calculations if the 4th candle is an inside bar (1) or a directional bar (2).
Wait for the next valid 1-3-1 combo.
Dual Zigzag [Trendoscope®]🎲 Dual Zigzag indicator is built on recursive zigzag algorithm. It is very similar to other zigzag indicators published by us and other authors. However, the key point here is, the indicator draws zigzag on both price and any other plot based indicator on separate layouts.
Before we get into the indicator, here are some brief descriptions of the underlying concepts and key terminologies
🎯 Zigzag
Zigzag indicator breaks down price or any input series into a series of Pivot Highs and Pivot Lows alternating between each other. Zigzags though shows pivot high and lows, should not be used for buying at low and selling at high. The main application of zigzag indicator is for the visualisation of market structure and this can be used as basic building block for any pattern recognition algorithms.
🎯 Recursive Zigzag Algorithm
Recursive zigzag algorithm builds zigzag on multiple levels and each level of zigzag is based on the previous level pivots. The level zero zigzag is built on price. However, for level 1, instead of price level 0 zigzag pivots are used. Similarly for level 2, level 1 zigzag pivots are used as base.
🎲 Components Dual Zigzag Indicator
Here are the components of Dual zigzag indicator
Built in Oscillator - Indicator has built in oscillator options for plotting RSI (Relative Strength Index), MFI (Money Flow Index), cci (Commodity Channel Index) , CMO (Chande Momentum Oscillator), COG (Center of Gravity), and ROC (Rate of Change). Apart from the given built in oscillators, users can also use a custom external output as base. The oscillators are not printed on the price pane. But, printed on a separate indicator overlay.
Zigzag On Oscillator - Recursive zigzag is calculated and printed on the oscillator series. Each pivot high and pivot low also prints a label having the retracement ratios, and price levels at those points. Zigzag on the oscillator is also printed on the indicator overlay pane.
Zigzag on Price - Recursive zigzag calculated based on price and printed on the price pane. This is made possible by using force_overlay option present in the drawing objects. At each zigzag pivot levels, the label having price retracement ratios, and oscillator values are printed.
It is called dual zigzag because, the indicator calculates the zigzag on both price and oscillator series of values and prints them separately on different panes on the chart.
🎲 Indicator Settings
Settings include
Theme display settings to get the right colour combination to match the background.
Zigzag settings to be used for zigzag calculation and display
Oscillator settings to chose the oscillator to be used as base for 2nd zigzag
🎲 Applications
Useful in spotting divergences with both indicator and price having their own zigzag to highlight pivots
Spotting patterns in indicators/oscillators and correlate them with the patterns on price
🎲 Using External Input
If users want to use an external indicator such as OBV instead of the built in oscillators, then can do so by using the custom option.
Here is how this can be done.
Step1. Add both Dual Zigzag and the intended indicator (in this case OBV) on the chart. Notice that both OBV and Dual zigzag appear on different panes.
Step2. Edit the indicator settings of Dual zigzag and set custom indicator by selecting "custom" as oscillator name and then by setting the custom external indicator name and input.
Step 3. You would notice that the zigzag in Dual Zigzag indictor pane is already showing the zigzag pivots based on the OBV indicator and the price pivots display obv values at the pivot points. We can leave this as is.
Step 4. As an additional step, you can also merge the OBV pane and the Dual zigzag indicator pane into one by going into OBV settings and moving the indicator to above pane. Merge the scales so that there is no two scales on the same pane and the entire scale appear on the right.
At the end, you should see two panes - one with price and other with OBV and both having their zigzag plotted.
BRT Cluster VolumeTitle and Purpose
BRT Cluster Volume is a powerful market analysis tool designed to identify key support and resistance levels, cluster volumes, and breakout signals. This script is highly beneficial for traders who aim to gain deeper insights into market trends and pinpoint zones of interest for buyers and sellers.
Key Features
1. Support and Resistance Levels:
- The script automatically detects chart extremums by analyzing a specified number of bars on the left and right to form levels. This approach effectively identifies local highs and lows.
- The uniqueness of this implementation lies in its dynamic data processing. For each extremum, the "channel width" is calculated, allowing insignificant levels to be filtered out based on a user-defined minimum width. This method eliminates noise and ensures focus on critical levels.
- Extremum lines can be extended to the right (when enabled), allowing traders to track current price movements relative to historical levels.
2. Cluster Volume:
- The cluster analysis is based on lower timeframe data, providing precise identification of key zones of market participant activity. The script dynamically requests close prices and volumes from lower timeframes, calculates the average volume, and identifies levels where volumes exceed a defined threshold.
- The visualization of cluster volumes is unique: volumes exceeding the threshold are displayed as candles with customizable colors and markers. These indicators help traders identify zones of significant interest.
- Cluster volume is only displayed when it interacts with support or resistance levels, ensuring that the visualization remains precise and relevant for market analysis.
3. Breakout Signals:
- The script evaluates "breakout strength" for each breakout of support or resistance levels by comparing the current price with the level. This helps filter false breakouts and focus on significant price movements.
- Traders can select the source for breakout signals (close price or high/low), offering flexibility for various trading styles and strategies.
- By incorporating the concept of "maximum breakout strength," the script highlights only meaningful breakouts, ignoring minor fluctuations.
4. Integration of Trading Sessions:
- Extremum levels for major trading sessions (Asia, Europe, USA) are identified and labeled on the chart. This allows traders to see when significant price levels were formed during the day.
- The script uses timestamps to automatically detect session times, ensuring accuracy and minimizing manual adjustments.
5. Dynamic Data Updates:
- The script dynamically updates support and resistance levels in real time as new data becomes available. This feature is crucial for traders working in fast-moving markets.
- Outdated information (such as obsolete levels) is automatically removed to keep the chart clean and focused on relevant data.
6. Visualization of Activity Zones:
- Trend direction is visualized using color-coded candles based on cluster volumes. For instance, candles with volumes exceeding the average are highlighted with specific colors, helping traders quickly identify areas of heightened activity.
- The unique aspect of this visualization is that cluster volumes appear only in zones where they interact with breakout levels, providing an intuitive and streamlined presentation of critical data.
Usage
- Support and Resistance: Adjust the "Left Bars" and "Right Bars" settings to determine extremums. Use the "Channel Min Width" setting to filter out insignificant levels.
- Cluster Volume: Customize the analysis period and volume threshold to identify high-activity zones. Enable breakout clusters to see how volumes interact with breakouts.
- Session Extremums: Highlight significant levels for Asia, Europe, and US trading sessions to gain insights into market dynamics across different time zones.
- Breakout Signals: Configure the breakout strength and source (close or high/low) for precise signal detection.
Parameter Details
1. Support & Resistance:
- `Left Bars` / `Right Bars`: Number of bars to consider for determining extremums.
- `# of Lines`: Maximum number of support/resistance lines to display.
- `Channel Min Width`: Minimum channel width to filter insignificant levels.
2. Breakout:
- `Show Breakouts`: Toggle breakout signal display.
- `Max breakout strength`: Maximum strength for valid breakouts.
- `Breakout source`: Data source for breakouts (close or high/low).
3. Cluster Volume:
- `Lookback`: Number of bars to analyze for cluster volumes.
- `Threshold`: Volume threshold (percentage above the average).
- `Cluster Volume Timeframe`: Timeframe for cluster volume analysis.
- `Breakout Cluster`: Display cluster volumes only for breakout-related zones.
4. Visual Settings:
- `Extend extremum lines to the right`: Extend support/resistance lines to the right.
- `Show ASIA/EU/US Session Extremums`: Display extremums for trading sessions.
Features and Benefits
- The script provides flexible parameter customization, allowing it to adapt to different trading styles and timeframes.
- The visualization is designed to be clean and intuitive, ensuring users can easily interpret the data.
- Suitable for all timeframes, making it ideal for both intraday and long-term market analysis.
Limitations
- The script is not suitable for analysis on non-standard chart types (e.g., Heikin Ashi, Renko, Kagi).
- To ensure accurate performance, realistic data for commission and slippage should be used.
Warnings
- The script relies on historical data for calculations, which may cause discrepancies in real-time conditions.
- Users should fully understand the functionality of cluster analysis and breakout signals before using the script in live trading.
This script combines advanced data processing logic, dynamic level adjustments, and unique visualization approaches, making it an indispensable tool for market analysis and trading decision-making.
IPO Lifecycle Sell Strategy [JARUTIR]IPO Lifecycle Sell Strategy with Dynamic Buy Date and Multiple Sell Rules
This custom TradingView script is designed for traders looking to capitalize on dynamic strategies for IPOs and growth stocks, by implementing several sell rules based on price action and technical indicators. It provides a set of sell rules that are applied dynamically depending on the stock's lifecycle and price action, allowing users to lock in profits and minimize drawdowns based on key technical thresholds.
The four sell strategies incorporated into this script are inspired by the book "The Lifecycle Trade", a resource that focuses on capturing profits while managing risk in different phases of a stock's lifecycle, from IPO to high-growth stages.
Key Features:
Buy Price and Buy Date: You can either manually input your buy price and date or let the script automatically detect the buy date based on the specified buy price.
Multiple Sell Strategies: Choose from 4 predefined sell strategies:
Ascender Rule : Captures strong momentum from IPO stocks by selling portions at specific price levels or technical conditions.
Midterm Rule : Focuses on holding for longer periods, with defensive sell signals triggered when the stock deviates significantly from peak price or key moving averages.
40 Week Rule : Designed for long-term holds, this rule triggers a sell when the stock closes below the 40-week moving average.
Everest Rule : Aggressive strategy for selling into strength based on parabolic moves or gap downs, ideal for high momentum stocks.
Interactive Features:
Horizontal Green Line showing the buy price level from the buy date.
Visual Sell Signals appear only after the buy date to ensure that your analysis is relevant to the stock lifecycle.
Customizable settings, allowing you to choose your preferred sell rule strategy and automate buy date detection.
This script is perfect for traders using a strategic, systematic approach to IPOs and high-growth stocks, whether you're looking for quick exits during momentum phases or holding for longer-term growth.
Usage:
Input your Buy Price and Buy Date, or allow the script to automate the buy date detection.
Select a Sell Rule strategy based on your risk profile and trading style.
View visual signals for selling when specific conditions are met.
Frequently Asked Questions (FAQs):
Q1: How do I input my Buy Price and Buy Date?
The script allows you to either manually input the Buy Price and Buy Date or use the automated detection. If you choose automated detection, the script will automatically assign the buy date when the price crosses above your set Buy Price.
Q2: What is the purpose of the "Sell Rules"?
The script offers four sell strategies to help manage different types of stocks in varying phases of their lifecycle:
Ascender Rule: Targets IPO stocks showing positive momentum.
Midterm Rule: A defensive strategy for stocks in a steady uptrend.
40 Week Rule: Long-term hold strategy designed to ride stocks through extended growth.
Everest Rule: Aggressive strategy to capture profits during parabolic price moves.
Q3: What is the significance of the Green Line at Buy Price?
The Green Line represents your entry point (Buy Price) on the chart. It will appear from the buy date onwards, helping you track the performance of your stock relative to your entry.
Q4: Can I customize the Sell Strategy?
Yes! You can choose from the available Sell Rules (Ascender Rule, Midterm Rule, 40 Week Rule, Everest Rule) via an input option in the script. Each strategy has its own unique triggers based on price action, moving averages, and time-based conditions.
Q5: Does this script work for stocks and crypto?
Yes, this script is designed for both stocks and cryptocurrencies. It works on any asset where price data and timeframes are available.
Q6: How do the Weekly Moving Averages (WSMA) work in this strategy?
The script uses weekly moving averages (WSMA) to track longer-term trends. These are essential for some of the sell rules, such as the Midterm Rule and 40 Week Rule, which rely on the stock's movement relative to the 40-week moving average.
Q7: Will the script plot a Sell Signal immediately after the Buy Date?
No, sell signals will only be plotted after the Buy Date. This ensures that the sell strategy is relevant to your actual holding period and avoids premature triggers.
Q8: How do I interpret the Sell Signal?
The script will plot a Red Sell Signal above the bar when the sell conditions are met, based on the selected strategy. This indicates that it may be a good time to exit the position according to your chosen rule.
Q9: Can I use this strategy on different timeframes?
Yes, you can apply the script to any timeframe. However, some sell strategies, like the Midterm Rule and 40 Week Rule, are designed to work best with weekly data, so it's recommended to use these strategies with longer timeframes.
Q10: Does this script have any alerts?
Yes! The script supports alert conditions that will notify you when the sell conditions are met according to your selected rule. You can set up alerts to stay informed without needing to watch the chart constantly.
Q11: What if I want to disable some of the sell rules?
You can select your preferred sell rule using the "Select Sell Rule" dropdown. If you don’t want to use a particular rule, simply choose a different strategy or leave it inactive.
------------------------------
Disclaimer:
This strategy is intended for educational purposes only. It should not be considered financial advice. Always perform your own research and consult with a professional before making any trading decisions. Trading involves significant risk, and you should never trade with money you cannot afford to lose.
Physical Levels (XAUUSD, 5$ Pricesteps)Functionality:
This indicator draws horizontal lines in the XAUUSD market at a fixed spacing of USD 5. The lines are both above and below the current market price. The number of lines is limited to optimize performance.
Use:
The indicator is particularly useful for traders who want to analyze psychological price levels, support and resistance areas, or significant price zones in the gold market. It helps to better visualize price movements and their proximity to round numbers.
How it works:
The indicator calculates a starting price based on the current price of XAUUSD, rounded to the nearest multiple of USD 5.
Starting from this starting price, evenly distributed lines are drawn up and down.
The lines are black throughout and are updated dynamically according to the current chart.
ATR/DTR with Custom Percentage DisplayThis Pine Script indicator provides a detailed view of the Average True Range (ATR) and Daily True Range (DTR), along with additional calculated metrics to assist in analyzing price volatility. The key features of the indicator include:
ATR Calculation:
The ATR is calculated over a user-defined timeframe, allowing traders to assess average market volatility over a specific period.
DTR Calculation:
The DTR represents the absolute range (high - low) of the current or chosen timeframe, providing insights into the day's price movement.
ATR/DTR Percentage:
This metric calculates the DTR as a percentage of the ATR, showing how the daily range compares to the average range, with dynamic coloring to highlight when it exceeds a user-defined threshold.
Custom Percentage of ATR:
Users can input a custom percentage to calculate and display a corresponding value of the ATR. For example, entering 15% will compute and display 15% of the ATR in the indicator’s table.
Dynamic Table Display:
The indicator outputs all these metrics in a well-organized table that is overlaid on the chart. The table includes:
ATR
DTR
ATR/DTR percentage
The user-defined percentage of ATR
Customizable Features:
Color Coding: The table dynamically changes its background color when the ATR/DTR percentage exceeds a user-defined threshold.
Placement Options: The table's position on the chart can be adjusted (e.g., bottom-right, top-center) for optimal visibility.
Use Case:
This indicator is ideal for traders who want a deeper understanding of market volatility and prefer visual representation of how current price movements compare to historical averages. It is especially useful for:
Setting volatility-based stop-loss levels.
Identifying high-volatility trading opportunities.
Tailoring strategies around price movement patterns.
Drawdown from All-Time High (Line)This Pine Script is a **Drawdown Indicator from All-Time High** for TradingView. It calculates and plots the percentage drawdown from the highest price the asset has ever reached (the all-time high). Here's a breakdown of what this script does:
### Description:
- **Drawdown Calculation**:
- The drawdown is calculated as the difference between the current price (`close`) and the all-time high, divided by the all-time high, and multiplied by 100 to express it as a percentage.
- If the current price is higher than the previous all-time high, the all-time high is updated to the current price.
- **All-Time High Tracking**:
- The script tracks the highest price (`allTimeHigh`) that the asset has ever reached. Each time a new high is reached, the `allTimeHigh` value is updated.
- **Line Plot**:
- The drawdown percentage is then plotted as a line on the chart, with a color of **blue** for easy visualization.
- The line shows how much the price has dropped relative to its all-time high.
- **Zero Line**:
- A horizontal line is added at the **0%** level to act as a reference point, which is helpful to identify when the asset has fully recovered to its all-time high.
### Key Features:
- **Track Drawdown**: The indicator helps visualize how far the current price has fallen from its highest point, which is useful for understanding the depth of losses (drawdowns) during a period.
- **Update All-Time High**: The indicator automatically updates the all-time high whenever a new high is detected.
- **Visual Reference**: The 0% horizontal line provides a clear indication of when the asset is at its all-time high, and the drawdown is at 0%.
### How it Works:
- If the current price surpasses the all-time high, the script will reset the all-time high to the new price.
- The drawdown percentage is calculated from the current price relative to this all-time high, and it is displayed as a line on the chart.
### Visuals:
- **Drawdown Line**: Plots the percentage of the drawdown, which is the drop from the all-time high.
- **Zero Line**: A dotted horizontal line at 0% marks the level of the all-time high.
This indicator is valuable for understanding the extent of price corrections and potential recoveries relative to the historical peak of the asset. It is especially useful for traders and investors who want to assess the risk of drawdowns in relation to the highest price achieved by the asset.
Liquidity IndicatorThe Liquidity Indicator helps identify key price levels where liquidity may be concentrated by highlighting local highs and local lows on the chart. These levels are calculated using a lookback period to determine the highest and lowest points in the recent price action.
Local Highs: Displayed as red lines, these indicate recent peaks where price has experienced rejection or a possible reversal point.
Local Lows: Displayed as green lines, these represent recent troughs where price may find support or experience a bounce.
This indicator is useful for spotting potential areas of interest for price reversal or continuation, as high liquidity zones may lead to more significant price movements.
Key Features:
Adjustable lookback period to define the scope for identifying local highs and lows.
Continuous plotting without any time restrictions, providing real-time insights into liquidity conditions.
Alerts available for when a local high or local low is detected, enabling timely market analysis.
Use Case:
This indicator can be used in conjunction with other technical analysis tools or strategies to help identify significant price levels where liquidity could impact price action. It is suitable for both intraday and swing traders looking for key price zones where potential reversals or continuations might occur.
RagiBaba's 3:1 Risk-to-Reward Tool with LeverageThis indicator allows you to visualize a 3:1 risk-to-reward ratio for your trades on the chart. It automatically calculates and displays the Stop Loss and Take Profit levels based on your input for:
Entry Price
Trade Amount ($)
Risk Amount ($)
Leverage (x)
You can adjust the following settings:
Trade Direction: Choose between a Long or Short position.
Leverage: Enter the leverage value (e.g., 25x).
Entry Price: Set the price at which you plan to enter the trade.
Risk and Reward: Input the amount of money you're willing to risk and the desired reward (automatically calculated as 3 times your risk).
Label Position: Choose the label position for Entry, Stop, and Target (left, center, or right on the chart).
Each line has a corresponding label showing the price for Entry, Stop Loss, and Take Profit. The labels can be positioned on the left, center, or right side of the chart for better readability.
This tool helps you manage your trades by giving you clear visual cues for your entry, stop loss, and take profit levels with the option to adjust for leverage.