Equity Sessions [vnhilton]Note: Numbers in the chart above, particularly volume, are incorrect as I didn't have extra market data at the time of publication. Default settings are set for US markets.
(OVERVIEW)
This indicator was made specifically for equity markets which have pre-market and after-hours trading, though can be used for any other markets without these sessions, there are many other session indicators better suited for those markets. What makes this indicator different to the hundreds of session indicators out there will be highlighted in bold in the Features section below.
(FEATURES)
- After-Hours session can start earlier if the day ends short and starts after-hours trading earlier due to holidays for example
- Sessions constrained to regular trading hours can also adjust for short days as well
- Show volume for each session and also as a percentage/multiplier of day volume, average day volume with customisable period
- Show range for each session and also as a percentage/multiplier of the daily ATR with customisable period
- Lookback period for the boxes
- Customisable text size, placement, colour, name
- Customisable session lengths and constraints (regular trading hours or all including extending trading hours)
- Customisable border widths, styles and colours, and session background colour
- Toggles to show/hide sessions, volume, day volume, average day volume, session range and day ATR
Volatility
DTR & ATR
Description
This ATR and DTR label is update of Existing Label provided by © ssksubam
Please See Notes on original Script Here :
Original Code is not mine but I have done few code changes which I believe will help everyone who are looking to add more labels together and save space on the chart
ATR & DTR Script is very helpful for Day Traders as I will explain in detail bellow
Following are changes I have incorporated
Previous Label took more space on the charts with Header and Footer.
I removed the Header and moved both DTR vs ATR descriptions on the same line, saving space on the chart.
I updated the code to remove => signs, which are self-explanatory as I will explain below.
I made the label in 1 single compact line for maximum space efficiency and aesthetics.
These changes improve the content's clarity and conciseness while optimizing space on the charts. If you have any further requests or need additional assistance, feel free to let me know!
What Does DTR Signify?
Stock ATR stands for Average True Range, which is a technical indicator used in trading and investment analysis. The Average True Range measures the volatility of a stock over a given period of time. It provides insights into the price movement and potential price ranges of the stock.
The ATR is calculated as the average of the true ranges over a specific number of periods. The true range is the greatest of the following three values:
The difference between the current high and the current low.
The absolute value of the difference between the current high and the previous close.
The absolute value of the difference between the current low and the previous close.
Traders and investors use ATR to assess the potential risk and reward of a stock. A higher ATR value indicates higher volatility and larger price swings, while a lower ATR value suggests lower volatility and smaller price movements. By understanding the ATR, traders can set appropriate stop-loss levels and make informed decisions about position sizing and risk management.
It's important to note that the ATR is not a directional indicator like moving averages or oscillators. Instead, it provides a measure of volatility, helping traders adapt their strategies to suit the current market conditions.
What Does ATR Signify?
The Average True Range (ATR) signifies the level of volatility or price variability in a particular financial asset, such as a stock, currency pair, or commodity, over a specific period of time. It provides valuable information to traders and investors regarding the potential risk and reward associated with the asset.
Here are the key significances of ATR:
Volatility Measurement: ATR measures the average price range between high and low prices over a specified timeframe. Higher ATR values indicate greater volatility, while lower values suggest lower volatility. Traders use this information to gauge the potential price movements and adjust their strategies accordingly.
Risk Assessment: A higher ATR value implies larger price swings, indicating increased market uncertainty and risk. Traders can use ATR to set appropriate stop-loss levels and manage risk by adjusting position sizes based on the current volatility.
Trend Strength: ATR can also be used to assess the strength of a trend. In an uptrend or downtrend, ATR tends to increase, indicating a more powerful price movement. Conversely, a declining ATR might signify a weakening trend or a consolidation period.
Range-Bound Market Identification: In a range-bound or sideways market, the ATR value tends to be relatively low, reflecting the lack of significant price movements. This information can be helpful for range-trading strategies.
Volatility Breakouts: Traders often use ATR to identify potential breakouts from consolidation patterns. When the ATR value expands significantly, it may indicate the beginning of a new trend or a breakout move.
Comparison between Assets: ATR allows traders to compare the volatility of different
How to use DTR & ATR for Trading
Using Average True Range (ATR) and Daily Trading Range (DTR) can be beneficial for day trading to assess potential price movements, manage risk, and identify trading opportunities. Here's how you can use both indicators effectively:
Calculate ATR and DTR: First, calculate the ATR and DTR values for the asset you are interested in trading. ATR is the average of true ranges over a specified period (e.g., 14 days), while DTR is the difference between the high and low prices of a single trading day.
Assess Volatility: Compare the ATR and DTR values to understand the current volatility of the asset. Higher values indicate increased volatility, while lower values suggest reduced volatility.
Setting Stop-Loss: Use ATR to set appropriate stop-loss levels. For example, you might decide to set your stop-loss a certain number of ATR points away from your entry point. This approach allows you to factor in market volatility when determining your risk tolerance.
Identify Trading Range: Analyze DTR to determine the typical daily price range of the asset. This information can help you identify potential support and resistance levels, which are essential for day trading strategies such as breakout or range trading.
Breakout Strategies: ATR can assist in identifying potential breakout opportunities. When ATR values increase significantly, it suggests an expansion in volatility, which may indicate an upcoming breakout from a trading range. Look for breakouts above resistance or below support levels with higher than usual ATR values.
Scalping Strategies: For scalping strategies, where traders aim to profit from small price movements within a single trading session, knowing the typical DTR can help set reasonable profit targets and stop-loss levels.
Confirming Trend Strength: In day trading, you may encounter short-term trends. Use ATR to assess the strength of these trends. If the ATR is rising, it suggests a strong trend, while a declining ATR may indicate a weakening trend or potential reversal.
Risk Management: Both ATR and DTR can aid in risk management. Determine your position size based on the current ATR value to align it with your risk tolerance. Additionally, understanding the DTR can help you avoid overtrading during periods of low volatility.
Combine with Other Indicators: ATR and DTR work well when used in conjunction with other technical indicators like moving averages, Bollinger Bands, or RSI. Combining multiple indicators can provide a mor
Volume [Entoryx]
Certainly! Here's a more concise description for the "Entoryx Volume" indicator, with less focus on the specifics of the order block bar detection:
The "Entoryx Volume" is a versatile technical indicator that analyzes the relationship between price ranges and volume over a user-defined number of bars. By calculating a delta between the highest high and lowest low, it offers insights into market momentum and direction.
Key features of this indicator include:
1) Current Value Plotting: A dynamic line plotted on the chart represents the current value, which reflects market trends. The color of the line changes to green for bullish conditions and red for bearish conditions, depending on its relationship with the Exponential Moving Average (EMA) of the close.
2) Color-Coded Regions: The area between the current value plot and a baseline zero line is filled with a corresponding color, providing a visual representation of market sentiment.
3) Boundary Lines: Horizontal lines at +10 and -10 serve as reference points to highlight significant market movements.
4) Order Block Bar Detection (Optional): An optional feature that places visual markers on the chart to signal potential reversals. This can be enabled or disabled by the user, according to preference.
The "Entoryx Volume" indicator is tailored for traders aiming to understand market momentum with a clear and visually intuitive display. It is suitable across various trading strategies and market conditions, with customization options to fit individual needs.
The source code for this indicator is subject to the terms of the Mozilla Public License 2.0.
Range Based Signals and AlertsThis script produces a compiled version of rule based signals that is meant to be used mainly on 5 Min timeframe based on daily(as default) Highs and Lows on average and the main purpose is to give user settings to change and adapt based on their needs and make it as adjustable as possible. This entry strategy idea does not belong to me but for TV's in-house rule reasons i can't disclose whose idea it is but i think people that will use this indicator will know who the original idea belongs to.
Rules used for signal production:
- Daily(As default) High-Low points
- Moving Average for detecting reversing of price
- MTF MACD (Daily as default) for detecting overall trend
Signals produced based on extensions of price out of daily zones and when they drop or rise back into moving average. A conditional checker is used for reducing repeated unnecessary signals and alerts.
Happy trading.
DBMA - Dual Bollinger Moving AverageThe Dual Bollinger moving average (DBMA) consists of a moving average (MA) & two Bollinger Bands (BB), with the color of the bands representing the level of price compression. In its default settings, it is a 20-day simple moving average with 2 upper Bollinger Bands, having the standard deviation (SD) settings of 0.5 & 1, respectively.
How close the price is to the moving average?
For a pullback trader, the entry point should be close to the moving average, preferably with price compression. How close should it be, is where the bands serve as a guide. The low of the pullback candle should be within the bands, that is, at least within the far band (1 SD of the MA), or even better if it's within the near band (0.5 SD). When the price is outside the bands, it should not be considered favourable for a pullback entry.
For how long has the price been closer to the moving average?
John Carter’s TTM Squeeze indicator looked at the relationship between Bollinger Bands and Keltner's Channels to help identify period of volatility contractions. Bollinger Bands being completely enclosed within the Keltner Channels is indicative of a very low volatility. This is a state of volatility contraction known as squeeze. Using different ATR lengths (1.0, 1.5 and 2.0) for Keltner Channels, we can differentiate between levels of squeeze (High, Mid & Low compression, respectively). Greater the compression, higher the potential for explosive moves.
The squeeze portion of the script is based on LazyBear's script ( Squeeze Momentum Indicator )
The High, Mid & Low compression squeezes are depicted via the color of the bands being red, orange, or yellow, respectively. With the low of the pullback candle within the bands, & the squeeze color changing to red, it should be considered favourable for a pullback entry.
Trailing the price with the lower bands
The lower bands can be used for trailing with the moving average. While trailing, once the price closes below the moving average, the trailing stoploss (TSL) is said to be triggered, & the trade is exited. Here we use the bands to give it some cushion. Let the price close below the 1SD band for labelling the TSL as being triggered to exit the trade. If the price closes below the MA but is still within the bands, the signal is to keep holding the trade.
Reversal Squeeze (Expo)█ Overview
The Reverse Squeeze indicator aims to identify situations where market participants (either short-sellers or long buyers) are under significant pressure due to unexpected price movements, which may lead to forced actions to mitigate their losses. These pressured situations, often termed as 'squeezes,' can lead to overreactions in the market that could subsequently result in price corrections or reversals.
█ What is a squeeze?
A squeeze occurs when a significant change in price forces market participants to take drastic action to mitigate their losses. There are two types of squeezes: short squeezes and long squeezes.
Short-Sellers Squeeze: This occurs when a stock's price unexpectedly rises, pressurizing short-sellers who had bet on the stock price going down. The increased price forces these short-sellers to buy back the stocks they had borrowed and sold (to close their positions), which can create even more demand for the stock, further driving the price up. This situation is often referred to as a "short squeeze."
Long Buyers Squeeze: This is the opposite situation, occurring when a stock's price unexpectedly falls, putting long buyers under pressure. These buyers had hoped for a price increase. The decline forces these long buyers to sell off their holdings to minimize further losses, adding more supply to the market, which can push the price down even further. This situation is like a "long squeeze."
The Reverse Squeeze indicator identifies these situations, assuming that the short-sellers or long buyers' forced actions will lead to overreactions in the market, resulting in a correction or a reversal. As a trader, you might use the Reverse Squeeze indicator to identify these potential overreactions and trade on the anticipated correction or reversal.
█ How are squeezes calculated?
Calculating a squeeze involves multiple factors, primarily revolving around price movements, trading volumes, and market sentiment. While the actual positions, like the number of shorted shares or long positions, provide direct insights, there are several other indicators that traders can use to estimate potential squeezes, especially when direct data isn't readily available.
Price Action: This is an essential aspect of calculating potential squeezes. Rapid and significant increases or decreases in a stock's price can hint at potential short and long squeezes, respectively. Traders monitor these drastic price movements to anticipate possible squeezes.
Volume: Volume, or the number of shares traded within a specific period, is another crucial factor. High trading volumes usually accompany squeezes. A sudden spike in volume along with a rapid price increase can indicate a short squeeze, while a rapid volume increase along with a quick price decrease could signal a long squeeze.
Volatility: Increased volatility is often associated with squeezes. A rapid increase in volatility might suggest that a squeeze is happening or about to happen.
█ How to use the Reversal Squeeze Indicator
The Reverse Squeeze indicator can be a valuable tool in a trader's arsenal. It has the potential to give traders an 'alpha,' or an edge over other market participants, for the following reasons:
Detection of Overreactions: The indicator helps to identify market overreactions, where stocks become overbought or oversold due to forced buying or selling. These overreactions often lead to price corrections or reversals, providing potential trading opportunities.
Anticipating Price Reversals: By identifying instances where short sellers or long buyers are "squeezed" and might need to take drastic action, the indicator can help traders anticipate potential overreactions in the market that might lead to price corrections or reversals.
Risk Management: By identifying potential squeezes, traders can manage their risk more effectively. They can avoid going short on a stock if a short squeeze seems likely or avoid going long if a long squeeze is anticipated.
█ Why is the Reversal squeeze indicator Needed?
The Reverse Squeeze Indicator can provide crucial insights into market dynamics that may not be apparent with other indicators. It allows traders to spot potential trading opportunities arising from market overreactions. Moreover, by identifying potential squeezes, traders can manage their risk more effectively, avoiding positions that might put them on the wrong side of a squeeze.
█ Here's how institutions might influence market conditions that can lead to a squeeze:
Institutions can actually contribute to creating squeezes because of their size. For instance, an institution that starts covering a large short position can trigger a short squeeze.
Conversely, an institution that begins to sell a large long position can trigger a long squeeze.
Or if an institution or a group of institutions decide to buy a large number of shares in a company that has a significant number of short positions, this increased demand can cause the stock price to rise. This upward movement can put pressure on short-sellers to cover their positions, further increasing demand and driving the price even higher, creating a short squeeze.
These activities are part of the market dynamics where larger players naturally have more influence. However, it's crucial to note that deliberately creating conditions to cause harm to other market participants can cross into market manipulation, which is illegal. So while it's theoretically possible for institutions to "squeeze" the market, it's generally not their primary strategy due to the legal, ethical, and reputation risks associated. They are, however, very adept at recognizing and capitalizing on these situations when they arise naturally in the course of market dynamics.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Extreme Reversal SignalThe Extreme Reversal Signal is designed to signal potential pivot points when the price of an asset becomes extremely overbought or oversold. Extreme conditions typically signal a brief or extensive price reversal, offering valuable entry or exit points. It's important to note that this indicator may produce multiple signals, making it essential to corroborate these signals with other forms of analysis to determine their validity. While the default settings provide valuable insights, it might be beneficial to experiment with different configurations to ensure the indicator's efficacy.
Two primary conditions define extremely overbought and oversold states. The first condition is that the price must deviate by two standard deviations from the 20-day Simple Moving Average (SMA). The second condition is that the 3-day SMA of the 14-day Stochastic Oscillator (STO) derived from the 14-day Relative Strength Index (RSI) is above or below the upper or lower limit.
Oversold states arise when the first condition is met and the 3-day SMA of the 14-day Stochastic RSI falls below the lower limit, suggesting a buy signal. These are visually represented by green triangles below the price bars. Overbought states arise when the first condition is met and the 3-day SMA of the 14-day Stochastic RSI rises above the upper limit, suggesting a sell signal. These are visually represented by red triangles above the price bars. It's also possible to set up automated alerts to get notifications when either of these two conditions is met to avoid missing out.
While this indicator has traditionally identified overbought and oversold conditions in various different assets, past performance does not guarantee future results. Therefore, it is advisable to supplement this indicator with other technical tools. For instance, trend indicators can greatly improve the decision-making process when planning for entries and exit points.
PercentX Trend Follower [Trendoscope]"Trendoscope" was born from our trading journey, where we first delved into the world of trend-following methods. Over time, we discovered the captivating allure of pattern analysis and the exciting challenges it presented, drawing us into exploring new horizons. However, our dedication to trend-following methodologies remains steadfast and continues to be an integral part of our core philosophy.
Here we are, introducing another effective trend-following methodology, employing straightforward yet powerful techniques.
🎲 Concepts
Introducing the innovative PercentX Oscillator , a representation of Bollinger PercentB and Keltner Percent K. This powerful tool offers users the flexibility to customize their PercentK oscillator, including options for the type of moving average and length.
The Oscillator Range is derived dynamically, utilizing two lengths - inner and outer. The inner length initiates the calculation of the oscillator's highest and lowest range, while the outer length is used for further calculations, involving either a moving average or the opposite side of the highest/lowest range, to obtain the oscillator ranges.
Next, the Oscillator Boundaries are derived by applying another round of high/low or moving average calculations on the oscillator range values.
Breakouts occur when the close price crosses above the upper boundary or below the lower boundary, signaling potential trading opportunities.
🎲 How to trade a breakout?
To reduce false signals, we employ a simple yet effective approach. Instead of executing market trades, we use stop orders on both sides at a certain distance from the current close price.
In case of an upper side breakout, a long stop order is placed at 1XATR above the close, and a short stop order is placed at 2XATR below the close. Conversely, for a lower side breakout, a short stop order is placed at 1XATR below the close, and a long stop order is placed at 2XATR above the ATR. As a trend following method, our first inclination is to trade on the side of breakout and not to find the reversals. Hence, higher multiplier is used for the direction opposite to the breakout.
The script provides users with the option to specify ATR multipliers for both sides.
Once a trade is initiated, the opposite side of the trade is converted into a stop-loss order. In the event of a breakout, the script will either place new long and short stop orders (if no existing trade is present) or update the stop-loss orders if a trade is currently running.
As a trend-following strategy, this script does not rely on specific targets or target levels. The objective is to run the trade as long as possible to generate profits. The trade is only stopped when the stop-loss is triggered, which is updated with every breakout to secure potential gains and minimize risks.
🎲 Default trade parameters
Script uses 10% equity per trade and up to 4 pyramid orders. Hence, the maximum invested amount at a time is 40% of the equity. Due to this, the comparison between buy and hold does not show a clear picture for the trade.
Feel free to explore and optimize the parameters further for your favorite symbols.
🎲 Visual representation
The blue line represents the PercentX Oscillator, orange and lime colored lines represent oscillator ranges. And red/green lines represent oscillator boundaries. Oscillator spikes upon breakout are highlighted with color fills.
Day of Month - Volatility Report█ OVERVIEW
The indicator analyses the volatility and reports the statistics by the days of the month.
█ CONCEPTS
The markets move every day. But how does a market move during a month?
Here are some ideas to explore:
Does the volatility kick in with the start of a new month?
Do the markets slow down at the end of the month?
Which period of the month is the most volatile?
How does this relate to your best and worst trades?
When should you take a break?
DAX
EURGBP
Binance Coin
█ FEATURES
Comparison modes
Compare how each day moves relative to the monthly volatility or the average daily volatility.
Configurable outputs
Output the report statistics as mean or median.
Range filter
Select the period to report from.
█ HOW TO USE
Plot the indicator and visit the 1D, 24H, or 1440 minutes timeframe.
█ NOTES
Gaps
The indicator includes the volatility from gaps.
Trading session
The indicator analyses each day from the daily chart, defined by the exchange trading session (see Symbol Info).
Extended trading session
The indicator can include the extended hours when activated on the chart, using the 24H or 1440 minutes timeframe.
Overnight session
The indicator supports overnight sessions (open and close on different calendar days). For example, EURUSD will report Monday’s volatility from Sunday open at 17:00 to Monday close at 17:00.
This is a PREMIUM indicator. In complement, you might find useful my free Time of Day - Volatility Report .
Speed RailsCentered around a Variable Moving Average (Rail Line). The Variable Moving Average (VMA) is a study that uses an Exponential Moving Average being able to automatically adjust its smoothing factor according to the market volatility. Adjusted the settings of the VMA to move closer to price(quicker). This gives the user the ability to catch moves at support/resistance levels for added confluence.
In addition to the Rail Line or VMA, the indicator makes use of Bollinger Bands in two ways. First, it displays when the Bollinger Bands are in a squeeze and the potential direction of the breakout. The "squeeze" is the central concept of Bollinger Bands. When the bands come close together, constricting the moving average, it is called a squeeze. A squeeze signals a period of low volatility and is considered by traders to be a potential sign of future increased volatility and possible trading opportunities. The Bollinger Bands are also utilized to highlight when price action might reverse. This signals when price closes outside of the bands, quickly reverts and closes within the bands
Dots = Short Term Trend
Rails Bar Color = Medium Term Trend
Rail Line (VMA) = Long Term Trend
Squeeze = Shaded Orange Cloud
Combined with traditional support/resistance levels:
Variety Volatility Supertrend w/ Bands [Loxx]Variety Volatility Supertrend w/ Bands indicator is a powerful and highly customizable tool for traders. Building upon the foundational concept of the classic Supertrend indicator, this variant adds a plethora of user-driven options and features that can cater to diverse trading styles and market scenarios.
The Supertrend indicator is traditionally used to identify market trends by overlaying a line on the price chart, which changes color and position in relation to the price based on the trend direction. The Variety Volatility Supertrend w/ Bands takes this a step further by offering various volatility calculations, visual enhancements, explicit trading signals, and alert conditions.
It provides five options for volatility calculations, enabling users to select the most suitable measure for their strategy. This indicator also allows users to control the display of the upper, lower, and mid bands, which can serve as dynamic support and resistance levels. Further, it can display explicit trading signals when the trend changes direction and set up alerts for these signals.
█ User Inputs
Source: Defines the source of the price data, typically the closing price.
Period: Defines the lookback period for the chosen volatility calculation.
Mid Price Period: Defines the number of periods for calculating the mid-price.
Multiplier: The factor by which the volatility measure (e.g., ATR) is multiplied.
Volatility Type: The user can choose one of five different calculations for the volatility measure: ATR, Standard Error, Standard Deviation, Custom Standard Deviation with Sample Correction, and Custom Standard Deviation without Sample Correction.
Classic Supertrend: Enables the classic version of the Supertrend indicator if set to true.
Show Upper Band, Show Lower Band, Show Mid: Determines whether the upper, lower, and middle bands of the Supertrend indicator are displayed.
Outer Line Width, Mid Line Width: Controls the line widths of the outer and middle lines.
Color Bars: Colors the price bars based on the direction of the trend if enabled.
Show signals: Displays trading signals on the chart if enabled.
Bull Color, Bear Color: Controls the colors of the Supertrend indicator during bullish and bearish market conditions.
█ Computations
The script begins by calculating the chosen volatility measure (ATR, Standard Error, Standard Deviation, etc.) and the mid-price, which is the average of the highest and lowest prices over the specified Mid Price Period. It then calculates the upper and lower bands by adding and subtracting the product of the Multiplier and the volatility measure from the mid-price.
The script then compares the current price with the previous upper and lower bands to determine the trend direction. If the current price is greater than the previous upper band, the trend is considered bullish. If it's less than the previous lower band, the trend is bearish.
█ Visualizations
The script plots the upper, lower, and mid bands on the chart based on the user's settings. If Color Bars is enabled, the script colors the price bars based on the trend direction. If Show signals is enabled, the script displays shapes on the chart to represent trading signals when the trend changes direction.
█ Alerts
Finally, the script sets up alert conditions for long and short trading signals. When these conditions are met, TradingView sends an alert to the user with a message indicating the indicator's name, the type of signal (long or short), and the symbol and closing price of the asset.
█ Visualization Modes
Classic Supertrend
The Classic Supertrend mode essentially transforms the "Variety Volatility Supertrend w/ Bands " indicator to behave more like the traditional Supertrend indicator.
In the traditional Supertrend indicator, there is a single line that shifts positions based on the trend direction. When the market is in an uptrend, the Supertrend line is plotted below the price, acting as a dynamic support level. Conversely, when the market is in a downtrend, the Supertrend line moves above the price, acting as a dynamic resistance level.
When you set Classic Supertrend to True in this script, it mimics this behavior. It will only display one line (the Supertrend line) instead of the upper and lower bands. The Supertrend line will switch between the calculated upper band and lower band based on the trend direction:
In an uptrend, it plots the lower band as the Supertrend line (acting as a dynamic support level).
In a downtrend, it plots the upper band as the Supertrend line (acting as a dynamic resistance level).
Thus, when Classic Supertrend is True, the display is similar to the regular Supertrend indicator, offering a more simplified, less cluttered view of the price trend.
See here for the Classic Supertrend
Supertrend Moving Average with Bands
When the Classic Supertrend option is turned off in the "Variety Volatility Supertrend w/ Bands " indicator, the indicator displays upper and lower bands along with the midline, depending on the user's settings. These bands can serve as dynamic support and resistance levels, and they move and adjust based on the market's volatility.
Support and resistance are key concepts in technical analysis. Support is a price level where the price tends to find a floor as it falls, indicating a greater amount of demand or buying interest that can prop up the prices. Resistance, on the other hand, is a price level where rising prices tend to stop rising, indicating a greater amount of supply or selling interest.
In the context of the "Variety Volatility Supertrend w/ Bands " indicator:
Upper Band: This can act as a dynamic resistance level in a downtrend. When prices are falling, they might struggle to rise above this band. If prices do break above the upper band, it could be a sign that the downtrend is reversing, and a new uptrend may be beginning.
Lower Band: Conversely, this can act as a dynamic support level in an uptrend. When prices are rising, they might bounce off this band and continue to rise. If prices break below the lower band, it could indicate that the uptrend is reversing, and a new downtrend may be beginning.
The benefit of these dynamic support and resistance levels is that they adjust automatically as market conditions change, potentially offering more relevant insights into price behavior compared to static support and resistance levels.
See here for the Supertrend Moving Average with Bands
█ Volatility Types
The "Variety Volatility Supertrend w/ Bands " indicator provides five options for the volatility calculation. Volatility is a statistical measure of the dispersion of returns for a given security or market index. In most cases, the higher the volatility, the riskier the security. Here's a quick summary of each option:
Average True Range (ATR): This is a common volatility measure in the world of trading, particularly for commodities and forex markets. It measures the average of true price ranges over a specified period. The true range considers the most recent period's high-low range, the previous close to the most recent high, and the previous close to the most recent low, taking the highest value.
Standard Error: This is a measure of the accuracy of predictions made with statistical techniques. In the context of trading, the standard error can give traders an idea of the quality of their volatility or price level estimates. It's calculated using the standard deviation of the price data, the square root of the number of data points.
Standard Deviation: This is a measure of the dispersion of a set of data from its mean. It's a commonly used volatility measure in finance. In trading, a higher standard deviation suggests greater price volatility.
Custom Standard Deviation - with Sample Correction: This is a variation of the standard deviation calculation, but it applies a correction for small sample sizes. It's calculated similarly to the standard deviation, but the sum of the squares is divided by (n-1) instead of n to provide a more accurate estimate when working with a small number of data points.
Custom Standard Deviation - without Sample Correction: This is another variation of the standard deviation calculation, but without the sample correction. This might be used when the number of data points is sufficiently large that the correction is not necessary.
The choice of volatility measure can have a significant impact on the sensitivity of the Supertrend indicator. Some measures may result in wider bands and fewer trend changes, while others may produce narrower bands and more frequent trend changes. The choice of volatility measure should align with the trader's strategy and risk tolerance.
█ Multiple Timeframe options
The "Variety Volatility Supertrend w/ Bands " indicator, like most indicators on the TradingView platform, can be applied to various timeframes, regardless of the chart's current timeframe. The timeframe of an indicator is determined by the timeframe of the price data it processes.
This indicator's flexibility with timeframes allows it to be used in different trading strategies. Day traders might use shorter timeframes like 1-minute or 15-minute charts, swing traders might use 1-hour or 4-hour charts, and long-term investors might use daily or weekly charts.
See here for the Supertrend Moving Average with Bands on 4-hour chart using Daily data
ATR Extension [QuantVue]The Moving Average ATR Extension Indicator offers a powerful blend of two key market elements: the Average True Range (ATR) and Moving Averages (MA), capturing the dynamics of market momentum and trend direction.
This indicator is used to measure market extension from a user-selected moving average based on multiples of the Average True Range (ATR). By doing this, it becomes remarkably straightforward to spot strength at breakout points or exhaustion near the end of a run.
As a market breaks out the extension indicates a surge in buying pressure, while an extension after a sizeable move can often be an indication of market exhaustion. This extended position essentially reflects over-enthusiastic buying and could be an early warning sign of a potential trend reversal.
Breakout Strength:
Exhaustion:
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers.
ATR Stop Loss v4This indicator plots the current ATR value, and the Long and Short stop losses. Watch the indicator and move your stop loss to the Long or Short as necessary.
Unlike other ATR indicators this one allows the user to customize the table placement of the ATR calculations, and the colors of each row on the table, and the text. The ATR factors can also be edited.
SMT @joshuuuSmart Money Tool / Smart Money Technique is a concept taught by ICT (The InnerCircleTrader).
It compares correlated assets and if the correlation gets disrupted, we call it a smt divergence.
Correlated assets are for example the nasdaq, the sp500 and the dow.
A bullish scenario would be if one of those three makes a lower low and the other two make a higher low. In this case, that would form a divergence.
Another example would be the dxy (dollar-index), the eurusd and gbpusd. what's special about dxy compared to eurusd or gbpusd, is that dxy is inversely correlated to eurusd and gbpusd.
For inversely correlated assets the script has the option to inverse symbols.
Besides the option to inverse symbols, the script is also able to track smts between the two other symbols, that are not on the current chart and it's possible to filter smts only for certain time periods.
Options for those time periods are
ICT Killzones (all mentioned times are in ny time)
London Killzone : 0200-0500
forex:
NewYork Killzone : 0700-1000
indices:
NYAM Killzone : 0830-1100
NYPM Killzone : 1330-1600
ICTs Index SMT Times
AM - 0500-0930
PM - 1200-1500
To detect smts, the script compares swing highs with previous swing highs and swing lows with previous swing lows on all three symbols. To determine swing points, the user is able to input the amount of
candles to detect swing points, usually 1-3 is enough.
Crunchster's Turtle and Trend SystemThis is a combination of two popular systematic trading strategies - in the trend following category.
The strategy is designed for use on the daily timeframe. Specific features of this system are outlined below:
1. Two different strategies to choose from, "Trend" which is a volatility adjusted Exponential Moving Average (EMA) crossover strategy and "Breakout" which is my adaptation of the well documented "Turtle Strategy"
2. Uses advanced position sizing and risk management, usually reserved for institutional portfolio management, a proven technique utilised by Commodity Trading Advisors and Managed Futures funds (Algo/Quant funds).
"Trend" uses a fast (user defined) and slow EMA crossover, where the slow length is 5 times the fast length. The resulting signal is adjusted for the volatility of returns over a 252 lookback period, which helps to normalise the signal across different assets. The system goes long or short when it detects a new trend has formed.
"Break" uses the highest high or lowest low over a user defined lookback period to define the recent range. This is converted into a price normalised signal to allow the system to detect when a breakout occurs. The system goes long or short based off the breakout signal.
Position sizing is based on recent price volatility and the user defined annualised risk target. In essence positions are inverse volatility weighted, so larger size is opened during lower volatility and smaller size during increased volatility. Recent volatility is calculated as the standard deviation of returns with 14 period lookback, then extrapolated into an annualised volatility of expected returns. Annualised recent volatility is then referenced to the risk target set by the user to adjust the position size. The default settings are a conservative 15% annual risk target/volatility. Initial capital should be set as the maximum risk capital per trade (ie if $10,000 total capital and 10% risk per trade, initial capital should be $1000). Maximum leverage per position can be set independently, to facilitate hitting risk targets that are greater than the natural volatility of the traded asset, and to accommodate low volatility conditions, whilst maintaining overall risk controls. Direction (long or short) is at the user's discretion.
Hard stop losses are based on multiples of the average true range of recent price (14 period lookback), user configurable.
Strategy trailing stops are based off recent highest highs or lowest lows (user defined lookback) to cut the position if the trend or momentum is lost.
Although both strategies can be run simultaneously, optimal diversification will be achieved if ran separately/individually to avoid masking of entries.
CCI+EMA Strategy with Percentage or ATR TP/SL [Alifer]This is a momentum strategy based on the Commodity Channel Index (CCI), with the aim of entering long trades in oversold conditions and short trades in overbought conditions.
Optionally, you can enable an Exponential Moving Average (EMA) to only allow trading in the direction of the larger trend. Please note that the strategy will not plot the EMA. If you want, for visual confirmation, you can add to the chart an Exponential Moving Average as a second indicator, with the same settings used in the strategy’s built-in EMA.
The strategy also allows you to set internal Stop Loss and Take Profit levels, with the option to choose between Percentage-based TP/SL or ATR-based TP/SL.
The strategy can be adapted to multiple assets and timeframes:
Pick an asset and a timeframe
Zoom back as far as possible to identify meaningful positive and negative peaks of the CCI
Set Overbought and Oversold at a rough average of the peaks you identified
Adjust TP/SL according to your risk management strategy
Like the strategy? Give it a boost!
Have any questions? Leave a comment or drop me a message.
CAUTIONARY WARNING
Please note that this is a complex trading strategy that involves several inputs and conditions. Before using it in live trading, it is highly recommended to thoroughly test it on historical data and use risk management techniques to safeguard your capital. After backtesting, it's also highly recommended to perform a first live test with a small amount. Additionally, it's essential to have a good understanding of the strategy's behavior and potential risks. Only risk what you can afford to lose .
USED INDICATORS
1 — COMMODITY CHANNEL INDEX (CCI)
The Commodity Channel Index (CCI) is a technical analysis indicator used to measure the momentum of an asset. It was developed by Donald Lambert and first published in Commodities magazine (now Futures) in 1980. Despite its name, the CCI can be used in any market and is not just for commodities. The CCI compares current price to average price over a specific time period. The indicator fluctuates above or below zero, moving into positive or negative territory. While most values, approximately 75%, fall between -100 and +100, about 25% of the values fall outside this range, indicating a lot of weakness or strength in the price movement.
The CCI was originally developed to spot long-term trend changes but has been adapted by traders for use on all markets or timeframes. Trading with multiple timeframes provides more buy or sell signals for active traders. Traders often use the CCI on the longer-term chart to establish the dominant trend and on the shorter-term chart to isolate pullbacks and generate trade signals.
CCI is calculated with the following formula:
(Typical Price - Simple Moving Average) / (0.015 x Mean Deviation)
Some trading strategies based on CCI can produce multiple false signals or losing trades when conditions turn choppy. Implementing a stop-loss strategy can help cap risk, and testing the CCI strategy for profitability on your market and timeframe is a worthy first step before initiating trades.
2 — AVERAGE TRUE RANGE (ATR)
The Average True Range (ATR) is a technical analysis indicator that measures market volatility by calculating the average range of price movements in a financial asset over a specific period of time. The ATR was developed by J. Welles Wilder Jr. and introduced in his book “New Concepts in Technical Trading Systems” in 1978.
The ATR is calculated by taking the average of the true range over a specified period. The true range is the greatest of the following:
The difference between the current high and the current low.
The difference between the previous close and the current high.
The difference between the previous close and the current low.
The ATR can be used to set stop-loss orders. One way to use ATR for stop-loss orders is to multiply the ATR by a factor (such as 2 or 3) and subtract it from the entry price for long positions or add it to the entry price for short positions. This can help traders set stop-loss orders that are more adaptive to market volatility.
3 — EXPONENTIAL MOVING AVERAGE (EMA)
The Exponential Moving Average (EMA) is a type of moving average (MA) that places a greater weight and significance on the most recent data points.
The EMA is calculated by taking the average of the true range over a specified period. The true range is the greatest of the following:
The difference between the current high and the current low.
The difference between the previous close and the current high.
The difference between the previous close and the current low.
The EMA can be used by traders to produce buy and sell signals based on crossovers and divergences from the historical average. Traders often use several different EMA lengths, such as 10-day, 50-day, and 200-day moving averages.
The formula for calculating EMA is as follows:
Compute the Simple Moving Average (SMA).
Calculate the multiplier for weighting the EMA.
Calculate the current EMA using the following formula:
EMA = Closing price x multiplier + EMA (previous day) x (1-multiplier)
STRATEGY EXPLANATION
1 — INPUTS AND PARAMETERS
The strategy uses the Commodity Channel Index (CCI) with additional options for an Exponential Moving Average (EMA), Take Profit (TP) and Stop Loss (SL).
length : The period length for the CCI calculation.
overbought : The overbought level for the CCI. When CCI crosses above this level, it may signal a potential short entry.
oversold : The oversold level for the CCI. When CCI crosses below this level, it may signal a potential long entry.
useEMA : A boolean input to enable or disable the use of Exponential Moving Average (EMA) as a filter for long and short entries.
emaLength : The period length for the EMA if it is used.
2 — CCI CALCULATION
The CCI indicator is calculated using the following formula:
(src - ma) / (0.015 * ta.dev(src, length))
src is the typical price (average of high, low, and close) and ma is the Simple Moving Average (SMA) of src over the specified length.
3 — EMA CALCULATION
If the useEMA option is enabled, an EMA is calculated with the given emaLength .
4 — TAKE PROFIT AND STOP LOSS METHODS
The strategy offers two methods for TP and SL calculations: percentage-based and ATR-based.
tpSlMethod_percentage : A boolean input to choose the percentage-based method.
tpSlMethod_atr : A boolean input to choose the ATR-based method.
5 — PERCENTAGE-BASED TP AND SL
If tpSlMethod_percentage is chosen, the strategy calculates the TP and SL levels based on a percentage of the average entry price.
tp_percentage : The percentage value for Take Profit.
sl_percentage : The percentage value for Stop Loss.
6 — ATR-BASED TP AND SL
If tpSlMethod_atr is chosen, the strategy calculates the TP and SL levels based on Average True Range (ATR).
atrLength : The period length for the ATR calculation.
atrMultiplier : A multiplier applied to the ATR to set the SL level.
riskRewardRatio : The risk-reward ratio used to calculate the TP level.
7 — ENTRY CONDITIONS
The strategy defines two conditions for entering long and short positions based on CCI and, optionally, EMA.
Long Entry: CCI crosses below the oversold level, and if useEMA is enabled, the closing price should be above the EMA.
Short Entry: CCI crosses above the overbought level, and if useEMA is enabled, the closing price should be below the EMA.
8 — TP AND SL LEVELS
The strategy calculates the TP and SL levels based on the chosen method and updates them dynamically.
For the percentage-based method, the TP and SL levels are calculated as a percentage of the average entry price.
For the ATR-based method, the TP and SL levels are calculated using the ATR value and the specified multipliers.
9 — EXIT CONDITIONS
The strategy defines exit conditions for both long and short positions.
If there is a long position, it will be closed either at TP or SL levels based on the chosen method.
If there is a short position, it will be closed either at TP or SL levels based on the chosen method.
Additionally, positions will be closed if CCI crosses back above oversold in long positions or below overbought in short positions.
10 — PLOTTING
The script plots the CCI line along with overbought and oversold levels as horizontal lines.
The CCI line is colored red when above the overbought level, green when below the oversold level, and white otherwise.
The shaded region between the overbought and oversold levels is plotted as well.
Volume Bollinger BandsThis code draws a custom indicator named "Volume Bollinger Bands" on the price chart with the following visual elements:
1. **Basis Line (Blue)**: This line represents the moving average value (ma_value) of the volume data calculated based on the user-selected moving average type (SMA, EMA, or WMA) and length.
2. **Upper Bands (Green)**: The upper bands are calculated by adding a certain multiple of the standard deviation (dev1 to dev11) to the basis line. These bands represent a certain level of volume volatility above the moving average.
3. **Lower Bands (Red)**: The lower bands are calculated by subtracting a certain multiple of the standard deviation (dev1 to dev11) from the basis line. These bands represent a certain level of volume volatility below the moving average.
4. **Volume Line (Yellow)**: This line represents the volume data for the selected timeframe, plotted over the price chart.
The user can customize the following parameters:
- Average Length: The length of the moving average.
- Moving Average Type: The type of moving average to be used (SMA, EMA, or WMA).
- Timeframe: The timeframe used to calculate the volume data.
- Deviation 1 to Deviation 11: Multipliers for calculating the upper and lower bands.
The purpose of this indicator is to visually represent the relationship between volume volatility, moving average, and price movements. Traders can use it to analyze changes in volume trends and potential price breakouts or reversals when the volume moves beyond certain levels of standard deviations from the moving average.
Smoothed Vortex IndicatorThe Smoothed Vortex Indicator (SVI) is an enhanced version of the original Vortex Indicator (VI), designed to provide traders with a more refined and smoother representation of trend strength and potential reversals in financial markets. While both indicators share the same concept of measuring directional movement and true range, the SVI incorporates the Hull Moving Average (HMA) to achieve additional smoothing , differentiating it from the standard Vortex Indicator.
The original Vortex Indicator (VI) consists of two lines, VI+ and VI-, which represent the positive and negative directional movements, respectively. It calculates the True Range (TR), Plus Directional Movement (PDM), and Minus Directional Movement (MDM) over a specified period, usually 14 periods, and then calculate the Simple Moving Averages (SMAs) of VI+ and VI- based on these values.
On the other hand, the Smoothed Vortex Indicator (SVI) utilizes the HMA to improve precision and reduce lag in trend identification. The HMA is itself a weighted moving average of two WMAs and is known for its smoothing characteristics. The SVI first calculates the VI+ and VI- values as in the original VI and then applies the HMA formula to each of these values separately.
To add further flexibility to the SVI, it introduces a user-defined Weighting Factor. This factor allows traders to fine-tune the smoothing effect applied to VI+ and VI-. By multiplying the weighted VI values with the HMA, the SVI ensures a smoother representation of trend strength, making it easier for traders to identify trends and potential reversal points in the market.
In summary, the Smoothed Vortex Indicator (SVI) enhances the original Vortex Indicator by incorporating the Hull Moving Average (HMA) for additional smoothing and introducing a customizable Weighting Factor. This improved version provides traders with a more refined and visually smoother indicator, aiding them in making better-informed trading decisions based on trend strength and possible market reversals.
Price Change RatePrice Change Rate (PCR)
Description:
The "Price Change Rate" (PCR) indicator is a customized tool designed to visualize the rate of price change over different periods. The PCR indicator plots three separate lines, each representing a distinct length of time. Each line represents the percentage change in price from the start of its designated period.
Usage:
Setting up the indicator:
To use the PCR indicator, simply add it to your TradingView chart. In the settings panel, you will find three different lengths to input: Length 1, Length 2, Length 3. These lengths represent the periods (in days) over which the price change is calculated. Input your desired lengths for each.
Understanding the output:
The Price Change Rate 1 line (colored in red) represents the rate of price change over the period defined in Length 1.
The Price Change Rate 2 line (colored in green) represents the rate of price change over the period defined in Length 2.
The Price Change Rate 3 line (colored in blue) represents the rate of price change over the period defined in Length 3.
The lines move in accordance with the rate of price change. For example, if the Price Change Rate 1 line is above 0, it means the price has increased in the period defined in Length 1.
Purpose:
The purpose of the PCR indicator is to give a visual representation of how the price of an asset is changing over multiple periods. By comparing the three lines, you can get a sense of the momentum of the price change and potentially identify trends or shifts in market sentiment.
Limitations:
Like all indicators, the PCR should not be used in isolation. Consider combining it with other indicators and tools to improve the accuracy of your analysis.
Remember, historical performance is not indicative of future results. Always use proper risk management and ensure your strategies align with your investment goals.
RSI Supreme Multi-Method [MyTradingCoder]Introducing the "RSI Supreme Multi-Method" indicator, a powerful tool that combines the Relative Strength Index (RSI) with selectable manipulation methods to identify overbought and oversold conditions in the market, along with the ability to detect divergences for enhanced trading insights.
The indicator features four distinct manipulation methods for the RSI, each providing valuable insights into market conditions:
1. Standard RSI Method: The indicator uses the traditional RSI calculation to identify overbought and oversold areas.
2. Volatility Weighted RSI Method: This method applies a volatility formula to the RSI calculation, allowing for a more responsive indication of market conditions during periods of heightened volatility. Users can adjust the length of the volatility formula to fine-tune this method.
3. Smoothed RSI Method: The smoothed RSI method utilizes a smoothing algorithm to reduce noise in the RSI values, presenting a clearer representation of overbought and oversold conditions. The length of the smoothing can be adjusted to match your trading preferences.
4. Session Weighted RSI Method: With this innovative method, users can specify multipliers for different time sessions throughout the day to manipulate the base RSI. Each session can be customized with start and end times, enabling or disabling specific sessions, and specifying the multiplier for each session. This feature allows traders to adapt the RSI to different market sessions dynamically.
Additionally, the "RSI Supreme Multi-Method" indicator draws divergences on the oscillator, providing an extra layer of analysis for traders. Divergences occur when the direction of the RSI differs from the direction of the price movement, potentially signaling trend reversals.
Key Settings:
RSI Length: Adjust the length of the base RSI before applying any manipulation.
RSI Source: Determine the data source for the base RSI calculation.
Overbought Value: Set the RSI value at which overbought conditions are indicated.
Oversold Value: Set the RSI value at which oversold conditions are indicated.
RSI Type: Choose from four options: Standard, Smoothed, Volatility Manipulated, or Session Manipulated.
Volatility Manipulated Settings: Adjust the length of the volatility formula (applicable to Volatility Manipulated method).
Smoothed Settings: Adjust the length of the smoothing (applicable to Smoothed method).
Session Manipulated Settings: Customize six different time sessions with start and end times, enable or disable specific sessions, and specify multipliers for each session.
Divergence Color: Adjust the color of the drawn divergences to suit your chart's aesthetics.
Divergence Tuning: Fine-tune the sensitivity of the divergence detection for more accurate signals.
The "RSI Supreme Multi-Method" indicator is a versatile and comprehensive tool that can be used to identify overbought and oversold areas, as well as to spot potential trend reversals through divergences. However, like all technical analysis tools, it should be used in conjunction with other indicators and analysis methods to make well-informed trading decisions.
Enhance your trading insights with the "RSI Supreme Multi-Method" indicator and gain an edge in identifying critical market conditions and divergences with precision.
Quantitative Trend Strategy- Uptrend longTrend Strategy #1
Indicators:
1. SMA
2. Pivot high/low functions derived from SMA
3. Step lines to plot support and resistance based on the pivot points
4. If the close is over the resistance line, green arrows plot above, and vice versa for red arrows below support.
Strategy:
1. Long Only
2. Mutable 2% TP/1.5% SL
3. 0.01% commission
4. When the close is greater than the pivot point of the sma pivot high, and the close is greater than the resistance step line, a long position is opened.
*At times, the 2% take profit may not trigger IF; the conditions for reentry are met at the time of candle closure + no exit conditions have been triggered.
5. If the position is in the green and the support step line crosses over the resistance step line, positions are exited.
How to use it and what makes it unique:
Use this strategy to trade an up-trending market using a simple moving average to determine the trend. This strategy is meant to capture a good risk/reward in a bullish market while staying active in an appropriate fashion. This strategy is unique due to it's inclusion of the step line function with statistics derived from myself.
This description tells the indicators combined to create a new strategy, with commissions and take profit/stop loss conditions included, and the process of strategy execution with a description on how to use it. If you have any questions feel free to PM me and boost if you enjoyed it. Thank you, pineUSERS!
Average True Range Trailing Mean [Alifer]Upgrade of the Average True Range default indicator by TradingView. It adds and plots a trailing mean to show periods of increased volatility more clearly.
ATR TRAILING MEAN
A trailing mean, also known as a moving average, is a statistical calculation used to smooth out data over time and identify trends or patterns in a time series.
In our indicator, it clearly shows when the ATR value spikes outside of it's average range, making it easier to identify periods of increased volatility.
Here's how the ATR Trailing Mean (atr_mean) is calculated:
atr_mean = ta.cum(atr) / (bar_index + 1) * atr_mult
The ta.cum() function calculates the cumulative sum of the ATR over all bars up to the current bar.
(bar_index + 1) represents the number of bars processed up to the current bar, including the current one.
By dividing the cumulative ATR ta.cum(atr) by (bar_index + 1) and then multiplying it by atr_mult (Multiplier), we obtain the ATR Trailing Mean value.
If atr_mult is set to 1.0, the ATR Trailing Mean will be equal to the simple average of the ATR values, and it will follow the ATR's general trend.
However, if atr_mult is increased, the ATR Trailing Mean will react more strongly to the ATR's recent changes, making it more sensitive to short-term fluctuations.
On the other hand, reducing atr_mult will make the ATR Trailing Mean less responsive to recent changes in ATR, making it smoother and less prone to reacting to short-term volatility.
In summary, adjusting the atr_mult input allows traders to fine-tune the ATR Trailing Mean's responsiveness based on their preferred level of sensitivity to recent changes in market volatility.
IMPLEMENTATION IN A STRATEGY
You can easily implement this indicator in an existing strategy, to only enter positions when the ATR is above the ATR Trailing Mean (with Multiplier-adjusted sensitivity). To do so, add the following lines of codes.
Under Inputs:
length = input.int(title="Length", defval=20, minval=1)
atr_mult = input.float(defval=1.0, step = 0.1, title = "Multiplier", tooltip = "Adjust the sensitivity of the ATR Trailing Mean line.")
smoothing = input.string(title="Smoothing", defval="RMA", options= )
ma_function(source, length) =>
switch smoothing
"RMA" => ta.rma(source, length)
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
=> ta.wma(source, length)
This will allow you to define the Length of the ATR (lookback length over which the ATR is calculated), the Multiplier to adjust the Trailing Mean's sensitivity and the type of Smoothing to be used for the ATR.
Under Calculations:
atr= ma_function(ta.tr(true), length)
atr_mean = ta.cum(atr) / (bar_index+1) * atr_mult
This will calculate the ATR based on Length and Smoothing, and the resulting ATR Trailing Mean.
Under Entry Conditions, add the following to your existing conditions:
and atr > atr_mean
This will make it so that entries are only triggered when the ATR is above the ATR Trailing Mean (adjusted by the Multiplier value you defined earlier).
ATR - DEFINITION AND HISTORY
The Average True Range (ATR) is a technical indicator used to measure market volatility, regardless of the direction of the price. It was developed by J. Welles Wilder and introduced in his book "New Concepts in Technical Trading Systems" in 1978. ATR provides valuable insights into the degree of price movement or volatility experienced by a financial asset, such as a stock, currency pair, commodity, or cryptocurrency, over a specific period.
ATR - CALCULATION AND USAGE
The ATR calculation involves three components:
1 — True Range (TR): The True Range is a measure of the asset's price movement for a given period. It takes into account the following factors:
The difference between the high and low prices of the current period.
The absolute value of the difference between the high price of the current period and the closing price of the previous period.
The absolute value of the difference between the low price of the current period and the closing price of the previous period.
Mathematically, the True Range (TR) for the current period is calculated as follows:
TR = max(high - low, abs(high - previous_close), abs(low - previous_close))
2 — ATR Calculation: The ATR is calculated as a Moving Average (MA) of the True Range over a specified period.
The ATR is calculated as follows:
ATR = MA(TR, length)
3 — ATR Interpretation: The ATR value represents the average volatility of the asset over the chosen period. Higher ATR values indicate higher volatility, while lower ATR values suggest lower volatility.
Traders and investors can use ATR in various ways:
Setting Stop Loss and Take Profit Levels: ATR can help determine appropriate stop-loss and take-profit levels in trading strategies. A larger ATR value might require wider stop-loss levels to allow for the asset's natural price fluctuations, while a smaller ATR value might allow for tighter stop-loss levels.
Identifying Market Volatility: A sharp increase in ATR might indicate heightened market uncertainty or the potential for significant price movements. Conversely, a decreasing ATR might suggest a period of low volatility and possible consolidation.
Comparing Volatility Between Assets: Since ATR uses absolute values, it shouldn't be used to compare volatility between different assets, as assets with higher prices will consistently have higher ATR values, while assets with lower prices will consistently have lower ATR values. However, the addition of a trailing mean makes such a comparison possible. An asset whose ATR is consistently close to its ATR Trailing Mean will have a lower volatility than an asset whose ATR continuously moves far above and below its ATR Trailing Mean. This can help traders and investors decide which markets to trade based on their risk tolerance and trading strategies.
Determining Position Size: ATR can be used to adjust position sizes, taking into account the asset's volatility. Smaller position sizes might be appropriate for more volatile assets to manage risk effectively.
Dynamic Trendline Break - Strategy [presentTrading]- Introduction and How It Is Different
The Dynamic Trendline Break Strategy is a unique trading algorithm that leverages the power of trendlines and swing detection to identify potential trading opportunities.
Unlike traditional trendline strategies that rely on static trendlines, this strategy dynamically calculates trendlines based on pivot highs and lows.
This dynamic approach allows the strategy to adapt to changing market conditions (especially 24hr markets like Crypto) and potentially identify trading opportunities that static trendlines might miss.
BTCUSD 6hr chart
Tencent 700.HK 1D chart
- Strategy, How It Works
The strategy works by first identifying pivot highs and lows using a lookback period defined by the user. These pivot points are then used to calculate the slope of the trendlines. The slope calculation method can be chosen from three options: Average True Range (ATR), Standard Deviation (Stdev), or Linear Regression (Linreg), providing flexibility to the trader.
Once the trendlines are calculated, the strategy identifies potential trading opportunities when the price crosses over the upper trendline (for long trades) or crosses under the lower trendline (for short trades). The strategy also allows the user to define the trade direction (Long, Short, or Both) and the stop loss method (Fixed or SuperTrend).
- Trade Direction
The trade direction parameter allows the user to define the direction of the trades that the strategy will take. If set to "Long", the strategy will only take long trades when the price crosses over the upper trendline. If set to "Short", the strategy will only take short trades when the price crosses under the lower trendline. If set to "Both", the strategy will take both long and short trades.
- Usage
To use this strategy, simply input your desired parameters for the swing detection lookback, slope, slope calculation method, trade direction, stop loss method, and stop loss level. Once these parameters are set, the strategy will automatically calculate the trendlines and identify potential trading opportunities based on the defined parameters.
- Default Settings
The default settings for the strategy are as follows:
Swing Detection Lookback: 30
Slope: 0.618
Slope Calculation Method: ATR
Trade Direction: Both
Stop Loss Method: SuperTrend
Stop Loss Level: 15%
SuperTrend Factor: 3
SuperTrend Lookback: 21
These settings can be adjusted to suit your trading style and risk tolerance. Always remember to backtest any changes to the settings before live trading.