TrendGuard Flag Finder - Strategy [presentTrading]
Introduction and How It Is Different
In the vast world of trading strategies, the TrendGuard Flag Finder stands out as a unique blend of traditional flag pattern detection and the renowned SuperTrend indicator.
- A significant portion of the Flag Pattern detection is inspired by the "Flag Finder" code by @Amphibiantrading, which serves as one of foundational element of this strategy.
- While many strategies focus on either trend-following or pattern recognition, this strategy harmoniously combines both, offering traders a more holistic view of the market.
- The integration of the SuperTrend indicator not only provides a clear direction of the prevailing trend but also offers potential stop-loss levels, enhancing the strategy's risk management capabilities.
AAPL 1D chart
ETHBTC 6hr chart
Strategy: How It Works
The TrendGuard Flag Finder is primarily built on two pillars:
1. Flag Pattern Detection : At its core, the strategy identifies flag patterns, which are continuation patterns suggesting that the prevailing trend will resume after a brief consolidation. The strategy meticulously detects both bullish and bearish flags, ensuring traders can capitalize on opportunities in both rising and falling markets.
What is a Flag Pattern? A flag pattern consists of two main components:
1.1 The Pole : This is the initial strong price move, which can be either upwards (for bullish flags) or downwards (for bearish flags). The pole represents a strong surge in price in a particular direction, driven by significant buying or selling momentum.
1.2 The Flag : Following the pole, the price starts consolidating, moving against the initial trend. This consolidation forms a rectangular shape and is characterized by parallel trendlines. In a bullish flag, the consolidation will have a slight downward tilt, while in a bearish flag, it will have a slight upward tilt.
How the Strategy Detects Flags:
Identifying the Pole: The strategy first identifies a strong price movement over a user-defined number of bars. This movement should meet a certain percentage change to qualify as a pole.
Spotting the Flag: After the pole is identified, the strategy looks for a consolidation phase. The consolidation should be counter to the prevailing trend and should be contained within parallel lines. The depth (for bullish flags) or rally (for bearish flags) of this consolidation is calculated to ensure it meets user-defined criteria.
2. SuperTrend Integration : The SuperTrend indicator, known for its simplicity and effectiveness, is integrated into the strategy. It provides a dynamic line on the chart, signaling the prevailing trend. When prices are above the SuperTrend line, it's an indication of an uptrend, and vice versa. This not only confirms the flag pattern's direction but also offers a potential stop-loss level for trades.
When combined, these components allow traders to identify potential breakout (for bullish flags) or breakdown (for bearish flags) scenarios, backed by the momentum indicated by the SuperTrend.
Usage
To use the SuperTrend Enhanced Flag Finder:
- Inputs : Begin by setting the desired parameters. The strategy offers a range of user-controlled settings, allowing for customization based on individual trading preferences and risk tolerance.
- Visualization : Once the parameters are set, the strategy will identify and visually represent flag patterns on the chart. Bullish flags are represented in green, while bearish flags are in red.
- Trade Execution : When a breakout or breakdown is identified, the strategy provides entry signals. It also offers exit signals based on the SuperTrend, ensuring that traders can capitalize on the momentum while managing risk.
Default Settings
The strategy comes with a set of default settings optimized for general use:
- SuperTrend Parameters: Length set to 10 and Factor set to 5.0.
- Bull Flag Criteria: Max Flag Depth at 7, Max Flag Length at 10 bars, Min Flag Length at 3 bars, Prior Uptrend Minimum at 9%, and Flag Pole Length between 7 to 13 bars.
- Bear Flag Criteria: Similar settings adjusted for bearish patterns.
- Display Options: By default, both bullish and bearish flags are displayed, with breakout and breakdown points highlighted.
Volatility
nVPSA - Normalized Volume-Price Spread AnalysisNormalized volume-price spread analysis indicator can be helpfully tool in Tom's William metodology - VSA.
The indicator use normalized data by y/x(max) operation, where x(max) is the biggest value in range. Indicator separate spread to four levels - standard divation is separator.
The indicator graphically shows:
- normalized volume, visualized by wide column,
- normalized price spread, visualized by narrow column,
- linear regression calculated from normalized volume, visualised by crosses,
- linear regression from normalized price spread, visualized by circles.
Columns are marked by five colors according to standard deviation:
- blue xsecond deviation, xfourth deviation,
- gold when volume or price spread achive new maximum in analysis range.
Linear regression uses three colors:
- green when volume/spread is up bar by bar,
- red when volume/spread is down bar by bar,
- black when volume/spread is down two times bar by bar.
Additionally, it is posible to use alarm on Golden Bar. Colors and range values are editable from indicator settings.
Bar Color Long / Short Indicator With Advised SL Rev 1This is the Revised Version of Bar Color Long / Short Indicator With Advised SL with some extra features
Overview
This script is a trading indicator named "Bar Color Long / Short Indicator With Advised SL" designed for the TradingView platform. The indicator's primary purpose is to provide entry signals for long and short positions, based on various technical analysis methods. Additionally, the indicator suggests stop-loss levels for both long and short positions.
User Inputs
The indicator has several user inputs, such as:
Length
Smoothing
Multiplier
Show bar colors (ON/OFF)
When the bar colors are turned off, the alert signals for long and short positions will be displayed instead.
Custom Risk Calculation
The script calculates a custom risk level based on a modified version of the RSI (Relative Strength Index) formula. The custom risk level is divided into three categories: low, medium, and high.
Sentiment Score Calculation
The indicator calculates a sentiment score based on a combination of methods resembling EMA (Exponential Moving Average), MACD (Moving Average Convergence Divergence), and ROC (Rate of Change). The sentiment score is used to determine if the sentiment is positive or negative.
Bollinger Bands Percent and Combined Signal
The Bollinger Bands Percent is calculated, and the custom risk, sentiment score, and Bollinger Bands Percent are combined to generate a new signal. This signal is used in conjunction with EMA10 to determine the bar colors and provide entry signals.
Bar Colors
Based on the combined signal and EMA10, the script determines the bar colors as follows:
Orange: Positive sentiment
Blue: Negative sentiment
Gray: Neutral
Entry Signals and Alerts
When the bar colors are turned off, the indicator displays large green arrow signals for long (buy) positions and red arrow signals for short (sell) positions based on the sentiment and EMA10 conditions. The script also includes alert conditions for long and short signals, which can be used to set up notifications when these signals are triggered in the TradingView platform.
Advised Stop-Loss Levels
The indicator plots stop-loss lines for both long and short positions at the last candle, accompanied by labels showing the advised stop-loss levels in numeric values
Rev 1
added / changed :
SMA50 slope check
EMA20 higher or lower than EMA10
color ON/OFF changed
Signal once Buy and Sell
Liquidity Breakout - Strategy [presentTrading]- Introduction and How It Is Different
The Liquidity Breakout Strategy is a unique trading strategy that focuses on identifying and leveraging patterns in market price data. This strategy, mainly inspired by the script "Master Pattern" by LuxAlgo, takes a different approach from many traditional strategies that rely on technical indicators or fundamental analysis. Instead, the Liquidity Breakout is based on the concept of contraction detection and liquidity levels. This approach allows traders to identify potential trading opportunities that other strategies might miss.
BTCUSDT 6h
The strategy is different from other trading strategies because it uses a unique combination of pattern detection, liquidity levels, and user-defined trading direction. This combination allows the strategy to adapt to various market conditions and trading styles, making it a versatile tool for traders.
- Strategy: How It Works
1. Contraction Detection: The strategy uses a lookback period defined by the user (default is 10 bars) to identify contractions in the market. A contraction is a period where the market is consolidating, often followed by a significant price movement. The strategy identifies contractions by finding pivot highs and pivot lows within the lookback period. If a pivot high is lower than the previous pivot high and a pivot low is higher than the previous pivot low, a contraction is detected.
2. liquidity Levels:
What are Liquidity levels? Liquidity levels, also known as liquidity pools or zones, are price levels at which there is a significant amount of trading activity. They are often areas where large institutional traders (like banks or hedge funds) have placed orders. These levels are important because they can act as support or resistance levels, and price often reacts at these levels.
In the context of this strategy, liquidity levels are used to identify potential entry and exit points for trades. When the price reaches a liquidity level, it could indicate a potential trading opportunity. For example, if the price breaks through a liquidity level, it could signal the start of a new trend. On the other hand, if the price approaches a liquidity level and then reverses, it could signal a potential reversal.
The strategy uses these two elements to identify potential trading opportunities. When a contraction is detected, the strategy will look for a breakout in the direction of the trend. If the breakout occurs at a liquidity level, the strategy will execute a trade.
The strategy also allows traders to set their stop loss based on either the Average True Range (ATR) or a fixed percentage. This flexibility allows traders to manage their risk according to their personal risk tolerance and trading style.
- Trade Direction
One of the unique features of the Master Pattern Strategy is the ability to choose the trading direction. Traders can choose to trade in the "Long" direction, the "Short" direction, or "Both". This feature allows traders to adapt the strategy to their personal trading style and market outlook.
For example, if a trader believes that the market is in an uptrend, they can choose to trade only in the "Long" direction. Conversely, if the market is in a downtrend, they can choose to trade only in the "Short" direction. If the trader believes that the market is volatile and there are opportunities in both directions, they can choose to trade in "Both" directions.
- Usage
To use the strategy, traders need to input their preferred settings, including the contraction detection lookback period, liquidity levels, stop loss type, and trading direction. Once these settings are input, the strategy will automatically detect potential trading opportunities and execute trades according to the defined parameters.
- Default Settings
The default settings for the Master Pattern Strategy are as follows:
Contraction Detection Lookback: 10
Liquidity Levels: 20
Stop Loss Type: ATR
ATR Length: 20
ATR Multiplier: 3.0
Fixed Percentage: 0.01
Trading Direction: Both
These settings can be adjusted according to the trader's personal preferences and market conditions. It's recommended that traders experiment with different settings to find the ones that work best for their trading style and goals.
ATR LevelsThe indicator calculates and displays key levels based on the Average True Range (ATR) of an asset's price. The ATR is a measure of market volatility, and this indicator uses it to create trigger levels and ATR target levels. The "ATR Levels" indicator helps traders identify potential entry and exit points based on market volatility, providing valuable information for their trading decisions.
The indicator adds text labels to indicate whether the levels are for "Puts" or "Calls" on the trigger levels, and "Target 1" or "Target 2" on the ATR target levels.
Input Description:
ATR Length: This is an input parameter that allows the user to set the number of periods used to calculate the Average True Range (ATR). The ATR measures the market's volatility, and a higher length value will result in a smoother ATR line.
Trigger Percentage: Another input parameter that determines the percentage above and below the previous day's close at which the trigger levels will be plotted. It allows traders to set the sensitivity of the trigger levels.
Lower Trigger Level Color and Upper Trigger Level Color: These input parameters allow the user to customize the colors of the trigger levels. The indicator will plot two lines representing the lower and upper trigger levels.
Level Size: This input parameter allows the user to adjust the thickness of the trigger level lines.
ATR Target Color: An input parameter that sets the color for the ATR target level lines.
ATR Target Multiplier 1 and ATR Target Multiplier 2: These are input parameters that allow the user to set the multiplier for calculating the ATR target levels. The indicator will plot two ATR target lines above and below the previous day's close, each multiplied by the specified multiplier.
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
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.
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.
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.
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.
Consolidation Finder Expo [serkany88]It's relatively easy to create a repainting system where you can detect consolidation but it can be pretty hard to detect breakouts while the consolidation is happening live. This experimental approach came to my mind after brainstorming a bit.
What it does
This indicator DOES NOT REPAINT and try to show consolidation zones by coloring the bars or background to a selected color(default white)
How it works
In this approach we use weighted standard deviation of Vidya (Variable Index Dynamic Average created by Tushar Chande). The reason we use vidya is it's length is actually being adapted to volatility and lookback is dynamically adjusted. After getting vidya of base we also create same length vidya of high's and low's and get weighted standard deviation of those. After this we add and subtract those with base vidya and and get their average with our multiplier weight starting from the first bar. If our current value is higher than the average it means we are not in consolidation, else we are thus the bar and background will be painted.
How to use
Consolidation Finder can be used with your existing bot strategy as an additional filter or can be used with your manual trading system as an additional filter or detect breakouts. But be aware that you might need to tinker with length and multipliers in the settings depending on your timeframe to get best results possible before using it reliably. You can also enable the plots of vidya's from the style tab which is disabled by default to see how the deviations actually move if you are interested in it.