123 Reversal Trading StrategyThe 123 Reversal Trading Strategy is a technical analysis approach that seeks to identify potential reversal points in the market by analyzing price patterns. This Pine Script™ code implements a version of this strategy, and here’s a detailed description:
Strategy Overview
Objective: The strategy aims to identify bullish reversal patterns using the 123 pattern and manage trades with a specified holding period and a 20-day moving average as an additional exit condition.
Key Components:
Holding Period: The number of days to hold a trade is adjustable, with the default set to 7 days.
Moving Average: A 200-day simple moving average (SMA) is used to determine an exitcondition based on the price crossing this average.
Pattern Recognition:
Condition 1: The low of the current day must be lower than the low of the previous day.
Condition 2: The low of the previous day must be lower than the low from three days ago.
Condition 3: The low two days ago must be lower than the low from four days ago.
Condition 4: The high two days ago must be lower than the high three days ago.
Entry Condition: All four conditions must be met for a buy signal.
Exit Condition: The position is closed either after the specified holding period or when the price reaches or exceeds the 200-day moving average.
Relevant Literature
Graham, B., & Dodd, D. L. (1934). Security Analysis. This classic work introduces fundamental analysis and technical analysis principles which are foundational to understanding patterns like the 123 reversal.
Murphy, J. J. (1999). Technical Analysis of the Financial Markets. Murphy provides an extensive overview of technical indicators and chart patterns, including reversal patterns similar to the 123 pattern.
Elder, A. (1993). Trading for a Living. Elder discusses various trading strategies and technical analysis techniques that complement the understanding of reversal patterns and their application in trading.
Risks and Considerations
Pattern Reliability: The 123 reversal pattern, like many technical patterns, is not foolproof. It can generate false signals, especially in volatile or trending markets. This may lead to losses if the pattern does not play out as expected.
Market Conditions: The strategy may perform differently under various market conditions. In strongly trending markets, reversal patterns might not be as reliable.
Lagging Indicators: The use of the 200-day moving average as an exit condition can be considered a lagging indicator. This means it reacts to price movements with a delay, which might result in late exits and missed profit opportunities.
Holding Period: The fixed holding period of 7 days may not be optimal for all market conditions or stocks. It is essential to adjust the holding period based on market dynamics and individual stock behavior.
Overfitting: The parameters used (like the number of days and moving average length) are set based on historical data. Overfitting can occur if these parameters are tailored too specifically to past data, leading to reduced performance in future scenarios.
Conclusion
The 123 Reversal Trading Strategy is designed to identify potential market reversals using specific conditions related to price lows and highs. While it offers a structured approach to trading, it is essential to be aware of its limitations and potential risks. As with any trading strategy, it should be tested thoroughly in various market conditions and adjusted according to the individual trading style and risk tolerance.
Các mẫu biểu đồ
Earnings Date Highlighter - from0_to_1This indicator, called "Earnings Date Highlighter," is designed to visualize earnings data for up to four different stocks on a single chart. It's particularly useful for traders or investors who want to track earnings events for multiple companies simultaneously, such as the top holdings of an ETF.
Key features:
1. Tracks earnings data (estimates and actuals) for four user-defined symbols.
2. Plots earnings data points with customizable colors for each symbol.
3. Highlights earnings dates with background colors.
4. Displays green up arrows for earnings beats and red down arrows for earnings misses.
Why someone would use it:
1. To monitor earnings events for multiple stocks in a single view.
2. To quickly identify potential market-moving events for key components of an ETF or portfolio.
3. To spot patterns in earnings performance across different companies or sectors.
4. To help with timing trades or adjusting positions around earnings announcements.
This tool can be particularly valuable for investors focused on ETFs, as it allows them to visualize earnings dates and performance for the ETF's major holdings all in one place, potentially providing insights into how the ETF might behave around these key events.
Author:
www.tradingview.com
Price Action Volumetric Order Blocks [UAlgo]"Price Action Volumetric Order Blocks" indicator aims to identify significant price zones in the market based on a combination of price action and volume analysis. It utilizes the concept of "Order Blocks," which are areas on the chart where large orders are believed to have been placed, influencing price behavior. By analyzing price swings and volume activity, the indicator attempts to highlight potential support and resistance levels.
🔶 Key Features
Swing Length: This input allows you to adjust the timeframe used to identify price swings for order block detection. A longer swing length will focus on larger timeframes and potentially capture stronger order blocks.
Show Last X Order Blocks: This controls the number of order blocks displayed on the chart. You can choose to visualize a specific number of the most recent order blocks.
Violation Check: This setting determines how the indicator identifies potential order block violations. You can choose between "Wick" or "Close" violations. A "Wick" violation occurs when the price (wick) extends beyond the order block boundaries, while a "Close" violation signifies that the closing price breaches the order block.
Hide Overlap: This option allows you to manage the display of overlapping order blocks. If set to "True," only non-overlapping order blocks will be shown, potentially offering a clearer visualization.
Colors: You can customize the color scheme for bullish (upward) and bearish (downward) order blocks to enhance visual clarity on the chart.
🔶 Interpreting the Indicator
Order Blocks: The teal-colored boxes represent bullish order blocks, indicating areas of demand where buying pressure is likely to be strong. Red-colored boxes represent bearish order blocks, indicating areas of supply where selling pressure is likely to be dominant. These zones often signal potential reversal points or consolidation areas.
Strength Calculations: The indicator calculates the relative strength of bullish and bearish blocks based on volume. A higher bullish strength indicates stronger buying pressure, while higher bearish strength suggests more selling pressure. Traders can use this information to gauge the strength of a price level and predict future price movements.
Market Structure Lines: The indicator displays horizontal lines to depict the current market structure, labeled as "MSB" (Market Sell Balance) or "BOS" (Break of Structure). These lines can help visualize the prevailing trend direction.
Order Block Violations: When a price wick or close breaches an order block (depending on the chosen violation type), the corresponding order block visualization is removed from the chart. This can signify a potential weakening of the identified support or resistance zone.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Trend/with EMA382Introduction to the "Trend/with EMA382" Indicator
The "Trend/with EMA382" indicator is a powerful technical analysis tool that combines trend signals with Exponential Moving Averages (EMA), offering traders a comprehensive view of market dynamics and helping identify potential trading opportunities.
1. Trend Analysis with Trend
The first part of this indicator uses a trend calculation algorithm based on the recent market highs and lows. These levels are used to determine the primary trend:
Bullish (Uptrend): When the market is in an uptrend, the chart will display buy signals in green.
Bearish (Downtrend): When the market is trending down, sell signals are shown in red.
The crossover points between price and trend levels will indicate buy or sell signals on the chart, enabling traders to easily spot entry and exit points.
2. Combination with EMA382
EMA (Exponential Moving Average) is a crucial tool in technical analysis, helping smooth price data and eliminate insignificant short-term fluctuations. This indicator uses three key EMAs:
EMA 34: Reflects short-term trends.
EMA 89: Helps identify medium-term trends.
EMA 200: Determines long-term trends.
These three EMAs assist traders in identifying the overall direction of the market, allowing them to forecast potential trend developments.
3. Application in Trading
The "Trend/with EMA382" indicator is designed to suit various time frames, from short-term to long-term trading. The combination of trend signals and EMAs helps:
Identify the primary market trend.
Provide accurate entry and exit signals.
Deliver clear signals for risk management and profit optimization.
Conclusion
"Trend/with EMA382" is an effective indicator that offers clear signals for both trend and market momentum. By combining EMAs with trend analysis, this indicator empowers traders to make more informed and precise trading decisions.
EagleVision.V33 - Inside Pin Bar EagleVision.V33 is a specialized indicator designed for traders who focus on price action. It detects and highlights the Inside Pin Bar candle pattern, a key signal that can indicate potential market reversals or trend continuations. This tool is invaluable for traders who rely on precise candlestick patterns to make data-driven decisions.
Features:
• Customizable Pattern Highlighting: EagleVision.V33 allows traders to choose custom colors to highlight Inside Pin Bar patterns directly on the chart. This makes identifying critical trading signals straightforward, even in busy market conditions.
• Pin Bar Candle Customization: Beyond just highlighting, the indicator enables users to change the color of the detected pin bar itself, ensuring that crucial patterns are immediately visible and easy to track.
• Versatile Timeframe Application: The indicator can be applied across various timeframes, from intraday (1 minute, 5 minutes) to longer-term charts (daily, weekly). Users can easily switch between timeframes within the settings, making it adaptable to different trading strategies.
• Enhanced Visual Clarity with Background Highlighting: For traders who prefer additional emphasis, EagleVision.V33 offers an option to apply a background color that highlights the entire region where the Inside Pin Bar pattern is detected.
How It Works:
• Inside Bar Identification: The indicator first identifies an Inside Bar, where a candle’s high and low fall within the range of the preceding candle (the mother bar). This is a foundational pattern in price action trading.
• Pin Bar Detection: It then checks if the candle is a Pin Bar, characterized by a small body and a prominent wick (either upper or lower), which typically signals potential market turning points.
• Pattern Highlighting & Visualization: Upon detecting both conditions (Inside Bar and Pin Bar), EagleVision.V33 highlights the pattern using customizable shapes and colors, and optionally applies a background shade to further enhance visibility.
Use Cases:
• Reversals at Key Levels: The Inside Pin Bar pattern often appears at significant support or resistance levels, signaling potential reversals. EagleVision.V33 helps traders spot these opportunities early.
• Trend Continuations: In trending markets, this pattern can confirm the continuation of a trend, providing traders with the confidence to hold positions or enter new ones.
Customization Options:
• Pattern Highlight Color: Choose a distinct color for the label or shape that marks the Inside Pin Bar pattern, making it stand out against other chart elements.
• Pin Bar Candle Color: Customize the color of the Pin Bar itself, ensuring that it is immediately recognizable on the chart.
• Background Highlighting: Optionally apply a background color to the chart area where the pattern is detected, further enhancing visual clarity and making it easier to spot potential trading opportunities.
Why EagleVision.V33 Stands Out:
EagleVision.V33 is not just another pattern detection tool; it’s engineered for precision and clarity, with highly customizable features that cater to the unique needs of price action traders. By combining both Inside Bar and Pin Bar detection, it offers a powerful edge, providing traders with actionable insights directly on their charts.
Rainbow Histogram v1.01Sure! Here’s a compelling English version of the article for your TradingView post:
---
### 🌈 **Introducing Rainbow Histogram: A Fusion of EMA and MA for Enhanced Trading Analysis**
**Hello Traders,**
I’m excited to introduce a fresh concept that combines technical analysis techniques into a new indicator called **Rainbow Histogram**. This innovative tool blends Exponential Moving Averages (EMA) and Moving Averages (MA) to provide you with a powerful and accurate tool for making trading decisions.
#### **🎨 What is Rainbow Histogram?**
The Rainbow Histogram is designed to help you identify market trends and signal precise entry and exit points by blending EMA and MA into a colorful "Rainbow" display. This visual approach enhances your ability to spot trend strength and direction with clarity.
#### **📈 How Does Rainbow Histogram Work?**
1. **Exponential Moving Average (EMA):** Captures short-term trends and reacts quickly to price changes.
2. **Moving Average (MA):** Tracks long-term trends and provides a broader view of the market direction.
**Rainbow Histogram** uses the combination of EMA and MA to create a histogram that shows the difference between these two averages in distinct colors. This makes it easy to visualize trend changes and market momentum.
#### **🔧 Setting It Up**
1. **EMA:** Adjust the EMA settings based on your trading timeframe and strategy (e.g., EMA 9, EMA 21).
2. **MA:** Set the MA parameters to capture long-term trends (e.g., MA 50, MA 200).
#### **🌟 Why Use Rainbow Histogram?**
- **Simplified Analysis:** Quickly identify trends and their strength with a clear visual representation.
- **Distinct Colors:** Differentiate between EMA and MA with vibrant colors for easy interpretation.
- **Precise Signals:** Get clear buy and sell signals based on histogram changes.
#### **📥 Get Started**
Add **Rainbow Histogram** to your TradingView charts by searching for the script in TradingView’s library or set it up manually using the recommended settings.
#### **📝 In Summary**
**Rainbow Histogram** is a unique tool that simplifies trend analysis and enhances accuracy by merging EMA and MA into a single, colorful indicator. Use this tool to refine your trading strategy and make more informed financial decisions.
If you have any questions or feedback about **Rainbow Histogram**, feel free to comment below or send me a message!
**Happy Trading!** 🌟
---
I hope this version effectively captures attention and engages your audience!
S&R Tracker [CHE]Dynamic S&R Tracker
1. Introduction to the Tool
Purpose:
The Dynamic S&R Tracker is a powerful TradingView tool designed to automatically detect and display support and resistance levels across multiple timeframes. It dynamically adjusts based on the current chart’s timeframe, making it easier for traders to identify key price levels for both shortterm and longterm analysis.
Key Features:
Dynamic adjustment of support and resistance levels based on realtime market conditions
Simultaneous visualization of support and resistance for two different timeframes
Automatic selection of optimal timeframes for accurate and efficient analysis
2. Functionality
Automatic Timeframe Selection:
The Dynamic S&R Tracker uses a smart function to automatically adjust the analysis timeframe based on the market’s current conditions. It selects the appropriate intervals (e.g., 1 hour, 1 day, 1 month) for displaying support and resistance levels, reducing the need for manual intervention.
Support and Resistance Identification:
The tool calculates and identifies key pivot highs and lows, which act as support and resistance levels. These levels are displayed for two timeframes at once, giving a comprehensive view of the market's shortterm and longterm trends.
3. Benefits
Efficiency:
With automatic adjustments, traders save time by not having to manually change timeframes or recalculate levels.
Enhanced Market Insight:
By analyzing two timeframes simultaneously, the tool provides a broader market perspective, helping traders spot potential reversal points and breakouts.
Customizability:
Though dynamic, the Dynamic S&R Tracker offers flexibility for manual adjustments, allowing traders to finetune the analysis based on personal preferences or market strategies.
4. Visualization
Support and Resistance Levels:
The tool uses clear visual markers—green for support and red for resistance—making it easy to spot critical price zones on the chart.
Informative Timeframe Display:
The tracker includes a customizable information box that shows the selected timeframes used in the analysis, keeping the user informed at all times.
5. Conclusion
The Dynamic S&R Tracker is an essential tool for traders seeking an automated, precise, and flexible way to analyze support and resistance across multiple timeframes. By offering dynamic adjustments and clear visual feedback, it simplifies the decisionmaking process and provides deeper market insights.
Ideal for traders who need a streamlined and adaptable solution to better navigate market trends.
N Bar Reversal Detector [LuxAlgo]The N Bar Reversal Detector is designed to detect and highlight N-bar reversal patterns in user charts, where N represents the length of the candle sequence used to detect the patterns. The script incorporates various trend indicators to filter out detected signals and offers a range of customizable settings to fit different trading strategies.
🔶 USAGE
The N-bar reversal pattern extends the popular 3-bar reversal pattern. While the 3-bar reversal pattern involves identifying a sequence of three bars signaling a potential trend reversal, the N-bar reversal pattern builds on this concept by incorporating additional bars based on user settings. This provides a more comprehensive indication of potential trend reversals. The script automates the identification of these patterns and generates clear, visually distinct signals to highlight potential trend changes.
When a reversal chart pattern is confirmed and aligns with the price action, the pattern's boundaries are extended to create levels. The upper boundary serves as resistance, while the lower boundary acts as support.
The script allows users to filter patterns based on the trend direction identified by various trend indicators. Users can choose to view patterns that align with the detected trend or those that are contrary to it.
🔶 DETAILS
🔹 The N-bar Reversal Pattern
The N-bar reversal pattern is a technical analysis tool designed to signal potential trend reversals in the market. It consists of N consecutive bars, with the first N-1 bars used to identify the prevailing trend and the Nth bar confirming the reversal. Here’s a detailed look at the pattern:
Bullish Reversal : In a bullish reversal setup, the first bar is the highest among the first N-1 bars, indicating a prevailing downtrend. Most of the remaining bars in this sequence should be bearish (closing lower than where they opened), reinforcing the existing downward momentum. The Nth (most recent) bar confirms a bullish reversal if its high price is higher than the high of the first bar in the sequence (standard pattern). For a stronger signal, the closing price of the Nth bar should also be higher than the high of the first bar.
Bearish Reversal : In a bearish reversal setup, the first bar is the lowest among the first N-1 bars, indicating a prevailing uptrend. Most of the remaining bars in this sequence should be bullish (closing higher than where they opened), reinforcing the existing upward momentum. The Nth bar confirms a bearish reversal if its low price is lower than the low of the first bar in the sequence (standard pattern). For a stronger signal, the closing price of the Nth bar should also be lower than the low of the first bar.
🔹 Min Percentage of Required Candles
This parameter specifies the minimum percentage of candles that must be bullish (for a bearish reversal) or bearish (for a bullish reversal) among the first N-1 candles in a pattern. For higher values of N, it becomes more challenging for all of the first N-1 candles to be consistently bullish or bearish. By setting a percentage value, P, users can adjust the requirement so that only a minimum of P percent of the first N-1 candles need to meet the bullish or bearish condition. This allows for greater flexibility in pattern recognition, accommodating variations in market conditions.
🔶 SETTINGS
Pattern Type: Users can choose the type of the N-bar reversal patterns to detect: Normal, Enhanced, or All. "Normal" detects patterns that do not necessarily surpass the high/low of the first bar. "Enhanced" detects patterns where the last bar surpasses the high/low of the first bar. "All" detects both Normal and Enhanced patterns.
Reversal Pattern Sequence Length: Specifies the number of candles (N) in the sequence used to identify a reversal pattern.
Min Percentage of Required Candles: Sets the minimum percentage of the first N-1 candles that must be bullish (for a bearish reversal) or bearish (for a bullish reversal) to qualify as a valid reversal pattern.
Derived Support and Resistance: Toggles the visibility of the support and resistance levels/zones.
🔹 Trend Filtering
Filtering: Allows users to filter patterns based on the trend indicators: Moving Average Cloud, Supertrend, and Donchian Channels. The "Aligned" option only detects patterns that align with the trend and conversely, the "Opposite" option detects patterns that go against the trend.
🔹 Trend Indicator Settings
Moving Average Cloud: Allows traders to choose the type of moving averages (SMA, EMA, HMA, etc.) and set the lengths for fast and slow moving averages.
Supertrend: Options to set the ATR length and factor for Supertrend.
Donchian Channels: Option to set the length for the channel calculation.
🔶 RELATED SCRIPTS
Reversal-Candlestick-Structure.
Reversal-Signals.
Season ChartThis overlay is built on the idea of seasonal charts.
It is constructed by taking the percentage change from each close and recording that change for every trading day of any year that is within the sample. We then take the average for each day of all the years.
These averages are then cumulated to create the chart as per traditional seasonal chart construction.
I have also taken a trimmed mean of the averages to try and dampen the impact one off moves that may have a dramatic effect on the daily averages (for example the crash to $0 in oil in April 2020) however, even removing 10% may not guarantee one off moves won’t affect the average.
The construction of the chart is completely dependent on the data provided by TradingView and so it is recommended that if longer sample sizes are used, the user go back to check that the years contained within the sample have a full history. Some data may have large gaps in their history and this can distort the seasonality readings.
I have attempted to align the chart with the first trading day of the year, but the start of some months may be out by a day or two as it becomes difficult to track all weeks with differing market holidays closures each year and this in turn varies the total amount of actual trading days in each year as well as leap years.
This overlay is designed for the Daily time frame only and will not work on Crypto or any other instrument that trades outside of usual business weekdays. Future updates may include the ability to adapt to Crypto instruments.
All feedback and comments welcome!
Prometheus StochasticThe Stochastic indicator is a popular indicator developed in the 1950s. It is designed to identify overbought and oversold scenarios on different assets. A value above 80 is considered overbought and a value below 20 is considered oversold.
The formula is as follows:
%k = ((Close - Low_i) / (High_i / Low_i)) * 100
Low_i and High_i represent the lowest low and highest high of the selected period.
The Prometheus version takes a slightly different approach:
%k = ((High - Lowest_Close_i) / (High_i / Low_i)) * 100
Using the Current High minus the Lowest Close provides us with a more robust range that can be slightly more sensitive to moves and provide a different perspective.
Code:
stoch_func(src_close, src_high, src_low, length) =>
100 * (src_high - ta.lowest(src_close, length)) / (ta.highest(src_high, length) - ta.lowest(src_low, length))
This is the function that returns our Stochastic indicator.
What period do we use for the calculation? Let Prometheus handle that, we utilize a Sum of Squared Error calculation to find what lookback values can be most useful for a trader. How we do it is we calculate a Simple Moving Average or SMA and the indicator using a lot of different bars back values. Then if there is an event, characterized by the indicator crossing above 80 or below 20, we subtract the close by the SMA and square it. If there is no event we return a big value, we want the error to be as small as possible. Because we loop over every value for bars back, we get the value with the smallest error. We also do this for the smoothing values.
// Function to calculate SSE for a given combination of N, K, and D
sse_calc(_N, _K, _D) =>
SMA = ta.sma(close, _N)
sf = stoch_func(close, high, low, _N)
k = ta.sma(sf, _K)
d = ta.sma(k, _D)
var float error = na
if ta.crossover(d, 80) or ta.crossunder(d, 20)
error := math.pow(close - SMA, 2)
else
error := 999999999999999999999999999999999999999
error
var int best_N = na
var int best_K = na
var int best_D = na
var float min_SSE = na
// Loop through all combinations of N, K, and D
for N in N_range
for K in K_range
for D in D_range
sse = sse_calc(N, K, D)
if (na(min_SSE) or sse < min_SSE)
min_SSE := sse
best_N := N
best_K := K
best_D := D
int N_opt = na
int K_opt = na
int D_opt = na
if c_lkb_bool == false
N_opt := best_N
K_opt := best_K
D_opt := best_D
This is the section where the best lookback values are calculated.
We provide the option to use this self optimizer or to use your own lookback values.
Here is an example on the daily AMEX:SPY chart. The top Stochastic is the value with the SSE calculation, the bottom is with a fixed 14, 1, 3 input values. We see in the candles with boxes where some potential differences and trades may be.
This is another comparison of the SSE functionality and the fixed lookbacks on the NYSE:PLTR 1 day chart.
Differences may be more apparent on lower time frame charts.
We encourage traders to not follow indicators blindly, none are 100% accurate. SSE does not guarantee that the values generated will be the best for a given moment in time. Please comment on any desired updates, all criticism is welcome!
MACD with DPO Strategy by NGExplanation of the MACD with DPO Strategy:
MACD (Moving Average Convergence Divergence):
The MACD is a trend-following indicator that shows the relationship between two moving averages of a price.
In this script:
We calculate the MACD line by subtracting the slow moving average (typically 26-period EMA) from the fast moving average (typically 12-period EMA).
The Signal line is calculated as a 9-period EMA of the MACD line.
The Histogram is the difference between the MACD line and the Signal line, indicating the momentum of the price trend.
Buy Condition: The script generates a buy signal when the MACD histogram crosses from negative to positive (indicating a bullish momentum) and DPO is also positive.
Sell Condition: The script generates a sell signal when the MACD histogram crosses from positive to negative (indicating a bearish momentum) and DPO is also negative.
DPO (Detrended Price Oscillator):
The DPO removes long-term trends from prices, making it easier to identify shorter-term cycles or oscillations.
In this script:
We calculate the DPO by subtracting a shifted simple moving average (SMA) from the close price. The shifting period depends on half the specified period.
We also calculate the DPO SMA as a 30-period EMA of the DPO values.
DPO Color: The DPO line is colored green when the DPO is above zero (indicating upward momentum) and red when it is below zero (indicating downward momentum). The histogram is also colored based on whether the DPO is positive or negative.
Plotting and Alerts:
The script plots the MACD, Signal, and Histogram on the chart.
Additionally, it plots the DPO and its SMA with different colors depending on whether the DPO is above or below zero.
Buy Signal: A green arrow labeled "BUY" is plotted below the bar when both MACD and DPO indicate a bullish condition.
Sell Signal: A red arrow labeled "SELL" is plotted above the bar when both MACD and DPO indicate a bearish condition.
Background colors are used to highlight the chart whenever a buy or sell condition occurs.
The script also includes alerts for both buy and sell signals, allowing users to set notifications when conditions are met.
How to Use:
Identify Buy and Sell Signals:
The script generates a Buy signal when:
The MACD histogram crosses from negative to positive (bullish momentum), and
The DPO is above zero (indicating upward momentum).
The script generates a Sell signal when:
The MACD histogram crosses from positive to negative (bearish momentum), and
The DPO is below zero (indicating downward momentum).
Chart Visualization:
The MACD histogram and Signal line help visualize the momentum and potential trend reversal.
The DPO and DPO SMA help visualize the shorter-term price cycles.
The signals (Buy and Sell) will be plotted on the chart with arrows indicating entry points.
Customization:
You can adjust the MACD and DPO parameters (such as fast_length, slow_length, period_) to fit your trading style or market conditions.
The script can be used in any timeframe depending on your strategy (e.g., intraday trading or longer-term trading).
Example Scenario:
If you're looking for potential buy opportunities, wait for the script to generate a buy signal (green arrow) where the MACD histogram has shifted to positive, and DPO is also in the green (above zero). This signals that both momentum and cycle direction are aligned for a potential upward movement.
Conversely, for sell opportunities, wait for the red arrow where MACD momentum is turning negative and DPO is also negative (below zero), indicating a bearish condition.
This combination of MACD and DPO allows traders to identify stronger and more reliable entry/exit points by confirming the trend with the MACD and detecting shorter-term price cycles with the DPO.
Combo 2/20 EMA & CCI
This is another part of my research work, where I test a combination of two strategies, receiving a combined signal. In order to understand which indicator combinations work better, which work worse, as filters for trades. This is combo strategies for get a cumulative signal.
First strategy
This indicator plots 2/20 exponential moving average. For the Mov Avg X 2/20 Indicator, the EMA bar will be painted when the Alert criteria is met.
Second strategy
The Commodity Channel Index (CCI) is best used with markets that display cyclical or seasonal characteristics, and is formulated to detect the beginning and ending of the cycles by incorporating a moving average together with a divisor that reflects both possible and actual trading ranges. The final index measures the deviation from normal, which indicates major changes in market trend.
Strategy tester settings:
Initial capital: 1000
Order size: 0.5
Commission: 0.1%
Other as default.
Indicator settings:
EMA Length: 50
CCI Length: 10
Fast MA Length: 15
Slow MA Length: 20
Other as default.
WARNING:
- For purpose educate only
- This script to change bars colors.
Next Candle Predictor with Auto HedgingThe "Next Candle Predictor with Auto Hedging" is a Pine Script indicator designed for use on TradingView. It combines predictive analysis and basic hedging techniques to assist traders in making informed decisions. Here's a detailed explanation suitable for public sharing on TradingView:
Overview
This script predicts the closing price of the next candle based on the current candle's open and close prices. It also includes an auto hedging feature that suggests potential hedging levels to mitigate risk based on the predicted price movement. The indicator is particularly useful for traders looking to enhance their trading strategies with predictive analytics.
Key Features
Next Candle Prediction:
The indicator analyzes the current candle's data (open and close prices) to predict whether the next candle will close higher or lower.
If the current candle is bullish (close > open), it predicts a higher close for the next candle. Conversely, if the candle is bearish, it predicts a lower close.
Auto Hedging:
The script calculates a hedging level based on the predicted close price.
If the predicted close indicates a bullish move, the hedge level is set slightly below the predicted close, suggesting where a trader might consider placing a hedge. If the prediction indicates a bearish move, the hedge level is set above the predicted close.
Elliott Wave Analysis:
The script includes a basic implementation of identifying significant price movements, akin to Elliott Wave analysis, by detecting peaks and troughs over a specified number of bars (wave length).
This can help traders identify potential trend reversals or continuations.
How It Works
Input Parameters: Users can customize the waveLength parameter, which determines how many bars back the script looks to identify significant highs and lows.
Peak and Trough Detection: The script identifies the highest high and lowest low within the specified wave length, plotting these points on the chart for visual reference.
Prediction Logic: The predicted close is calculated based on the current candle's behavior, allowing traders to anticipate price movements.
Hedging Level Calculation: The script dynamically calculates a hedging level based on the predicted close, providing a visual cue for potential risk management strategies.
Visual Representation
The indicator plots:
Elliott Wave Highs: Marked in green.
Elliott Wave Lows: Marked in red.
Predicted Close: Shown as a blue step line.
Hedge Level: Displayed as an orange step line.
Benefits
Enhanced Decision-Making: By providing predictions and potential hedging levels, traders can make more informed decisions about entering or exiting positions.
Risk Management: The auto hedging feature helps traders manage risk by suggesting levels where they might place hedges against adverse price movements.
Customizable: The script allows for user-defined parameters, making it adaptable to different trading strategies and market conditions.
Conclusion
The "Next Candle Predictor with Auto Hedging" indicator is a powerful tool for traders seeking to enhance their trading strategies with predictive analytics and risk management techniques. By utilizing this indicator, traders can gain insights into potential price movements and make more informed trading decisions.
Feel free to explore the script, customize it to fit your trading style, and engage with the TradingView community for further insights and improvements!
Related
MMDN-Pin BarThis Pine Script code is designed to highlight Pin Bars on a TradingView chart by changing their color to yellow. A Pin Bar is a type of candlestick pattern that typically indicates a potential reversal in the market. The script uses specific conditions to identify bullish and bearish Pin Bars based on the size of the candlestick body and the length of the shadows (wicks).
1. Calculate Body and Shadows:
body: The absolute difference between the close and open prices.
upshadow: The upper shadow, calculated differently depending on whether the close is higher or lower than the open.
downshadow: The lower shadow, calculated similarly.
2. Define Pin Bar Conditions:
pinbar_h: Identifies a bullish Pin Bar if the previous candle's close is greater than its open, the previous candle's body is larger than the current candle's body, the upper shadow is more than half the size of the body, and the upper shadow is more than twice the size of the body.
pinbar_l: Identifies a bearish Pin Bar with similar conditions but for the lower shadow.
Set Pin Bar Color:
barcolor: Changes the color of the identified Pin Bars to yellow.
FVG Alerts (Vortus)What are Fair Value Gaps (FVGs)?
Fair Value Gaps (FVGs) represent price inefficiencies where buying and selling volumes are imbalanced, creating gaps between the wicks of consecutive candles. These gaps often act as magnets for price, as markets tend to "fill" these gaps before resuming their trend.
FVGs can signal potential entry or exit points, making them a valuable tool for traders looking to exploit these price inefficiencies.
How to Use the Script to Add Alerts:
1. Add the Script to Your Chart:
Load the script into TradingView by pasting it into the Pine Script Editor, then apply it to your chart.
2. Adjust Your Settings:
In the "FVG Settings" section, decide whether you want gaps to be removed after their midpoint or full fill. You can also choose to identify gaps only after a candle has closed, adding a level of confirmation to your strategy.
Customize the colors for Bullish and Bearish FVGs under "Visual Settings" to match your chart's theme.
3. Set Up Your Alerts:
After adding the script to your chart, go to the "Alerts" section in TradingView.
Select either "Bullish FVG Filled" or "Bearish FVG Filled" from the "Condition" dropdown menu.
Configure the alert parameters such as frequency, expiration, and notification method according to your trading strategy.
4. Stay on Top of the Market:
Once set up, the script will automatically notify you when a Fair Value Gap is filled, keeping you informed of potential reversal or continuation opportunities without needing to constantly monitor the charts.
Feedback is Welcome
Auto Fib Retracement [Syafiq.Jr]This TradingView script is an advanced indicator titled "Auto Fib Retracement Neo ." It's designed to automatically plot Fibonacci retracement levels on a price chart, aiding in technical analysis for traders. Here's a breakdown of its functionality:
Core Functionality :
The script identifies pivot points (highs and lows) on a chart and draws Fibonacci retracement lines based on these points. The lines are dynamic, updating in real-time as the market progresses.
Customizable Inputs :
Depth: Determines the minimum number of bars considered in the pivot point calculation.
Deviation: Adjusts the sensitivity of the script in identifying new pivots.
Fibonacci Levels: Allows users to select which retracement levels (236, 382, 500, 618, 786, 886) are displayed on the chart.
Visual Settings: Customization options include the colors and styles of pivot points, trend lines, and the retracement meter.
Pivot and Line Calculation:
The script calculates the deviation between the current price and the last pivot point. If the deviation exceeds a certain threshold, it identifies a new pivot and draws a trend line between the previous pivot and the current one.
Visual Aids :
The indicator provides extensive visual aids, including pivot points marked with circles, dashed trend lines connecting pivots, and labels displaying additional information like price and delta rate.
Performance :
Optimized to handle large datasets, the script is configured to process up to 4000 bars and can manage numerous lines and labels efficiently.
Background and Appearance :
The script allows for customization of the chart background color, enhancing visibility based on user preferences.
In essence, this script is a powerful tool for traders who rely on Fibonacci retracement levels to identify potential support and resistance areas, allowing for a more automated and visually guided approach to market analysis.
Duo Multi-Time Period Charts# Duo Multi-Time Period Charts
## Description
The Duo Multi-Time Period Charts indicator is a versatile tool designed to visualize price action across two different timeframes simultaneously. It overlays color-coded boxes on your chart, representing the price range for each period in both timeframes. This allows traders to easily identify trends, support, and resistance levels across multiple time horizons.
## Key Features
- Displays two user-defined timeframes (default: Daily and Weekly)
- Customizable calculation methods: High/Low Range, True Range, or Heikin Ashi Range
- Color-coded boxes for easy trend identification (bullish/bearish)
- Optional labels showing open and/or close prices
- Fully customizable colors for boxes and labels
## How It Works
1. The indicator creates boxes for each period in both selected timeframes.
2. Box colors change based on whether the close is higher (bullish) or lower (bearish) than the open.
3. Box heights are determined by the selected calculation method:
- High/Low Range: Uses the period's high and low
- True Range: Incorporates the previous close for more volatility representation
- Heikin Ashi Range: Uses a modified candlestick calculation for smoother trends
4. Optional labels display open and/or close prices for each period.
## Use Cases
- Multi-timeframe analysis: Compare short-term and long-term trends at a glance
- Support and resistance identification: Easily spot key levels across different timeframes
- Trend confirmation: Use the color-coding to confirm trend direction and strength
- Volatility assessment: Compare box sizes to gauge relative volatility between timeframes
## Customization
Users can customize various aspects of the indicator, including:
- Timeframes for analysis
- Calculation method for price ranges
- Color schemes for bullish and bearish periods in both timeframes
- Label content and colors
- Visibility options for boxes and labels
## Recommendation
For optimal clarity, it is recommended to enable price labels for only one timeframe. Displaying labels for both timeframes simultaneously may lead to cluttered and difficult-to-read charts, especially on shorter timeframes or when the two selected periods are close in duration.
This indicator is perfect for traders who want to incorporate multi-timeframe analysis into their trading strategy without cluttering their charts with multiple indicators. By following the label recommendation, users can maintain a clean chart while still benefiting from the multi-timeframe insights provided by the indicator.
Harmonic Moving Average Confluence with Cross SignalsHarmonic Moving Average Confluence with Cross Signals
Overview:
The "Harmonic Moving Average Confluence with Cross Signals" is a custom indicator designed to analyze harmonic moving averages and identify confluence zones on a chart. It provides insights into potential trading opportunities through cross signals and confluence detection.
Features:
Harmonic Moving Averages (HMAs):
38.2% HMA
50% HMA
61.8% HMA
These HMAs are calculated based on a base period and plotted on the chart to identify key support and resistance levels.
Cross Detection:
Buy Signal: Triggered when the 38.2% HMA crosses above the 50% HMA.
Sell Signal: Triggered when the 38.2% HMA crosses below the 50% HMA.
Buy signals are marked with green triangles below the candles.
Sell signals are marked with red triangles above the candles.
Confluence Detection:
Confluence zones are identified where two or more HMAs are within a specified percentage difference from each other.
Confluence Strength: Default minimum strength is set to 3.
Threshold Percentage: Default is set to 0.0002%.
Confluence zones are marked with blue circles on the chart, with 80% opacity.
Default Settings:
Base Period: 50
Minimum Confluence Strength: 3
Confluence Threshold: 0.0002%
Confluence Circles Opacity: 80%
How to Use It:
Setup:
Add the indicator to your trading chart.
The indicator will automatically calculate and plot the harmonic moving averages and detect cross signals and confluence zones based on the default settings.
Interpreting Signals:
Buy Signal: Look for green triangles below the candles indicating a potential buying opportunity when the 38.2% HMA crosses above the 50% HMA.
Sell Signal: Look for red triangles above the candles indicating a potential selling opportunity when the 38.2% HMA crosses below the 50% HMA.
Confluence Zones: Blue circles represent areas where two or more HMAs are within the specified threshold percentage, indicating potential trading zones.
Adjusting Parameters:
Base Period: Adjust to change the period of the moving averages if needed.
Minimum Confluence Strength: Set to control how many confluence zones need to be present to display a circle.
Threshold Percentage: Set to adjust the sensitivity of confluence detection.
Usage Tips:
Use the signals in conjunction with other technical analysis tools to enhance your trading strategy.
Monitor confluence zones for possible high-interest trading opportunities.
I hope this version aligns better with your needs. If there's anything specific you'd like to adjust or add, just let me know!
Simple SessionsThis is a simple sessions indicator that allows you to highlight up to 3 different sessions on your chart. This is intended for charts in any timeframe lower than the Daily timeframe. Really simple, clean, and minimalistic on purpose, intended to help and not clutter the chart.
Options/parameters:
Sessions: Check and setup beginning and end of the sessions. Up to 3 sessions at the same time.
Enable specific timezone: You can specify your exact timezone so that the sessions stay consistent even when you’re viewing different assets from different brokers that might be providing the price data in different timezones.
Show next day: Check to allow for your sessions to be viewed in advance for the following day so that you can expect your trading session in the chart (something simple, but quite useful).
Show next day input also accepts an integer value (default at 0). This numeric value is useful only for a few different assets that don’t have price data (aren’t tradable) 24 hours of each week-day. When that’s the case the calculation to show the session in the future day is not precise so with this number you can adjust it. For example, on OANDA:SPX500USD in the 30m time-frame, between 5pm and 6pm NY time there’s no price data. If you check that chart on any day at 4:30pm NY time, the next bar should be at 5pm, however since there’s no data it jumps to 6pm NY time. For that example you can set the input number to -2 and it will move the sessions to the correct time window you specified in the Sessions input.
Optional comment: This is a comment that will be shown in the status line. There’s no other use for this. It’s only helpful when you have multiple instances of the indicator for different assets for example. In that case with this comment you would be able to instantly detect which indicator is for which chart.
Prometheus Volatility StopThe Prometheus Volatility Stop is an indicator designed to give you a moving risk metric along with a custom Moving Average cross. After a calculation of the annualized volatility for the specified lookback period we determine bullish or bearish from the moving averages and plot the Volatility Stop accordingly.
User Input:
A user can select from Hull Moving Average, Exponential Moving average, Simple Moving Average, the Moving Average used in RSI, and Weighted Moving Average. The default is Hull Moving Average and Exponential Moving average.
A user can also specify the lookback period. The default is 30.
A user may also turn off the plots for the Moving Averages.
The reason for this approach is to be more original from the traditional Volatility Stop.
Calculation:
The Historical Volatility is calculated by taking the standard deviation of the log returns for the specified period and then annualizing it.
hv = ta.stdev(math.log(close / close ), lkb) * math.sqrt(252/5)
Then the Volatility Stop is calculated as follows:
recent_max = ta.highest(close, lkb)
recent_min = ta.lowest(close, lkb)
hv_stop = ma_2 > ma_1 ? recent_max + hv : recent_min - hv
When the second selected moving average is greater than the first, which signals bearishness, the historical volatility gets added to the high of that period. When the moving averages signal bullish the historical volatility gets subtracted from the low of that period.
Here is an example on NASDAQ:ARM :
After the first crossover, bullish signal, price runs for some time. As we get higher and higher so does the Volatility Stop. At the highs before a bearish crossover the price hits and closes at the Volatility Stop. Providing what could be an exit from a strong run up.
Intra-day example on NASDAQ:QQQ :
We see that in the early bearish move price goes on to hit the Volatility Stop before the trend switches.
We also see that in the failed long. The price action throughout the rest of the day, while not providing in profit stop outs, do provide fine directional alerts.
All those examples have been done with the default settings. Upon changing Moving Average One to a WMA and Moving Average Two to an SMA, as well as the lookback to 75. We see this quickly can become a simple trend follower.
This is the perspective we aim to provide. We encourage traders to not follow indicators blindly. No indicator is 100% accurate. This one can give you a different perspective of price strength with volatility. We encourage any comments about desired updates or criticism!
Helacator Ai ThetaHelacator Ai Theta is a state-of-the-art advanced script. It helps the trader find the possibility of a trend reversal in the market. By finding that point at which the three black crows pattern combines with the three white soldiers pattern, it is the most cherished pattern in technical analysis for its signal of strong bullish or bearish momentum. Therefore, it is a very strong predictive tool in the ability of shifting markets.
Key Highlights: Three White Soldiers and Three Black Crows Patterns
The script identifies these candlestick formations that consist of three consecutive candles, either bullish (Three White Soldiers) or bearish (Three Black Crows). These patterns help the trader identify possible trend reversal points as they provide an early signal of a change in the market direction. It is with great care that the script is written to evaluate the position and relationship between the candlesticks for maintaining the accuracy of pattern recognition. Moving Averages for Trend Filtering:
Two important ones used are moving averages for filtering any signals not in accordance with the general trend. The length of these MAs is variable, allowing the traders to be in a position to adapt the script for use under different market conditions. The moving averages ensure that signals are only taken in the direction that supports the general market flow, so it leads to more reliability within the signals. The MAs are not plotted on the chart for the sake of clarity, but they still perform a crucial function in signal filtering and can be displayed optionally for a more detailed investigation. Cooldown filter to reduce over-trading
This is part of what is implemented in the script to prevent generation of consecutive signals too quickly. All this helps to reduce market noise and not overtrade—only when market conditions are at their best. The cooldown period can be set to be adjusted according to the trader's preference, making the script more versatile in its use. Practical Considerations: Educational Purpose: This script is for educational purposes only and should be part of a comprehensive trading approach. Proper risk management techniques should be observed while at the same time taking into consideration prevailing market conditions before making any trading decision.
No Guaranteed Results: The script is aimed at bringing signal accuracy into improvement to align with the broader market trend and reducing noise, but past performance cannot guarantee future success. Traders should use this script within their broad trading approach. Clean and Simple Chart Display: The primary goal of this script is to have a clear and simple display on the chart. The signals are prominently marked with "BUY" and "SELL," and the color of the bars has changed according to the last signal, thus traders can easily read the output. Community and Open Source Open Source Contribution: This script is open for contribution by the TradingView community. Any suggestions regarding improvements are highly welcomed. Candlestick patterns, moving averages, and the combination of the cooldown filter are presented in such a way as to give traders something special, and any modifications or extra touch by the community is appreciated. Attribution and Transparency: The script is based on standard technical analysis principles and for all parts inspired by or derivated from other available open-source scripts, credit is given where it is due. In this way, transparency ensures that the script adheres to TradingView's standards and promotes a collaborative community environment.
D-Shape Breakout Signals [LuxAlgo]The D-Shape Breakout Signals indicator uses a unique and novel technique to provide support/resistance curves, a trailing stop loss line, and visual breakout signals from semi-circular shapes.
🔶 USAGE
D-shape is a new concept where the distance between two Swing points is used to create a semi-circle/arc, where the width is expressed as a user-defined percentage of the radius. The resulting arc can be used as a potential support/resistance as well as a source of breakouts.
Users can adjust this percentage (width of the D-shape) in the settings ( "D-Width" ), which will influence breakouts and the Stop-Loss line.
🔹 Breakouts of D-Shape
The arc of this D-shape is used for detecting breakout signals between the price and the curve. Only one breakout per D-shape can occur.
A breakout is highlighted with a colored dot, signifying its location, with a green dot being used when the top part of the arc is exceeded, and red when the bottom part of the arc is surpassed.
When the price reaches the right side of the arc without breaking the arc top/bottom, a blue-colored dot is highlighted, signaling a "Neutral Breakout".
🔹 Trailing Stop-Loss Line
The script includes a Trailing Stop-Loss line (TSL), which is only updated when a breakout of the D-Shape occurs. The TSL will return the midline of the D-Shape subject to a breakout.
The TSL can be used as a stop-loss or entry-level but can also act as a potential support/resistance level or trend visualization.
🔶 DETAILS
A D-shape will initially be colored green when a Swing Low is followed by a Swing High, and red when a Swing Low is followed by a Swing High.
A breakout of the upper side of the D-shape will always update the color to green or to red when the breakout occurs in the lower part. A Neutral Breakout will result in a blue-colored D-shape. The transparency is lowered in the event of a breakout.
In the event of a D-shape breakout, the shape will be removed when the total number of visible D-Shapes exceeds the user set "Minimum Patterns" setting. Any D-shape whose boundaries have not been exceeded (and therefore still active) will remain visible.
🔹 Trailing Stop-Loss Line
Only when a breakout occurs will the midline of the D-shape closest to the closing price potentially become the new Trailing Stop value.
The script will only consider middle lines below the closing price on an upward breakout or middle lines above the closing price when it concerns a downward breakout.
In an uptrend, with an already available green TSL, the potential new Stop-Loss value must be higher than the previous TSL value; while in a downtrend, the new TSL value must be lower.
The Stop-Loss line won't be updated when a "Neutral Breakout" occurs.
🔶 SETTINGS
Swing Length: Period used for the swing detection, with higher values returning longer-term Swing Levels.
🔹 D-Patterns
Minimum Patterns: Minimum amount of visible D-Shape patterns.
D-Width: Width of the D-Shape as a percentage of the distance between both Swing Points.
Included Swings: Include "Swing High" (followed by a Swing Low), "Swing Low" (followed by a Swing High), or "Both"
Style Historical Patterns: Show the "Arc", "Midline" or "Both" of historical patterns.
🔹 Style
Label Size/Colors
Connecting Swing Level: Shows a line connecting the first Swing Point.
Color Fill: colorfill of Trailing Stop-Loss
VS (Vegas Fractal System)VS is a trading system based on the identification of fractal reaction zones within a larger, carefully identified movement. It is internally made up of 4 sub-systems.
The indicator is composed of the following parameters: Max and Min, are the largest area identified and will act as the STOPLOSS point. L1, is the price reaction level. Entry, is where to place a pending market entry order. TP, is the place to place a 100% sell order.
A valid area must be identified through the Fibonacci levels that join Highs and Lows or vice versa depending on the bullish or bearish movement. To be usable, this movement must not have a sub-movement that has already hit the 0.618 level.
Always manage Risk and Money Management in an adequate, technical and sustainable manner in relation to your capital. A fair exposure per transaction is between 1% and 2% of the capital.