First Candle Marker[fitfatq]Description
This script is designed to mark the first candle of each trading day on the chart. It provides both a label and a vertical line as options to visually highlight the first candle.
Key Features
Label Settings:
Show Label: Option to display a label above the first candle of the day.
Label Text: Customizable text for the label.
Label Color: Customizable color for the label.
Label Text Color: Customizable text color for the label.
Label Transparency: Customizable transparency for the label.
Vertical Line Settings:
Show Vertical Line: Option to display a vertical line at the first candle of the day.
Vertical Line Color: Customizable color for the vertical line.
Vertical Transparency: Customizable transparency for the vertical line.
Vertical Width: Customizable width for the vertical line.
How It Works
The script identifies the first candle of each trading day by comparing the day of the week of the current bar with the previous bar.
If the current bar is the first candle of the day, it draws a label above the candle and/or a vertical line through the candle based on user settings.
Usage
This script is useful for traders who want to quickly identify the first candle of each trading day. It helps in recognizing patterns and significant price movements that occur at the start of the trading day.
Cycles
Prometheus Polarized Fractal Efficiency (PFE)This indicator uses market data to calculate Polarized Fractal Efficiency (PFE) on an asset, so traders can have a better idea of which direction it may go.
Users can control the lookback length for the fractal calculation, the lookback length for the Exponential Moving Average (EMA), and whether or not to display lines at the -50 and 50 level, or -25 and 25 level.
Polarized Fractal Efficiency:
The Polarized Fractal Efficiency (PFE) indicator is a value between -100 and 100 with 0 as a midpoint.
A PFE above 0 indicates the asset may trend higher, a PFE below 0 indicates the asset may trend lower.
There are many ways to trade with PFE, the intuitive trend riding as described above, or reversals.
Even when the PFE is above 0, if it gets high enough, it may also be an indication of a reversal. A PFE of 90 - 100, or -100 - -90, may indicate price is ready to revert the other direction. Furthermore, traders already in a position may look to breaks of other levels to be their take profit or stop out spot.
Calculation:
Pi = 100 x (Price - Price )2 + N2 / Summation, j= 0, to N-2 (Price - Price )2 + 1
If Close < Close Pi = -Pi
PFEi = EMA(Pi, M)
Where:
N = period of indicator
M = smoothing period
Citation: www.investopedia.com
Scenarios:
Inputs are (9, 5) and every display option is on.
Trend example
Step 1: A short trade appears as PFE crosses below -25. We reach a safe take profit as PFE crosses below -50. Traders can use these levels to exit as well as enter.
Step 2: On the cross above 25 there is a safe long. As the PFE value breaks 0 a safe, early take profit could be appropriate for this trade. No guarantee we would see 50.
Step 3: Long scenario at break of 25, straight to 50. Simple, straightforward setup.
Step 4: This long results in a stop loss. Once again entry as PFE crosses 25, but as we cross the 0 line it is for a loss.
Step 5: The last trade in this example is reminiscent of step 3. This is a short trade entry at break of 25 and exit at break of 50.
Traders have liberty to use the PFE value to determine spots to enter and exit trades, long or short. 25 and 50 were chosen arbitrarily, values like 10 and 60 may work as well, we encourage traders to use their own discretion along with tools.
Reversal example
Step 1: PFE is around -100, crossing below it at one point! Strong zone for a potential reversal.
Step 2: PFE crosses above 25 adding conviction.
Step 3: Option to exit at 70.
Step 4: Option to exit at 90.
There is no “one size fits all method”, this approach may be more intuitive for some users and is just as feasible as the first.
Longer trend example
Step 1: Using -50 and 50 this time instead of -25 and 25 to be safer on our entries we see a short here. Was a good entry and as the value gets closer to -70 we can safely close.
Step 2: On this candle we see a long for the break of 50. On the next candle we break the 0 line, but because of our safe entry at 50, we could hold this and only stop out at a break of -25. We get close but stay in it and close at 70.
Step 3: Break of 50 for a long once again. This time the break of 0 line occurs as we are in profit, not letting a green trade go red is a golden rule of trading, so an early exit here.
Step 4: Same at step 2, break of 50 to long and stay in it, not stopping out at break of 0 line. The PFE value eventually reaches 70 and there is a good exit.
Quicker Reversal example
Step 1: Notice a close with PFE below -90, enter long for the reversal. Then close for profit when the PFE crosses above 70.
Step 2: When the PFE breaks above 90 we have a short entry. Like the long closing it when it crosses below -70.
Step 3: This step is the same setup as step 2. As PFE breaks above 90 we have a short entry. Closing it when it crosses below -70.
Recap:
Described above are 4 different examples with many different trades. Both trend and reversal trades. The PFE value is an indicator that can be used by traders in many different ways and Prometheus encourages traders to use their own discretion along with tools and not follow indicators blindly.
Options:
Users can control the input for the lookback of the indicator. The default is 9.
The smoothing factor for the EMA is also changeable, default is 5.
Users have options to display lines at -50, -25, 25, and 50.
New day started with DSTNew Day Started with DST Indicator
Description:
The "New Day Started with DST" indicator is designed for intraday charts and highlights the first bar of each new trading day, accounting for Germany's timezone and daylight saving time (DST) adjustments. This is particularly useful for traders who follow the German market or need precise day start indications based on Central European Time (CET) and Central European Summer Time (CEST).
Features:
- Timezone Adjustment: Automatically adjusts the time to CET (UTC+1) during standard time and CEST (UTC+2) during daylight saving time.
- Daylight Saving Time (DST) Handling: Correctly identifies the start and end of DST based on the last Sunday in March and October.
- New Day Highlight: Highlights the first bar of each new day, allowing traders to easily identify the start of a new trading day.
How It Works:
- Timezone Calculation: The script calculates the current time in Germany by adding the appropriate timezone offset to the UTC time.
- DST Rules: The script manually checks the conditions to determine if the current date falls within the DST period.
- New Day Detection: By checking the hour and minute of the corrected German time, the script determines if a new day has started and highlights the first bar accordingly.
Benefits:
- Enhanced Accuracy: Ensures that the start of a new day is accurately reflected according to German trading hours, considering both CET and CEST.
- Visual Aid: Provides a clear visual indication of the start of a new trading day, improving chart readability and trading precision.
- Customizable: Can be easily modified to adjust for other timezones and DST rules if needed.
Usage:
Apply this indicator to your intraday charts to automatically highlight the first bar of each new trading day, taking into account the timezone and DST adjustments for Germany. This tool is essential for traders operating in or tracking the German market, offering a reliable and precise method to monitor daily trading activity.
Example:
! (URL-to-your-screenshot)
This indicator ensures that you never miss the start of a new trading day, helping you to make timely and informed trading decisions.
---
How the Script Works:
1. Timezone Offset Calculation:
- The script begins by setting the base offset to 1 hour (CET is UTC+1).
- It initializes the DST offset to 0.
2. Determining the Current Month and Day:
- It retrieves the current month and day of the month from the `time` variable.
3. Checking DST Conditions:
- For months between April and September (inclusive), the DST offset is set to 1 hour (CEST is UTC+2).
- For March, it checks if the current date is after the last Sunday of March and if the time is past 2:00 AM to determine if DST should start.
- For October, it checks if the current date is before the last Sunday of October and if the time is before 2:00 AM to determine if DST should end.
4. Adjusting the Time for Germany:
- The script calculates the corrected German time by adding the base offset and DST offset to the UTC time.
5. Detecting the Start of a New Day:
- It checks if the hour and minute of the corrected German time are both zero (00:00), indicating the start of a new day.
6. Highlighting the First Bar:
- If the script detects a new day, it highlights the first bar of the new day with a green background color.
This approach ensures that the script accurately reflects the start of a new trading day according to German trading hours, including adjustments for daylight saving time.
Daye's Quarterly TheoryDaye's Quarterly Theory Indicator
Description
The Daye's Quarterly Theory Indicator divides trading time into smaller units to help traders identify potential accumulation, manipulation, distribution, and reversal/continuation phases within a day. It applies these time divisions to your charts, offering visual guidance aligned with ICT's PO3 concept:
Accumulation (A): The phase where positions are accumulated.
Manipulation (M): The phase where the market moves against the prevailing trend to trap traders.
Distribution (D): The phase where accumulated positions are distributed.
Reversal/Continuation (X): The phase indicating either a reversal or continuation of the trend.
This indicator breaks down time into quarters at different levels:
Daily Quarters:
Q1: 18:00 - 00:00 (Asia)
Q2: 00:00 - 06:00 (London)
Q3: 06:00 - 12:00 (NY AM)
Q4: 12:00 - 18:00 (NY PM)
90-Minute Quarters:
Q1: 18:00 - 19:30
Q2: 19:30 - 21:00
Q3: 21:00 - 22:30
Q4: 22:30 - 00:00
Micro Quarters (22.5 minutes) (Displayed on 7-minute TF or lower):
Q1: 18:00 - 18:22:30
Q2: 18:22:30 - 18:45
Q3: 18:45 - 19:07:30
Q4: 19:07:30 - 19:30
Features
Time Box Visualization: Highlights different quarters of the trading day to help visualize market phases.
Customizable Colors: Allows users to set different colors for daily, 90-minute, and micro quarters.
Flexible Settings: Designed to work out-of-the-box on both light and dark background charts.
ICT PO3 Alignment: Helps traders align their strategies with ICT's Accumulation, Manipulation, Distribution, and Reversal/Continuation phases.
Usage
Apply this indicator to your NQ1! or ES1! charts and observe the confluence with ICT's macro times. Use it to predict potential market phases and optimize your trading strategy by buying after manipulation down or selling after manipulation up.
Note: The indicator's display may vary based on the timeframe viewed and broker feeds. Back-test and research for best results on your preferred assets.
Strong Support and Resistance with EMAs @viniciushadek
### Strategy for Using Continuity Points with 20 and 9 Period Exponential Moving Averages, and Support and Resistance
This strategy involves using two exponential moving averages (EMA) - one with a 20-period and another with a 9-period - along with identifying support and resistance levels on the chart. Combining these tools can help determine trend continuation points and potential entry and exit points in market operations.
### 1. Setting Up the Exponential Moving Averages
- **20-Period EMA**: This moving average provides a medium-term trend view. It helps smooth out price fluctuations and identify the overall market direction.
- **9-Period EMA**: This moving average is more sensitive and reacts more quickly to price changes, providing short-term signals.
### 2. Identifying Support and Resistance
- **Support**: Price levels where demand is strong enough to prevent the price from falling further. These levels are identified based on previous lows.
- **Resistance**: Price levels where supply is strong enough to prevent the price from rising further. These levels are identified based on previous highs.
### 3. Continuity Points
The strategy focuses on identifying trend continuation points using the interaction between the EMAs and the support and resistance levels.
### 4. Buy Signals
- When the 9-period EMA crosses above the 20-period EMA.
- Confirm the entry if the price is near a support level or breaking through a resistance level.
### 5. Sell Signals
- When the 9-period EMA crosses below the 20-period EMA.
- Confirm the exit if the price is near a resistance level or breaking through a support level.
### 6. Risk Management
- Use appropriate stops below identified supports for buy operations.
- Use appropriate stops above identified resistances for sell operations.
### 7. Validating the Trend
- Check if the trend is validated by other technical indicators, such as the Relative Strength Index (RSI) or Volume.
### Conclusion
This strategy uses the combination of exponential moving averages and support and resistance levels to identify continuity points in the market trend. It is crucial to confirm the signals with other technical analysis tools and maintain proper risk management to maximize results and minimize losses.
Implementing this approach can provide a clearer view of market movements and help make more informed trading decisions.
Prometheus Analytics Hurst ExponentThis indicator uses market data to calculate the Hurst Exponent so traders can have knowledge of the long memory of the asset.
Users can control the lookback length for the H value (Hurst Exponent), lookback length for the SMA (Simple Moving Average) of the Hurst Exponent, to show either, and what to calculate the H value and SMA on.
Hurst Exponent:
The Hurst Exponent is a value between 0 and 1 with 0.5 as a midline.
An H value(Hurst Exponent) above 0.5 indicates a trending market, and a market that should have larger, longer moves.
An H value below 0.5 indicates a mean reverting market, and a market that should have smaller, shorter moves.
An H value of0.5 indicates a random walk. This would mean the price would follow a Brownian Motion model and future prices would be independent from past prices.
Just because the H value is above 0.5 does not indicate that there should be an UP trend, just as a value below 0.5 does not indicate a DOWN trend. It indicates that there should be a trend, up or down.
Scenarios:
An intuitive way to use the Hurst Exponent is as an asset is trending in whatever direction, as the H value crosses below 0.5 it indicates a reversal. It indicates that what was happening before isn’t impacting what is happening now as much.
Steps explained from picture:
Step 1: Strong uptrend is identified with the asset moving up aggressively with H above 0.5.
Step 2: The H value crosses below 0.5 and prices stay elevated.
Step 3: Price reverts back down as the H value stays below 0.5
Just because the H value is above 0.5 doesn’t mean the asset has to be uptrending. In this example we see the asset fall as the H value is above 0.5. Not only that, but every time it crosses below 0.5, the asset takes a breather on the way down
Step 1: As the H value crosses above 0.5, we can expect trends to appear in the asset.
Step 2: After the trend switches to down, we only see a breather and some chop after the H value crosses back below 0.5.
Step 3: Once The H value crosses back over we see the downtrend continue and new lows be made.
Step 4: We see it once again, simply the area of chop is bigger. We don’t see a higher high, breaking the overall downtrend, but once the H value crosses over again the downturn continues and we see a lower low.
It may occur when no strong trend is made in either direction. The H value above 0.5 does indeed sometimes correlate with an uptrend sometimes.
Step 1: After the strong downtrend we see a break below 0.5 with some consolidation.
Step 2: No clear big move on the asset or H value.
Step 3: H value above 0.5 leads to a break of highs and a new uptrend.
Users have the option to decide what to calculate the H value on. Close is the default, or dollar return per bar are the options. Dollar return per bar and offer an H value that may give a better indication of when price moves will be small and sporadic.
Using dollar move per bar.
Step 1: H value cross above 0.5, we see large candles and fast moves.
Step 2: H value crosses below 0.5, the candles immediately following are shorter. The big red candles come right before the cross back above.
Step 3: H value cross back above 0.5, after some chop, large move down.
Similar story
Step 1: H value above 0.5, big trends either direction
Step 2: After the H value crosses below, the moves are short and choppy.
Settings:
Options to show or remove either the H value or it’s SMA.
Options to adjust the period uses, default is (32, 16)
Master Accumulation Weekly Buy SignalsMaster Accumulation Weekly Buy Signals
The Master Accumulation Weekly Buy Signals indicator is designed to help traders identify potential buy opportunities based on the accumulation and distribution of volume, with a primary focus on weekly timeframes. This indicator combines the On Balance Volume (OBV) and the Accumulation/Distribution (AD) indicators to generate buy signals when both metrics show a decline.
Key Features:
Percentage Change Calculation: Calculates the percentage change in OBV and AD over a specified length tailored to weekly timeframes.
Timeframe Adaptability: While optimized for weekly timeframes, the indicator can also adjust to daily and monthly charts.
Volume Validation: Ensures that volume data is available and valid for accurate calculations.
Buy Signals: Generates buy signals when both OBV and AD percentage changes are negative, indicating potential accumulation by informed traders.
Visual Alerts: Plots buy signal triangles below the price bars on the main chart for easy identification.
How It Works:
On Balance Volume (OBV): Tracks the cumulative volume, considering the direction of price changes, and calculates the percentage change over the specified period, primarily for weekly analysis.
Accumulation/Distribution (AD): Measures the flow of volume into or out of a security, considering the relationship between the closing price and the high-low range, and calculates the percentage change over the specified period, primarily for weekly analysis.
Buy Signal Generation: A buy signal is generated when both OBV and AD show a negative percentage change, suggesting a potential buying opportunity.
How to Use:
Apply the indicator to your chart and select the weekly timeframe for optimal performance.
Look for buy signal triangles that appear below the price bars on the main chart.
Use the buy signals as part of your broader trading strategy, confirming them with other technical analysis tools and indicators.
Important Note:
This indicator is a tool to assist in identifying potential buy signals based on volume accumulation patterns. It is primarily designed for weekly timeframes and should not be used as a standalone trading strategy. Always perform comprehensive analysis and consider risk management practices before making any trading decisions.
This description highlights the indicator's primary focus on weekly timeframes while providing comprehensive information about its features and usage.
THIS IS TEST ONLY*******
Rolling Correlation with Bitcoin V1.1 [ADRIDEM]Overview
The Rolling Correlation with Bitcoin script is designed to offer a comprehensive view of the correlation between the selected ticker and Bitcoin. This script helps investors understand the relationship between the performance of the current ticker and Bitcoin over a rolling period, providing insights into their interconnected behavior. Below is a detailed presentation of the script and its unique features.
Unique Features of the New Script
Bitcoin Comparison : Allows users to compare the correlation of the current ticker with Bitcoin, providing an analysis of their relationship.
Customizable Rolling Window : Enables users to set the length for the rolling window, adapting to different market conditions and timeframes. The default value is 252 bars, which approximates one year of trading days, but it can be adjusted as needed.
Smoothing Option : Includes an option to apply a smoothing simple moving average (SMA) to the correlation coefficient, helping to reduce noise and highlight trends. The smoothing length is customizable, with a default value of 4 bars.
Visual Indicators : Plots the smoothed correlation coefficient between the current ticker and Bitcoin, with distinct colors for easy interpretation. Additionally, horizontal lines help identify key levels of correlation.
Dynamic Background Color : Adds dynamic background colors to highlight areas of strong positive and negative correlations, enhancing visual clarity.
Originality and Usefulness
This script uniquely combines the analysis of rolling correlation for a current ticker with Bitcoin, providing a comparative view of their relationship. The inclusion of a customizable rolling window and smoothing option enhances its adaptability and usefulness in various market conditions.
Signal Description
The script includes several features that highlight potential insights into the correlation between the assets:
Rolling Correlation with Bitcoin : Plotted as a red line, this represents the smoothed rolling correlation coefficient between the current ticker and Bitcoin.
Horizontal Lines and Background Color : Lines at -0.5, 0, and 0.5 help to quickly identify regions of strong negative, weak, and strong positive correlations.
These features assist in identifying the strength and direction of the relationship between the current ticker and Bitcoin.
Detailed Description
Input Variables
Length for Rolling Window (`length`) : Defines the range for calculating the rolling correlation coefficient. Default is 252.
Smoothing Length (`smoothing_length`) : The number of periods for the smoothing SMA. Default is 4.
Bitcoin Ticker (`bitcoin_ticker`) : The ticker symbol for Bitcoin. Default is "BINANCE:BTCUSDT".
Functionality
Correlation Calculation : The script calculates the daily returns for both Bitcoin and the current ticker and computes their rolling correlation coefficient.
```pine
bitcoin_close = request.security(bitcoin_ticker, timeframe.period, close)
bitcoin_dailyReturn = ta.change(bitcoin_close) / bitcoin_close
current_dailyReturn = ta.change(close) / close
rolling_correlation = ta.correlation(current_dailyReturn, bitcoin_dailyReturn, length)
```
Smoothing : A simple moving average is applied to the rolling correlation coefficient to smooth the data.
```pine
smoothed_correlation = ta.sma(rolling_correlation, smoothing_length)
```
Plotting : The script plots the smoothed rolling correlation coefficient and includes horizontal lines for key levels.
```pine
plot(smoothed_correlation, title="Rolling Correlation with Bitcoin", color=color.rgb(255, 82, 82, 50), linewidth=2)
h_neg1 = hline(-1, "-1 Line", color=color.gray)
h_neg05 = hline(-0.5, "-0.5 Line", color=color.red)
h0 = hline(0, "Zero Line", color=color.gray)
h_pos05 = hline(0.5, "0.5 Line", color=color.green)
h1 = hline(1, "1 Line", color=color.gray)
fill(h_neg1, h_neg05, color=color.rgb(255, 0, 0, 90), title="Strong Negative Correlation Background")
fill(h_neg05, h0, color=color.rgb(255, 165, 0, 90), title="Weak Negative Correlation Background")
fill(h0, h_pos05, color=color.rgb(255, 255, 0, 90), title="Weak Positive Correlation Background")
fill(h_pos05, h1, color=color.rgb(0, 255, 0, 90), title="Strong Positive Correlation Background")
```
How to Use
Configuring Inputs : Adjust the rolling window length and smoothing length as needed. Ensure the Bitcoin ticker is set to the desired asset for comparison.
Interpreting the Indicator : Use the plotted correlation coefficient and horizontal lines to assess the strength and direction of the relationship between the current ticker and Bitcoin.
Signal Confirmation : Look for periods of strong positive or negative correlation to identify potential co-movements or divergences. The background colors help to highlight these key levels.
This script provides a detailed comparative view of the correlation between the current ticker and Bitcoin, aiding in more informed decision-making by highlighting the strength and direction of their relationship.
Sessions [UkutaLabs]█ OVERVIEW
Sessions is a trading toolkit that displays the different trading sessions on your chart during a trading day. By default, Sessions displays the four standard trading sessions; New York, Tokyo, London, and Sydney.
Each of the four sessions can be toggled, and the Sessions indicator is completely customizable, allowing users to define their own sessions to be generated by the script.
The aim of this script is to improve the trading experience of users by automatically displaying information about each default or custom session to the user.
█ USAGE
This script will automatically detect and label different market sessions. By default, the script will identify the four standard trading sessions, but each of these can be toggled off in the settings.
However, users are not limited to these four trading sessions and have the ability to define their own sessions to be identified by the script. When a session begins, the script will automatically start outlining the market data of that session, including the high and low of the period that is represented by the session.
If the market is within two or more sessions at the same time, then each session will be treated individually and will overlap with each other.
The sessions will be identified as a colored box surrounding the market data of the period that it represents, and a label will be displayed above the box to identify the session that it represents. The label, color and period of each session is completely customizable.
The user can also adjust all sessions at once to account for timezones in the settings.
█ SETTINGS
Session 1
• Session 1: Determines whether or not this session will be drawn by the script.
• A string field to determine the name of the session that will be displayed above the session range.
• Two time fields representing the start and finish of the session.
• A color field to determine the color of the range and label.
Session 2
• Session 2: Determines whether or not this session will be drawn by the script.
• A string field to determine the name of the session that will be displayed above the session range.
• Two time fields representing the start and finish of the session.
• A color field to determine the color of the range and label.
Session 3
• Session 3: Determines whether or not this session will be drawn by the script.
• A string field to determine the name of the session that will be displayed above the session range.
• Two time fields representing the start and finish of the session.
• A color field to determine the color of the range and label.
Session 4
• Session 4: Determines whether or not this session will be drawn by the script.
• A string field to determine the name of the session that will be displayed above the session range.
• Two time fields representing the start and finish of the session.
• A color field to determine the color of the range and label.
Time Zones
• UTC +/-: Determines the offset of each session. Enter - before the number to represent a negative offset.
High Probability OS/OB {DCAquant}DCAquant - High Probability OS/OB
The DCAquant - High Probability OS/OB Pine Script is a sophisticated indicator that provides insights into overbought (OB) and oversold (OS) conditions based on Hull Moving Averages (HMA) and Volume Weighted Moving Averages (VWMA). Here's a detailed breakdown of its functionality:
-------------------------------------------------------------------------------------
THIS INDICATOR IS ONLY WRITTEN FOR BTC, ETH and TOTAL!!!!!!!!!!!!!
-------------------------------------------------------------------------------------
Functionality
The script identifies high-probability OB and OS zones by combining multiple moving averages (MAs).
1. Volume Weighted Moving Average (VWMA)
The VWMA function computes the VWMA over a specified length, incorporating both the price and volume.
2. Hull Moving Average with Volume Weight (HMA-VW)
The hullma_vw function calculates the HMA using the VWMA. This involves:
Computing VWMAs over the full length and half-length.
Using these VWMAs to derive the HMA-VW through a weighted approach.
5. Standard Hull Moving Average (HMA)
The hull function computes the HMA using the standard weighted moving average (WMA).
4. Smoothed HMA-VW
This is an Exponential Moving Average (EMA) of the HMA-VW to smooth out short-term fluctuations.
How this works
First, the distance between the 2 MA's is calculated.
The distance is scored against the average price of the last 100 days.
By getting this score we can calculate extremes
The Extremes are categorized into 4 levels. The transparency of the background color distinguishes these 4 levels.
Only the MOST extremes are plotted ON THE CHART. Within the indicator, all 4 levels are plotted.
Usage
Extreme Buy zone: Consider entering the market when the indicator shows deep negative values (oversold). These are highlighted with a cyan background, with increasing opacity indicating stronger buy signals (Level 4 Zones).
Extreme Sell Zone: Consider exiting the market when the indicator shows high positive values (overbought). These are highlighted with a magenta background, with increasing opacity indicating stronger sell signals (Level 4 Zones).
Disclaimer
This indicator should not be used in isolation. It is recommended to use this as part of a systematic approach, incorporating other tools and analysis methods to confirm signals and make well-informed trading decisions.
Persistent Homology Based Trend Strength OscillatorPersistent Homology Based Trend Strength Oscillator
The Persistent Homology Based Trend Strength Oscillator is a unique and powerful tool designed to measure the persistence of market trends over a specified rolling window. By applying the principles of persistent homology, this indicator provides traders with valuable insights into the strength and stability of uptrends and downtrends, helping to inform better trading decisions.
What Makes This Indicator Original?
This indicator's originality lies in its application of persistent homology , a method from topological data analysis, to financial markets. Persistent homology examines the shape and features of data across multiple scales, identifying patterns that persist as the scale changes. By adapting this concept, the oscillator tracks the persistence of uptrends and downtrends in price data, offering a novel approach to trend analysis.
Concepts Underlying the Calculations:
Persistent Homology: This method identifies features such as clusters, holes, and voids that persist as the scale changes. In the context of this indicator, it tracks the duration and stability of price trends.
Rolling Window Analysis: The oscillator uses a specified window size to calculate the average length of uptrends and downtrends, providing a dynamic view of trend persistence over time.
Threshold-Based Trend Identification: It differentiates between uptrends and downtrends based on specified thresholds for price changes, ensuring precision in trend detection.
How It Works:
The oscillator monitors consecutive changes in closing prices to identify uptrends and downtrends.
An uptrend is detected when the closing price increase exceeds a specified positive threshold.
A downtrend is detected when the closing price decrease exceeds a specified negative threshold.
The lengths of these trends are recorded and averaged over the chosen window size.
The Trend Persistence Index is calculated as the difference between the average uptrend length and the average downtrend length, providing a measure of trend persistence.
How Traders Can Use It:
Identify Trend Strength: The Trend Persistence Index offers a clear measure of the strength and stability of uptrends and downtrends. A higher value indicates stronger and more persistent uptrends, while a lower value suggests stronger and more persistent downtrends.
Spot Trend Reversals: Significant shifts in the Trend Persistence Index can signal potential trend reversals. For instance, a transition from positive to negative values might indicate a shift from an uptrend to a downtrend.
Confirm Trends: Use the Trend Persistence Index alongside other technical indicators to confirm the strength and duration of trends, enhancing the accuracy of your trading signals.
Manage Risk: Understanding trend persistence can help traders manage risk by identifying periods of high trend stability versus periods of potential volatility. This can be crucial for timing entries and exits.
Example Usage:
Default Settings: Start with the default settings to get a feel for the oscillator’s behavior. Observe how the Trend Persistence Index reacts to different market conditions.
Adjust Thresholds: Fine-tune the positive and negative thresholds based on the asset's volatility to improve trend detection accuracy.
Combine with Other Indicators: Use the Persistent Homology Based Trend Strength Oscillator in conjunction with other technical indicators such as moving averages, RSI, or MACD for a comprehensive analysis.
Backtesting: Conduct backtesting to see how the oscillator would have performed in past market conditions, helping you to refine your trading strategy.
Smart Money Analysis with Golden/Death Cross [YourTradingSensei]Description of the script "Smart Money Analysis with Golden/Death Cross":
This TradingView script is designed for market analysis based on the concept of "Smart Money" and includes the detection of Golden Cross and Death Cross signals.
Key features of the script:
Moving Averages (SMA):
Two moving averages are calculated: a short-term (50 periods) and a long-term (200 periods).
The intersections of these moving averages are used to determine Golden Cross and Death Cross signals.
High Volume:
The current trading volume is analyzed.
Periods of high volume are identified when the current volume exceeds the average volume by a specified multiplier.
Support and Resistance Levels:
Key support and resistance levels are determined based on the highest and lowest prices over a specified period.
Buy and Sell Signals:
Buy and sell signals are generated based on moving average crossovers, high volume, and the closing price relative to key levels.
Golden Cross and Death Cross:
A Golden Cross occurs when the short-term moving average crosses above the long-term moving average.
A Death Cross occurs when the short-term moving average crosses below the long-term moving average.
These signals are displayed on the chart with text color changes for better visualization.
Using the script:
The script helps traders visualize key signals and levels, aiding in making informed trading decisions based on the behavior of major market players and technical analysis.
Custom candle lighting(CCL) © 2024 by YourTradingSensei is licensed under CC BY-NC-SA 4.0. To view a copy of this license.
AlgoBuilder [Trend-Following] | FractalystWhat's the strategy's purpose and functionality?
This strategy is designed for both traders and investors looking to rely on and trade based on historical and backtested data using automation. The main goal is to build profitable trend-following strategies that outperform the underlying asset in terms of returns while minimizing drawdown. For example, as for a benchmark, if the S&P 500 (SPX) has achieved an estimated 10% annual return with a maximum drawdown of -57% over the past 20 years, using this strategy with different entry and exit techniques, users can potentially seek ways to achieve a higher Compound Annual Growth Rate (CAGR) while maintaining a lower maximum drawdown.
Although the strategy can be applied to all markets and timeframes, it is most effective on stocks, indices, future markets, cryptocurrencies, and commodities and JPY currency pairs given their trending behaviors.
In trending market conditions, the strategy employs a combination of moving averages and diverse entry models to identify and capitalize on upward market movements. It integrates market structure-based trailing stop-loss mechanisms across different timeframes and provides exit techniques, including percentage-based and risk-reward (RR) based take profit levels.
Additionally, the strategy has also a feature that includes a built-in probability and sentiment function for traders who want to implement probabilities and market sentiment right into their trading strategies.
Performance summary, weekly, and monthly tables enable quick visualization of performance metrics like net profit, maximum drawdown, compound annual growth rate (CAGR), profit factor, average trade, average risk-reward ratio (RR), and more. This aids optimization to meet specific goals and risk tolerance levels effectively.
-----
How does the strategy perform for both investors and traders?
The strategy has two main modes, tailored for different market participants: Traders and Investors.
Trading:
1. Trading (1x):
- Designed for traders looking to capitalize on bullish trending markets.
- Utilizes a percentage risk per trade to manage risk and optimize returns.
- Suitable for active trading with a focus on trend-following and risk management.
- (1x) This mode ensures no stacking of positions, allowing for only one running position or trade at a time.
◓: Mode | %: Risk percentage per trade
2. Trading (2x):
Similar to the 1x mode but allows for two pyramiding entries.
This approach enables traders to increase their position size as the trade moves in their favor, potentially enhancing profits during strong bullish trends.
◓: Mode | %: Risk percentage per trade
3. Investing:
- Geared towards investors who aim to capitalize on bullish trending markets without using leverage while mitigating the asset's maximum drawdown.
- Utilizes 100% of the equity to buy, hold, and manage the asset.
- Focuses on long-term growth and capital appreciation by fully investing in the asset during bullish conditions.
- ◓: Mode | %: Risk not applied (In investing mode, the strategy uses 100% of equity to buy the asset)
-----
What's the purpose of using moving averages in this strategy? What are the underlying calculations?
Using moving averages is a widely-used technique to trade with the trend.
The main purpose of using moving averages in this strategy is to filter out bearish price action and to only take trades when the price is trading ABOVE specified moving averages.
The script uses different types of moving averages with user-adjustable timeframes and periods/lengths, allowing traders to try out different variations to maximize strategy performance and minimize drawdowns.
By applying these calculations, the strategy effectively identifies bullish trends and avoids market conditions that are not conducive to profitable trades.
The MA filter allows traders to choose whether they want a specific moving average above or below another one as their entry condition.
This comparison filter can be turned on (>/<) or off.
For example, you can set the filter so that MA#1 > MA#2, meaning the first moving average must be above the second one before the script looks for entry conditions. This adds an extra layer of trend confirmation, ensuring that trades are only taken in more favorable market conditions.
MA #1: Fast MA | MA #2: Medium MA | MA #3: Slow MA
⍺: MA Period | Σ: MA Timeframe
-----
What entry modes are used in this strategy? What are the underlying calculations?
The strategy by default uses two different techniques for the entry criteria with user-adjustable left and right bars: Breakout and Fractal.
1. Breakout Entries :
- The strategy looks for pivot high points with a default period of 3.
- It stores the most recent high level in a variable.
- When the price crosses above this most recent level, the strategy checks if all conditions are met and the bar is closed before taking the buy entry.
◧: Pivot high left bars period | ◨: Pivot high right bars period
2. Fractal Entries :
- The strategy looks for pivot low points with a default period of 3.
- When a pivot low is detected, the strategy checks if all conditions are met and the bar is closed before taking the buy entry.
◧: Pivot low left bars period | ◨: Pivot low right bars period
By utilizing these entry modes, the strategy aims to capitalize on bullish price movements while ensuring that the necessary conditions are met to validate the entry points.
-----
What type of stop-loss identification method are used in this strategy? What are the underlying calculations?
Initial Stop-Loss:
1. ATR Based:
The Average True Range (ATR) is a method used in technical analysis to measure volatility. It is not used to indicate the direction of price but to measure volatility, especially volatility caused by price gaps or limit moves.
Calculation:
- To calculate the ATR, the True Range (TR) first needs to be identified. The TR takes into account the most current period high/low range as well as the previous period close.
The True Range is the largest of the following:
- Current Period High minus Current Period Low
- Absolute Value of Current Period High minus Previous Period Close
- Absolute Value of Current Period Low minus Previous Period Close
- The ATR is then calculated as the moving average of the TR over a specified period. (The default period is 14).
Example - ATR (14) * 1.5
⍺: ATR period | Σ: ATR Multiplier
2. ADR Based:
The Average Day Range (ADR) is an indicator that measures the volatility of an asset by showing the average movement of the price between the high and the low over the last several days.
Calculation:
- To calculate the ADR for a particular day:
- Calculate the average of the high prices over a specified number of days.
- Calculate the average of the low prices over the same number of days.
- Find the difference between these average values.
- The default period for calculating the ADR is 14 days. A shorter period may introduce more noise, while a longer period may be slower to react to new market movements.
Example - ADR (14) * 1.5
⍺: ADR period | Σ: ADR Multiplier
Application in Strategy:
- The strategy calculates the current bar's ADR/ATR with a user-defined period.
- It then multiplies the ADR/ATR by a user-defined multiplier to determine the initial stop-loss level.
By using these methods, the strategy dynamically adjusts the initial stop-loss based on market volatility, helping to protect against adverse price movements while allowing for enough room for trades to develop.
Trailing Stop-Loss:
One of the key elements of this strategy is its ability to detec buyside and sellside liquidity levels across multiple timeframes to trail the stop-loss once the trade is in running profits.
By utilizing this approach, the strategy allows enough room for price to run.
There are two built-in trailing stop-loss (SL) options you can choose from while in a trade:
1. External Trailing Stop-Loss:
- Uses sell-side liquidity to trail your stop-loss, allowing price to consolidate before continuation. This method is less aggressive and provides more room for price fluctuations.
Example - External - Wick below the trailing SL - 12H trailing timeframe
⍺: Exit type | Σ: Trailing stop-loss timeframe
2. Internal Trailing Stop-Loss:
- Uses the most recent swing low with a period of 2 to trail your stop-loss. This method is more aggressive compared to the external trailing stop-loss, as it tightens the stop-loss closer to the current price action.
Example - Internal - Close below the trailing SL - 6H trailing timeframe
⍺: Exit type | Σ: Trailing stop-loss timeframe
Each market behaves differently across various timeframes, and it is essential to test different parameters and optimizations to find out which trailing stop-loss method gives you the desired results and performance.
-----
What type of break-even and take profit identification methods are used in this strategy? What are the underlying calculations?
For Break-Even:
- You can choose to set a break-even level at which your initial stop-loss moves to the entry price as soon as it hits, and your trailing stop-loss gets activated (if enabled).
- You can select either a percentage (%) or risk-to-reward (RR) based break-even, allowing you to set your break-even level as a percentage amount above the entry price or based on RR.
For TP1 (Take Profit 1):
- You can choose to set a take profit level at which your position gets fully closed or 50% if the TP2 boolean is enabled.
- Similar to break-even, you can select either a percentage (%) or risk-to-reward (RR) based take profit level, allowing you to set your TP1 level as a percentage amount above the entry price or based on RR.
For TP2 (Take Profit 2):
- You can choose to set a take profit level at which your position gets fully closed.
- As with break-even and TP1, you can select either a percentage (%) or risk-to-reward (RR) based take profit level, allowing you to set your TP2 level as a percentage amount above the entry price or based on RR.
The underlying calculations involve determining the price levels at which these actions are triggered. For break-even, it moves the initial stop-loss to the entry price and activate the trailing stop-loss once the break-even level is reached.
For TP1 and TP2, it's specifying the price levels at which the position is partially or fully closed based on the chosen method (percentage or RR) above the entry price.
These calculations are crucial for managing risk and optimizing profitability in the strategy.
⍺: BE/TP type (%/RR) | Σ: how many RR/% above the current price
-----
What's the ADR filter? What does it do? What are the underlying calculations?
The Average Day Range (ADR) measures the volatility of an asset by showing the average movement of the price between the high and the low over the last several days.
The period of the ADR filter used in this strategy is tied to the same period you've used for your initial stop-loss.
Users can define the minimum ADR they want to be met before the script looks for entry conditions.
ADR Bias Filter:
- Compares the current bar ADR with the ADR (Defined by user):
- If the current ADR is higher, it indicates that volatility has increased compared to ADR (DbU).(⬆)
- If the current ADR is lower, it indicates that volatility has decreased compared to ADR (DbU).(⬇)
Calculations:
1. Calculate ADR:
- Average the high prices over the specified period.
- Average the low prices over the same period.
- Find the difference between these average values in %.
2. Current ADR vs. ADR (DbU):
- Calculate the ADR for the current bar.
- Calculate the ADR (DbU).
- Compare the two values to determine if volatility has increased or decreased.
By using the ADR filter, the strategy ensures that trades are only taken in favorable market conditions where volatility meets the user's defined threshold, thus optimizing entry conditions and potentially improving the overall performance of the strategy.
>: Minimum required ADR for entry | %: Current ADR comparison to ADR of 14 days ago.
-----
What's the probability filter? What are the underlying calculations?
The probability filter is designed to enhance trade entries by using buyside liquidity and probability analysis to filter out unfavorable conditions.
This filter helps in identifying optimal entry points where the likelihood of a profitable trade is higher.
Calculations:
1. Understanding Swing highs and Swing Lows
Swing High: A Swing High is formed when there is a high with 2 lower highs to the left and right.
Swing Low: A Swing Low is formed when there is a low with 2 higher lows to the left and right.
2. Understanding the purpose and the underlying calculations behind Buyside, Sellside and Equilibrium levels.
3. Understanding probability calculations
1. Upon the formation of a new range, the script waits for the price to reach and tap into equilibrium or the 50% level. Status: "⏸" - Inactive
2. Once equilibrium is tapped into, the equilibrium status becomes activated and it waits for either liquidity side to be hit. Status: "▶" - Active
3. If the buyside liquidity is hit, the script adds to the count of successful buyside liquidity occurrences. Similarly, if the sellside is tapped, it records successful sellside liquidity occurrences.
5. Finally, the number of successful occurrences for each side is divided by the overall count individually to calculate the range probabilities.
Note: The calculations are performed independently for each directional range. A range is considered bearish if the previous breakout was through a sellside liquidity. Conversely, a range is considered bullish if the most recent breakout was through a buyside liquidity.
Example - BSL > 50%
-----
What's the sentiment Filter? What are the underlying calculations?
Sentiment filter aims to calculate the percentage level of bullish or bearish fluctuations within equally divided price sections, in the latest price range.
Calculations:
This filter calculates the current sentiment by identifying the highest swing high and the lowest swing low, then evenly dividing the distance between them into percentage amounts. If the price is above the 50% mark, it indicates bullishness, whereas if it's below 50%, it suggests bearishness.
Sentiment Bias Identification:
Bullish Bias: The current price is trading above the 50% daily range.
Bearish Bias: The current price is trading below the 50% daily range.
Example - Sentiment Enabled | Bullish degree above 50% | Bullish sentimental bias
>: Minimum required sentiment for entry | %: Current sentimental degree in a (Bullish/Bearish) sentimental bias
-----
What's the range length Filter? What are the underlying calculations?
The range length filter identifies the price distance between buyside and sellside liquidity levels in percentage terms. When enabled, the script only looks for entries when the minimum range length is met. This helps ensure that trades are taken in markets with sufficient price movement.
Calculations:
Range Length (%) = ( ( Buyside Level − Sellside Level ) / Current Price ) ×100
Range Bias Identification:
Bullish Bias: The current range price has broken above the previous external swing high.
Bearish Bias: The current range price has broken below the previous external swing low.
Example - Range length filter is enabled | Range must be above 5% | Price must be in a bearish range
>: Minimum required range length for entry | %: Current range length percentage in a (Bullish/Bearish) range
-----
What's the day filter Filter, what does it do?
The day filter allows users to customize the session time and choose the specific days they want to include in the strategy session. This helps traders tailor their strategies to particular trading sessions or days of the week when they believe the market conditions are more favorable for their trading style.
Customize Session Time:
Users can define the start and end times for the trading session.
This allows the strategy to only consider trades within the specified time window, focusing on periods of higher market activity or preferred trading hours.
Select Days:
Users can select which days of the week to include in the strategy.
This feature is useful for excluding days with historically lower volatility or unfavorable trading conditions (e.g., Mondays or Fridays).
Benefits:
Focus on Optimal Trading Periods:
By customizing session times and days, traders can focus on periods when the market is more likely to present profitable opportunities.
Avoid Unfavorable Conditions:
Excluding specific days or times can help avoid trading during periods of low liquidity or high unpredictability, such as major news events or holidays.
Increased Flexibility: The filter provides increased flexibility, allowing traders to adapt the strategy to their specific needs and preferences.
Example - Day filter | Session Filter
θ: Session time | Exchange time-zone
-----
What tables are available in this script?
Table Type:
- Summary: Provides a general overview, displaying key performance parameters such as Net Profit, Profit Factor, Max Drawdown, Average Trade, Closed Trades, Compound Annual Growth Rate (CAGR), MAR and more.
CAGR: It calculates the 'Compound Annual Growth Rate' first and last taken trades on your chart. The CAGR is a notional, annualized growth rate that assumes all profits are reinvested. It only takes into account the prices of the two end points — not drawdowns, so it does not calculate risk. It can be used as a yardstick to compare the performance of two strategies. Since it annualizes values, it requires a minimum 4H timeframe to display the CAGR value. annualizing returns over smaller periods of times doesn't produce very meaningful figures.
MAR: Measure of return adjusted for risk: CAGR divided by Max Drawdown. Indicates how comfortable the system might be to trade. Higher than 0.5 is ideal, 1.0 and above is very good, and anything above 3.0 should be considered suspicious and you need to make sure the total number of trades are high enough by running a Deep Backtest in strategy tester. (available for TradingView Premium users.)
Avg Trade: The sum of money gained or lost by the average trade generated by a strategy. Calculated by dividing the Net Profit by the overall number of closed trades. An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.
MaxDD: Displays the largest drawdown of losses, i.e., the maximum possible loss that the strategy could have incurred among all of the trades it has made. This value is calculated separately for every bar that the strategy spends with an open position.
Profit Factor: The amount of money a trading strategy made for every unit of money it lost (in the selected currency). This value is calculated by dividing gross profits by gross losses.
Avg RR: This is calculated by dividing the average winning trade by the average losing trade. This field is not a very meaningful value by itself because it does not take into account the ratio of the number of winning vs losing trades, and strategies can have different approaches to profitability. A strategy may trade at every possibility in order to capture many small profits, yet have an average losing trade greater than the average winning trade. The higher this value is, the better, but it should be considered together with the percentage of winning trades and the net profit.
Winrate: The percentage of winning trades generated by a strategy. Calculated by dividing the number of winning trades by the total number of closed trades generated by a strategy. Percent profitable is not a very reliable measure by itself. A strategy could have many small winning trades, making the percent profitable high with a small average winning trade, or a few big winning trades accounting for a low percent profitable and a big average winning trade. Most trend-following successful strategies have a percent profitability of 15-40% but are profitable due to risk management control.
BE Trades: Number of break-even trades, excluding commission/slippage.
Losing Trades: The total number of losing trades generated by the strategy.
Winning Trades: The total number of winning trades generated by the strategy.
Total Trades: Total number of taken traders visible your charts.
Net Profit: The overall profit or loss (in the selected currency) achieved by the trading strategy in the test period. The value is the sum of all values from the Profit column (on the List of Trades tab), taking into account the sign.
- Monthly: Displays performance data on a month-by-month basis, allowing users to analyze performance trends over each month.
- Weekly: Displays performance data on a week-by-week basis, helping users to understand weekly performance variations.
- OFF: Hides the performance table.
Labels:
- OFF: Hides labels in the performance table.
- PnL: Shows the profit and loss of each trade individually, providing detailed insights into the performance of each trade.
- Range: Shows the range length and Average Day Range (ADR), offering additional context about market conditions during each trade.
Profit Color:
- Allows users to set the color for representing profit in the performance table, helping to quickly distinguish profitable periods.
Loss Color:
- Allows users to set the color for representing loss in the performance table, helping to quickly identify loss-making periods.
These customizable tables provide traders with flexible and detailed performance analysis, aiding in better strategy evaluation and optimization.
-----
User-input styles and customizations:
To facilitate studying historical data, all conditions and rules can be applied to your charts. By plotting background colors on your charts, you'll be able to identify what worked and what didn't in certain market conditions.
Please note that all background colors in the style are disabled by default to enhance visualization.
-----
How to Use This Algobuilder to Create a Profitable Edge and System:
Choose Your Strategy mode:
- Decide whether you are creating an investing strategy or a trading strategy.
Select a Market:
- Choose a one-sided market such as stocks, indices, or cryptocurrencies.
Historical Data:
- Ensure the historical data covers at least 10 years of price action for robust backtesting.
Timeframe Selection:
- Choose the timeframe you are comfortable trading with. It is strongly recommended to use a timeframe above 15 minutes to minimize the impact of commissions on your profits.
Set Commission and Slippage:
- Properly set the commission and slippage in the strategy properties according to your broker or prop firm specifications.
Parameter Optimization:
- Use trial and error to test different parameters until you find the performance results you are looking for in the summary table or, preferably, through deep backtesting using the strategy tester.
Trade Count:
- Ensure the number of trades is 100 or more; the higher, the better for statistical significance.
Positive Average Trade:
- Make sure the average trade value is above zero.
(An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.)
Performance Metrics:
- Look for a high profit factor, MAR (Mar Ratio), CAGR (Compound Annual Growth Rate), and net profit with minimum drawdown. Ideally, aim for a drawdown under 20-30%, depending on your risk tolerance.
Refinement and Optimization:
- Try out different markets and timeframes.
- Continue working on refining your edge using the available filters and components to further optimize your strategy.
Automation:
- Once you’re confident in your strategy, you can use the automation section to connect the algorithm to your broker or prop firm.
- Trade a fully automated and backtested trading strategy, allowing for hands-free execution and management.
-----
What makes this strategy original?
1. Incorporating direct integration of probabilities into the strategy.
2. Leveraging market sentiment to construct a profitable approach.
3. Utilizing built-in market structure-based trailing stop-loss mechanisms across various timeframes.
4. Offering both investing and trading strategies, facilitating optimization from different perspectives.
5. Automation for efficient execution.
6. Providing a summary table for instant access to key parameters of the strategy.
-----
How to use automation?
For Traders:
1. Ensure the strategy parameters are properly set based on your optimized parameters.
2. Enter your PineConnector License ID in the designated field.
3. Specify the desired risk level.
4. Provide the Metatrader symbol.
5. Check for chart updates to ensure the automation table appears on the top right corner, displaying your License ID, risk, and symbol.
6. Set up an alert with the strategy selected as Condition and the Message as {{strategy.order.alert_message}}.
7. Activate the Webhook URL in the Notifications section, setting it as the official PineConnector webhook address.
8. Double-check all settings on PineConnector to ensure the connection is successful.
9. Create the alert for entry/exit automation.
For Investors:
1. Ensure the strategy parameters are properly set based on your optimized parameters.
2. Choose "Investing" in the user-input settings.
3. Create an alert with a specified name.
4. Customize the notifications tab to receive alerts via email.
5. Buying/selling alerts will be triggered instantly upon entry or exit order execution.
----
Strategy Properties
This script backtest is done on 4H COINBASE:BTCUSD , using the following backtesting properties:
Balance: $5000
Order Size: 10% of the equity
Risk % per trade: 1%
Commission: 0.04% (Default commission percentage according to TradingView competitions rules)
Slippage: 75 ticks
Pyramiding: 2
-----
Terms and Conditions | Disclaimer
Our charting tools are provided for informational and educational purposes only and should not be construed as financial, investment, or trading advice. They are not intended to forecast market movements or offer specific recommendations. Users should understand that past performance does not guarantee future results and should not base financial decisions solely on historical data.
Built-in components, features, and functionalities of our charting tools are the intellectual property of @Fractalyst Unauthorized use, reproduction, or distribution of these proprietary elements is prohibited.
By continuing to use our charting tools, the user acknowledges and accepts the Terms and Conditions outlined in this legal disclaimer and agrees to respect our intellectual property rights and comply with all applicable laws and regulations.
ATH/ATL Tracker [LuxAlgo]The ATH/ATL Tracker effectively displays changes made between new All-Time Highs (ATH)/All-Time Lows (ATL) and their previous respective values, over the entire history of available data.
The indicator shows a histogram of the change between a new ATH/ATL and its respective preceding ATH/ATL. A tooltip showing the price made during a new ATH/ATL alongside its date is included.
🔶 USAGE
By tracking the change between new ATHs/ATLs and older ATHs/ATLs, traders can gain insight into market sentiment, breadth, and rotation.
If many stocks are consistently setting new ATHs and the number of new ATHs is increasing relative to old ATHs, it could indicate broad market participation in a rally. If only a few stocks are reaching new ATHs or the number is declining, it might signal that the market's upward momentum is decreasing.
A significant increase in new ATHs suggests optimism and willingness among investors to buy at higher prices, which could be considered a positive sentiment. On the other hand, a decrease or lack of new ATHs might indicate caution or pessimism.
By observing the sectors where stocks are consistently setting new ATHs, users can identify which sectors are leading the market. Sectors with few or no new ATHs may be losing momentum and could be identified as lagging behind the overall market sentiment.
🔶 DETAILS
The indicator's main display is a histogram-style readout that displays the change in price from older ATH/ATLs to Newer/Current ATH/ATLs. This change is determined by the distance that the current values have overtaken the previous values, resulting in the displayed data.
The largest changes in ATH/ATLs from the ticker's history will appear as the largest bars in the display.
The most recent bars (depending on the selected display setting) will always represent the current ATH or ATL values.
When determining ATH & ATL values, it is important to filter out insignificant highs and lows that may happen constantly when exploring higher and lower prices. To combat this, the indicator looks to a higher timeframe than your chart's timeframe in order to determine these more significant ATHs & ATLs.
For Example: If a user was on a 1-minute chart and 5 highs-new highs occur across 5 adjacent bars, this has the potential to show up as 5 new ATHs. When looking at a higher timeframe, 5 minutes, only the highest of the 5 bars will indicate a new ATH. To assist with this, the indicator will display warnings in the dashboard when a suboptimal timeframe is selected as input.
🔹 Dashboard
The dashboard displays averages from the ATH/ATL data to aid in the anticipation and expectations for new ATH/ATLs.
The average duration is an average of the time between each new ATH/ATL, in this indicator it is calculated in "Days" to provide a more comprehensive understanding.
The average change is the average of all change data displayed in the histogram.
🔶 SETTINGS
Duration: The designated higher timeframe to use for filtering out insignificant ATHs & ATLs.
Order: The display order for the ATH/ATL Bars, Options are to display in chronological (oldest to newest) or reverse chronological order (newest to oldest).
Bar Width: Sets the width for each ATH/ATL bar.
Bar Spacing: Sets the # of empty bars in between each ATH/ATL bar.
Dashboard Settings: Parameters for the dashboard's size and location on the chart.
Chuck Dukas Market Phases of Trends (based on 2 Moving Averages)This script is based on the article “Defining The Bull And The Bear” by Chuck Duckas, published in Stocks & Commodities V. 25:13 (14-22); (S&C Bonus Issue, 2007).
The article “Defining The Bull And The Bear” discusses the concepts of “bullish” and “bearish” in relation to the price behavior of financial instruments. Chuck Dukas explains the importance of analyzing price trends and provides a framework for categorizing price activity into six phases. These phases, including recovery, accumulation, bullish, warning, distribution, and bearish, help to assess the quality of the price structure and guide decision-making in trading. Moving averages are used as tools for determining the context preceding the current price action, and the slope of a moving average is seen as an indicator of trend and price phase analysis.
The six phases of trends
// Definitions of Market Phases
recovery_phase = src > ma050 and src < ma200 and ma050 < ma200 // color: blue
accumulation_phase = src > ma050 and src > ma200 and ma050 < ma200 // color: purple
bullish_phase = src > ma050 and src > ma200 and ma050 > ma200 // color: green
warning_phase = src < ma050 and src > ma200 and ma050 > ma200 // color: yellow
distribution_phase = src < ma050 and src < ma200 and ma050 > ma200 // color: orange
bearish_phase = src < ma050 and src < ma200 and ma050 < ma200 // color red
Recovery Phase : This phase marks the beginning of a new trend after a period of consolidation or downtrend. It is characterized by the gradual increase in prices as the market starts to recover from previous losses.
Accumulation Phase : In this phase, the market continues to build a base as prices stabilize before making a significant move. It is a period of consolidation where buying and selling are balanced.
Bullish Phase : The bullish phase indicates a strong upward trend in prices with higher highs and higher lows. It is a period of optimism and positive sentiment in the market.
Warning Phase : This phase occurs when the bullish trend starts to show signs of weakness or exhaustion. It serves as a cautionary signal to traders and investors that a potential reversal or correction may be imminent.
Distribution Phase : The distribution phase is characterized by the market topping out as selling pressure increases. It is a period where supply exceeds demand, leading to a potential shift in trend direction.
Bearish Phase : The bearish phase signifies a strong downward trend in prices with lower lows and lower highs. It is a period of pessimism and negative sentiment in the market.
These rules of the six phases outline the cyclical nature of market trends and provide traders with a framework for understanding and analyzing price behavior to make informed trading decisions based on the current market phase.
60-period channel
The 60-period channel should be applied differently in each phase of the market cycle.
Recovery Phase : In this phase, the 60-period channel can help identify the beginning of a potential uptrend as price stabilizes or improves. Traders can look for new highs frequently in the 60-period channel to confirm the trend initiation or continuation.
Accumulation Phase : During the accumulation phase, the 60-period channel can highlight that the current price is sufficiently strong to be above recent price and longer-term price. Traders may observe new highs frequently in the 60-period channel as the slope of the 50-period moving average (SMA) trends upwards while the 200-period moving average (SMA) slope is losing its downward slope.
Bullish Phase : In the bullish phase, the 60-period channel showing a series of higher highs is crucial for confirming the uptrend. Additionally, traders should observe an upward-sloping 50-period SMA above an upward-sloping 200-period SMA for further validation of the bullish phase.
Warning Phase : When in the warning phase, the 60-period channel can provide insights into whether the current price is weaker than recent prices. Traders should pay attention to the relationship between the price close, the 50-period SMA, and the 200-period SMA to gauge the strength of the phase.
Distribution Phase : In the distribution phase, traders should look for new lows frequently in the 60-period channel, hinting at a weakening trend. It is crucial to observe that the 50-period SMA is still above the 200-period SMA in this phase.
Bearish Phase : Lastly, in the bearish phase, the 60-period channel reflecting a series of lower lows confirms the downtrend. Traders should also note that the price close is below both the 50-period SMA and the 200-period SMA, with the relationship of the 50-period SMA being less than the 200-period SMA.
By carefully analyzing the 60-period channel in each phase, traders can better understand market trends and make informed decisions regarding their investments.
Advanced Awesome Oscillator [CryptoSea]Advanced AO Analysis Indicator
The Advanced AO Analysis indicator is a sophisticated tool designed to evaluate the Awesome Oscillator (AO) in search of regular and hidden divergences that signal potential price reversals. By tracking the intensity and duration of the AO's movements, this indicator aids traders in pinpointing critical points in price action.
Key Features
Divergence Detection: Identifies both regular and hidden bullish and bearish divergences, providing early signs of potential market reversals.
Customizable Lookback Periods: Allows users to set specific lookback windows to define the strength and relevance of detected divergences.
Adaptive Oscillator Display: Features customizable display options for the AO, enabling users to view data in different modes suited to their analysis needs.
Alert System: Includes configurable alerts to notify users of potential divergence formations, helping traders respond promptly.
How it Works
AO Calculation: Computes the AO as the difference between short-term and long-term moving averages of the midpoints of bars, highlighting momentum shifts.
Pivot Point Analysis: Utilizes advanced algorithms to find low and high pivot points based on the oscillator values, crucial for spotting trend reversals.
Range Validation: Verifies that divergences occur within a predefined range from pivot points, ensuring their validity and strength.
Visualisation: Plots AO values and potential divergences directly on the chart, aiding in quick visual analysis.
Application
Strategic Decision-Making: Assists traders in making informed decisions by providing detailed analysis of AO movements and divergence.
Trend Confirmation: Reinforces trading strategies by confirming potential reversals with pivot point detection and divergence analysis.
Behavioural Insight: Offers insights into market dynamics and sentiment by analyzing the depth and duration of AO cycles above and below zero.
The Advanced AO Analysis indicator equips traders with a powerful analytical tool for studying the Awesome Oscillator in-depth, enhancing their ability to spot and act on divergence-based trading opportunities in the cryptocurrency markets.
Event on charts**Event on Charts Indicator**
This indicator visually marks significant events on your chart. It is highly customizable, allowing you to activate or deactivate different groups of events and choose whether to display the event text directly on the chart or only when hovered over. Each group of events can be configured with distinct settings such as height mode, color, and label style.
### Key Features:
- **Group Activation:** Enable or disable different groups of events based on your analysis needs.
- **Text Display Options:** Choose to display event texts directly on the chart or only on hover.
- **Customizable Appearance:** Adjust the height mode, offset multiplier, bubble color, text color, and label shape for each group.
- **Predefined Events:** Includes predefined events for major crashes, FED rate changes, SPX tops and bottoms, geopolitical conflicts, economic events, disasters, and significant Bitcoin events.
### Groups Included:
1. **Crash Events:** Marks major market crashes.
2. **FED Rate Events:** Indicates changes in the Federal Reserve rates.
3. **SPX Top Events:** Highlights market tops for the S&P 500.
4. **Geopolitical Conflicts:** Marks significant geopolitical events.
5. **Economic Events:** Highlights important economic events such as bankruptcies and crises.
6. **Disaster and Cyber Events:** Indicates major disasters and cyber attacks.
7. **Bitcoin Events:** Marks significant events in the Bitcoin market.
8. **SPX Bottom Events:** Highlights market bottoms for the S&P 500.
### Usage:
This indicator is useful for traders and analysts who want to keep track of historical events that could impact market behavior. By visualizing these events on the chart, you can better understand market reactions and make informed decisions.
MTF Bollinger BandWidth [CryptoSea]The MTF Bollinger BandWidth Indicator is an advanced analytical tool crafted for traders who need to gauge market volatility and trend strength across multiple timeframes. This powerful indicator leverages the Bollinger BandWidth concept to provide a comprehensive view of price movements and volatility changes, making it ideal for those looking to enhance their trading strategies with multi-timeframe analysis.
Key Features
Multi-Timeframe Analysis: Allows users to monitor Bollinger BandWidth across various timeframes, providing a macro and micro perspective on market volatility.
Pivot Point Detection: Identifies crucial high and low pivot points, offering insights into potential support and resistance levels. Pivot points are dynamic and adjust based on the timeframe viewed, reflecting short-term fluctuations or longer-term trends.
Customizable Parameters: Includes options to adjust the length of the moving average, the standard deviation multiplier, and more, enabling traders to tailor the tool to their specific needs.
Dynamic Color Coding: Utilizes color changes to indicate different market conditions, aiding in quick visual assessments.
In the example below, notice how changes in BBW across different timeframes provide early signals for potential volatility increases or decreases.
How it Works
Calculation of BandWidth: Measures the percentage difference between the upper and lower Bollinger Bands, which expands or contracts based on market volatility.
High and Low Pivot Tracking: Automatically calculates and tracks the pivots in BBW values, which are critical for identifying turning points in market behavior. High and low levels will change depending on the timeframe, capturing distinct market behaviors from granular movements to broad trends.
Visual Alerts and Table Display: Highlights significant changes in BBW with visual alerts and provides a detailed table view for comparison across timeframes.
In the example below, BBW identifies a significant contraction followed by an expansion, suggesting a potential breakout.
Application
Strategic Market Entry and Exit: Assists traders in making well-informed decisions about when to enter and exit trades based on volatility cues.
Trend Strength Assessment: Helps in determining the strength of the prevailing market trend through detailed analysis of expansion and contraction periods.
Adaptable to Various Trading Styles: Suitable for day traders, swing traders, and long-term investors due to its customization capabilities and effectiveness across different timeframes.
The MTF Bollinger BandWidth Indicator is a must-have in the arsenal of traders who demand depth, accuracy, and responsiveness in their market analysis tools. Enhance your trading decisions by integrating this sophisticated indicator into your strategy to navigate the complexities of various market conditions effectively.
Luxmi AI Ultimate 1 Min Option ScalperThe Luxmi AI Ultimate 1 Min Option Scalper is a specialized trading indicator designed for use in options trading. This tool is particularly focused on providing actionable signals to option buyers within a one-minute timeframe, making it highly suitable for scalping—a trading strategy aimed at profiting from small price changes. Below is an elaboration on how this indicator functions and its significance in trading decisions:
### Key Features of Luxmi AI Ultimate 1 Min Option Scalper
1. **Enter and Don't Signals:**
- **Enter Signals:** These signals indicate the optimal moments to enter a trade, suggesting when to buy an option. They are typically based on sophisticated algorithms that analyze price movements, volume, volatility, and other relevant market data.
- **Don't Signals:** These signals advise traders to refrain from entering a trade. This could be due to market conditions that are not conducive to profitable trading, such as high volatility, low liquidity, or unclear directional trends.
2. **Directional Trading Strategy:**
- The Luxmi AI Ultimate 1 Min Option Scalper focuses on directional trading, which involves making trades based on the expected direction of the market. For option buyers, this means taking positions that profit from upward (call options) or downward (put options) movements in the price of the underlying asset.
3. **Scalping Approach:**
- Scalping is a short-term trading strategy that involves making numerous trades over the course of a trading session, aiming to capitalize on small price changes. The one-minute timeframe is particularly suited for scalping, as it allows traders to quickly enter and exit positions to capture minimal but frequent profits.
### Functionality and Benefits
1. **Real-Time Analysis:**
- The indicator provides real-time analysis and signals, ensuring that traders receive timely information to make quick trading decisions. This is crucial in the fast-paced environment of scalping, where delays can significantly impact profitability.
2. **Automated Decision-Making Support:**
- By automating the signal generation process, the Luxmi AI Ultimate 1 Min Option Scalper helps reduce the cognitive load on traders. This automation can lead to more consistent trading performance, as it mitigates the impact of emotional and psychological factors that often influence human decision-making.
3. **Market Adaptability:**
- The indicator is designed to adapt to changing market conditions, adjusting its signals based on the latest data. This adaptability enhances its effectiveness in various market environments, whether trending, ranging, or highly volatile.
4. **Risk Management:**
- Incorporating "Don't" signals as part of the strategy helps traders avoid entering trades in unfavorable conditions, thereby managing risk more effectively. This feature is particularly valuable in preventing losses and preserving capital.
5. **Educational Value:**
- For less experienced traders, using the Luxmi AI Ultimate 1 Min Option Scalper can provide a learning experience. By observing the signals and their outcomes, traders can develop a better understanding of market dynamics and refine their trading strategies.
### Practical Application
- **Setup:** Traders integrate the Luxmi AI Ultimate 1 Min Option Scalper into their trading platforms. This setup typically involves installing the indicator and configuring it to monitor the specific options and market data relevant to the trader's strategy.
- **Monitoring:** During trading hours, traders monitor the signals provided by the indicator. They prepare to act quickly on "Enter" signals and heed "Don't" signals to avoid unnecessary risks.
- **Execution:** When an "Enter" signal is generated, traders execute the recommended trade, buying the corresponding option. They then manage their positions closely, ready to exit based on their predetermined profit targets or stop-loss levels.
In summary, the Luxmi AI Ultimate 1 Min Option Scalper is a powerful tool for option buyers, providing critical buy and hold signals in a highly time-sensitive manner. Its primary benefits include enhancing decision-making speed, improving trading consistency, and managing risk, all of which are essential for successful scalping in options trading.
Mateo's Time of Day Analysis LEThis strategy takes a trade every day at a specified time and then closes it at a specified time.
The purpose of this strategy is to help determine if there are better times to day to buy or sell.
I was originally inspired to write this when a YouTuber stated that SPX had been up during the last 30 minutes of the day over 80% of the time the past year. No matter who says it, test it, and in my opinion, TradingView is one of the easiest placed to do that! Unfortunately, that particular claim did not turn out to be accurate, but this tool remains for those who want to optimize timing their entries and exits at specific times of day.
FiboSequFiboSequ: Fibonacci Sequence Marking
Leonardo Fibonacci was an Italian mathematician who lived in the 12th century. His real name was Leonardo of Pisa, but he is commonly known as "Fibonacci." Fibonacci is famous for introducing the Hindu-Arabic numeral system to the Western world. This system is the basis of the modern decimal number system we use today.
Fibonacci Sequence
The Fibonacci sequence is a series of numbers that frequently appears in mathematics and nature. The first two numbers in the sequence are 0 and 1, and each subsequent number is the sum of the two preceding numbers.
The sequence is as follows:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, ...
Fibonacci Time Zones:
Fibonacci time zones are used to identify potential turning points in the market at specific time intervals. These time zones correspond to the Fibonacci sequence in terms of consecutive days or weeks.
The Fibonacci sequence has a wide range of applications in both mathematics and nature. Leonardo Fibonacci's work has had a significant impact on the development of modern mathematics and numeral systems. In financial markets, the Fibonacci sequence and ratios are frequently used by technical analysts to predict and analyze market movements.
Description:
Overview:
The FiboSequ indicator marks significant days on a price chart based on the Fibonacci sequence. This can help traders identify potential turning points or areas of interest in the market. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, often found in nature and financial markets.
Fibonacci Sequence:
The sequence used in this indicator includes: 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, and 2584.
These numbers represent the days to be marked on the chart, highlighting possible significant market movements.
How It Works:
User Input:
Users can input the starting date (Year, Month, and Day) from which the Fibonacci sequence will begin to be calculated.
This allows flexibility and customization based on the trader's analysis needs.
Calculation:
The starting date is converted into a timestamp in seconds.
For each bar on the chart, the number of days since the starting date is calculated.
The indicator checks if the current day matches any of the Fibonacci sequence days, the previous day, or the next day.
In this indicator, Fibonacci numbers can be displayed on the chart as plus and minus 2 days. For example, for the 145th day, signals start to appear as 143,144 and 145. This is due to dates that sometimes coincide with weekends and public holidays.
Marking the Chart:
When a match is found, a label is placed above the bar indicating the day number from the Fibonacci sequence.
These labels are colored blue with white text for easy visibility.
Usage:
This indicator can be used on any timeframe and market to help identify potential areas where price might react.
It is especially useful for those who employ Fibonacci analysis in their trading strategy.
Example:
If the starting date is January 1, 2020, the indicator will mark significant Fibonacci days (e.g., 1, 3, 5, 8 days, etc.) on the chart from this date onward.
Community Guidelines Compliance:
This indicator adheres to TradingView's Pine Script community guidelines.
It provides customizable user inputs and does not violate any terms of use.
By using the FiboSequ indicator, traders can enhance their technical analysis by incorporating time-based Fibonacci levels, potentially leading to better market timing and decision-making.
Frequently Asked Questions (FAQ)
Q: What is the FiboSequ indicator?
A: The FiboSequ indicator is a technical analysis tool that marks significant days on a price chart based on the Fibonacci sequence. This indicator helps traders identify potential turning points or areas of interest in the market.
Q: What is the Fibonacci sequence and why is it important?
A: The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones. The first two numbers are 0 and 1. This sequence frequently appears in nature and financial markets and is used in technical analysis to identify important support and resistance levels.
Q: How do the Fibonacci time zones in the indicator work?
A: Fibonacci time zones are used to identify potential market turning points at specific time intervals. The indicator calculates days based on the Fibonacci sequence (e.g., 1, 3, 5, 8 days, etc.) from the starting date and marks them on the chart.
Q: How can users set the starting date?
A: Users can input the starting date by specifying the year, month, and day. This sets the date from which the indicator begins its calculations, providing flexibility for user analysis.
Q: What do the labels in the indicator represent?
A: The labels mark specific days in the Fibonacci sequence. For example, 1st day, 3rd day, 5th day, etc. These labels are displayed in blue with white text for easy visibility.
Q: Which timeframes can I use the FiboSequ indicator on?
A: The FiboSequ indicator can be used on any timeframe. This includes daily, weekly, or monthly charts, as well as shorter timeframes.
Q: Which markets can the FiboSequ indicator be used in?
A: The FiboSequ indicator can be used in various financial markets, including stocks, forex, cryptocurrencies, commodities, and more.
Q: How can I achieve better market timing with the FiboSequ indicator?
A: The FiboSequ indicator helps identify potential market turning points using time-based Fibonacci levels. This can lead to better market timing and more informed trading decisions for traders.
-Please feel free to write your valuable comments and opinions. I attach importance to your valuable opinions so that I can improve myself.
Bull Market Drawdowns V1.0 [ADRIDEM]Bull Market Drawdowns V1.0
Overview
The Bull Market Drawdowns V1.0 script is designed to help visualize and analyze drawdowns during a bull market. This script calculates the highest high price from a specified start date, identifies drawdown periods, and plots the drawdown areas on the chart. It also highlights the maximum drawdowns and marks the start of the bull market, providing a clear visual representation of market performance and potential risk periods.
Unique Features of the New Script
Default Timeframe Configuration: Allows users to set a default timeframe for analysis, providing flexibility in adapting the script to different trading strategies and market conditions.
Customizable Bull Market Start Date: Users can define the start date of the bull market, ensuring the script calculates drawdowns from a specific point in time that aligns with their analysis.
Drawdown Calculation and Visualization: Calculates drawdowns from the highest high since the bull market start date and plots the drawdown areas on the chart with distinct color fills for easy identification.
Maximum Drawdown Tracking and Labeling: Tracks the maximum drawdown for each period and places labels on the chart to indicate significant drawdowns, helping traders identify and assess periods of higher risk.
Bull Market Start Marker: Marks the start of the bull market on the chart with a label, providing a clear reference point for the beginning of the analysis period.
Originality and Usefulness
This script provides a unique and valuable tool by combining drawdown analysis with visual markers and customizable settings. By calculating and plotting drawdowns from a user-defined start date, traders can better understand the performance and risks associated with a bull market. The script’s ability to track and label maximum drawdowns adds further depth to the analysis, making it easier to identify critical periods of market retracement.
Signal Description
The script includes several key visual elements that enhance its usefulness for traders:
Drawdown Area : Plots the upper and lower boundaries of the drawdown area, filling the space between with a semi-transparent color. This helps traders easily identify periods of market retracement.
Maximum Drawdown Labels : Labels are placed on the chart to indicate the maximum drawdown for each period, providing clear markers for significant drawdowns.
Bull Market Start Marker : A label is placed at the start of the bull market, marking the beginning of the analysis period and helping traders contextualize the drawdown data.
These visual elements help quickly assess the extent and impact of drawdowns within a bull market, aiding in risk management and decision-making.
Detailed Description
Input Variables
Default Timeframe (`default_timeframe`) : Defines the timeframe for the analysis. Default is 720 minutes
Bull Market Start Date (`start_date_input`) : The starting date for the bull market analysis. Default is January 1, 2023
Functionality
Highest High Calculation : The script calculates the highest high price on the specified timeframe from the user-defined start date.
```pine
var float highest_high = na
if (time >= start_date)
highest_high := na(highest_high ) ? high : math.max(highest_high , high)
```
Drawdown Calculation : Determines the drawdown starting point and calculates the drawdown percentage from the highest high.
```pine
var float drawdown_start = na
if (time >= start_date)
drawdown_start := na(drawdown_start ) or high >= highest_high ? high : drawdown_start
drawdown = (drawdown_start - low) / drawdown_start * 100
```
Maximum Drawdown Tracking : Tracks the maximum drawdown for each period and places labels above the highest high when a new high is reached.
```pine
var float max_drawdown = na
var int max_drawdown_bar_index = na
if (time >= start_date)
if na(max_drawdown ) or high >= highest_high
if not na(max_drawdown ) and not na(max_drawdown_bar_index) and max_drawdown > 10
label.new(x=max_drawdown_bar_index, y=drawdown_start , text="Max -" + str.tostring(max_drawdown , "#") + "%",
color=color.red, style=label.style_label_down, textcolor=color.white, size=size.normal)
max_drawdown := 0
max_drawdown_bar_index := na
else
if na(max_drawdown ) or drawdown > max_drawdown
max_drawdown := drawdown
max_drawdown_bar_index := bar_index
```
Drawdown Area Plotting : Plots the drawdown area with upper and lower boundaries and fills the area with a semi-transparent color.
```pine
drawdown_area_upper = time >= start_date ? drawdown_start : na
drawdown_area_lower = time >= start_date ? low : na
p1 = plot(drawdown_area_upper, title="Drawdown Area Upper", color=color.rgb(255, 82, 82, 60), linewidth=1)
p2 = plot(drawdown_area_lower, title="Drawdown Area Lower", color=color.rgb(255, 82, 82, 100), linewidth=1)
fill(p1, p2, color=color.new(color.red, 90), title="Drawdown Fill")
```
Current Maximum Drawdown Label : Places a label on the chart to indicate the current maximum drawdown if it exceeds 10%.
```pine
var label current_max_drawdown_label = na
if (not na(max_drawdown) and max_drawdown > 10)
current_max_drawdown_label := label.new(x=bar_index, y=drawdown_start, text="Max -" + str.tostring(max_drawdown, "#") + "%",
color=color.red, style=label.style_label_down, textcolor=color.white, size=size.normal)
if (not na(current_max_drawdown_label))
label.delete(current_max_drawdown_label )
```
Bull Market Start Marker : Places a label at the start of the bull market to mark the beginning of the analysis period.
```pine
var label bull_market_start_label = na
if (time >= start_date and na(bull_market_start_label))
bull_market_start_label := label.new(x=bar_index, y=high, text="Bull Market Start", color=color.blue, style=label.style_label_up, textcolor=color.white, size=size.normal)
```
How to Use
Configuring Inputs : Adjust the default timeframe and start date for the bull market as needed. This allows the script to be tailored to different market conditions and trading strategies.
Interpreting the Indicator : Use the drawdown areas and labels to identify periods of significant market retracement. Pay attention to the maximum drawdown labels to assess the risk during these periods.
Signal Confirmation : Use the bull market start marker to contextualize drawdown data within the overall market trend. The combination of drawdown visualization and maximum drawdown labels helps in making informed trading decisions.
This script provides a detailed view of drawdowns during a bull market, helping traders make more informed decisions by understanding the extent and impact of market retracements. By combining customizable settings with visual markers and drawdown analysis, traders can better align their strategies with the underlying market conditions, thus improving their risk management and decision-making processes.
D9 IndicatorD9 Indicator
Category
Technical Indicators
Overview
The D9 Indicator is designed to identify potential trend reversals by counting the number of consecutive closes that are higher or lower than the close four bars earlier. This indicator highlights key moments in the price action where a trend might be exhausting and potentially reversing, providing valuable insights for traders.
Features
Up Signal: Plots a downward triangle or a cross above the bar when the count of consecutive closes higher than the close four bars earlier reaches 7, 8, or 9.
Down Signal: Plots an upward triangle or a checkmark below the bar when the count of consecutive closes lower than the close four bars earlier reaches 7, 8, or 9.
Visual Signals
Red Downward Triangle (7): Indicates the seventh consecutive bar with a higher close.
Red Downward Triangle (8): Indicates the eighth consecutive bar with a higher close.
Red Cross (❌): Indicates the ninth consecutive bar with a higher close, suggesting a potential bearish reversal.
Green Upward Triangle (7): Indicates the seventh consecutive bar with a lower close.
Green Upward Triangle (8): Indicates the eighth consecutive bar with a lower close.
Green Checkmark (✅): Indicates the ninth consecutive bar with a lower close, suggesting a potential bullish reversal.
Usage
The D9 Indicator is useful for traders looking for visual cues to identify potential trend exhaustion and reversals. It can be applied to any market and timeframe, providing flexibility in various trading strategies.
How to Read
When a red cross (❌) appears above a bar, it may signal an overextended uptrend and a potential bearish reversal.
When a green checkmark (✅) appears below a bar, it may signal an overextended downtrend and a potential bullish reversal.
Example
When the price has consecutively closed higher than four bars ago for nine bars, a red cross (❌) will appear above the ninth bar. This suggests that the uptrend might be exhausting, and traders could look for potential short opportunities. Conversely, when the price has consecutively closed lower than four bars ago for nine bars, a green checkmark (✅) will appear below the ninth bar, indicating a potential buying opportunity.