OPEN-SOURCE SCRIPT

ATR Bands (Keltner Channel), Wick and SRSI Signals [MW]

تم تحديثه
Introduction
This indicator uses a novel combination of ATR Bands, candle wicks crossing the ATR upper and lower bands, and baseline, and combines them with the Stochastic SRSI oscillator to provide early BUY and SELL signals in uptrends, downtrends, and in ranging price conditions.


How it’s unique
People generally understand Bollinger Bands and Keltner Channels. Buy at the bottom band, sell at the top band. However, because the bands themselves are not static, impulsive moves can render them useless. People also generally understand wicks. Candles with large wicks can represent a change in pattern, or volatile price movement. Combining those two to determine if price is reaching a pivot point is relatively novel. When Stochastic RSI (SRSI) filtering is also added, it becomes a genuinely unique combination that can be used to determine trade entries and exits.


What’s the benefit
The benefit of the indicator is that it can help potentially identify pivots WHEN THEY HAPPEN, and with potentially minimal retracement, depending on the trader’s time window. Many indicators wait for a trend to be established, or wait for a breakout to occur, or have to wait for some form of confirmation. In the interpretation used by this indicator, bands, wicks, and SRSI cycles provide both the signal and confirmation.

It takes into account 3 elements:

  1. Price approaching the upper or lower band or the baseline - MEANING: Price is becoming extended based on calculations that use the candle trading range.
  2. A candle wick of a defined proportion (e.g. wick is 1/2 the size of a full candle OR candle body) crosses a band or baseline, but the body does not cross the band or baseline - MEANING: Buyers and sellers are both very active.
  3. The Stochastic RSI reading is above 80 for SELL signals and below 20 for BUY signals - MEANING: Additional confirmation that price is becoming extended based on the current cyclic price pattern.



How to Use
SIGNALS
Buy Signals - Green(ish):
B Signal - Potential pivot up from the lower band when using the preferred multiplier
B1 Signal - Potential pivot up from the lower band when using phi * multiplier
B2 Signal - Potential pivot up from the lower band when using 1/2 * multiplier
B3 Signal - Potential pivot up from baseline

Sell Signals - Red(ish):
S Signal - Potential pivot down from the upper band when using the preferred multiplier
S1 Signal - Potential pivot down from the upper band when using
S2 Signal - Potential pivot down from the upper band when using 1/2 * multiplier
S3 Signal - Potential pivot down from the baseline

DISCUSSION
During an uptrend or downtrend, signals from the baseline can help traders identify areas where they may enter the trending move with the least amount of drawdown. In both cases, entry points can occur with baseline signals in the direction of the trend.

For example, in an uptrend (when the price is forming higher highs and higher lows, or when the baseline is rising), price tends to oscillate between the upper band and baseline. In this case, the baseline BUY signal (B3) can show an entry point.

In a downtrend (when the price is forming lower highs and lower lows, or when the baseline is falling), price tends to oscillate between the baseline and the lower band. In this case, the baseline SELL signal (S3) can show an entry point.

During consolidation, when price is ranging, price tends to oscillate between the upper and lower bands, while crossing through the baseline unperturbed. Here, entry points can occur at the upper and lower bands.

When all conditions are met at the lower band during consolidation, a BUY signal (B), can occur. This signal may also occur prior to a break out of consolidation to the upside.

When all conditions are met at the upper band during consolidation, a SELL signal (S), can occur. This signal may also occur prior to a break out of consolidation to the downside.

Additional B1, B2, and S1, and S2 signals can be displayed that use the bands based on a multiplier that is half that of the primary one, and phi (0.618) times the primary multiplier as a way to quickly check for signals occurring along different, but related, bands.


Calculations
ATR Bands, or Keltner Channels, are a technical analysis tool that are used to measure market volatility and identify overbought or oversold conditions in the trading of financial instruments, such as stocks, bonds, commodities, and currencies. ATR Bands consist of three lines plotted on a price chart:

Middle Band, Basis, or Baseline: This is typically a simple moving average (SMA) of the closing prices over a certain period. It represents the intermediate-term trend of the asset's price.
Upper Band: This is calculated by adding a certain number of ATRs to the middle band (SMA). The upper band adjusts itself with the increase in volatility.
Lower Band: This is calculated by subtracting the same number of ATRs from the middle band (SMA). Like the upper band, the lower band adjusts to changes in volatility.

The candle wick signals occur if the wick is at the specified ratio compared to either the entire candle or the candle body. The upper band, lower band, and baseline signals happen if the wick is the specified ratio of the total candle size. For the major signals for upper and lower bands, these occur when the wick extends outside of the bands while closing a candle inside of the bands. For the baseline signals, they occur if a wick crosses a baseline but closes on the other side.

Settings

CHANNEL SETTINGS
  • Baseline EMA Period (Default: 21): Period length of the moving average basis line.
  • ATR Period (Default: 21): The number of periods over which the Average True Range (ATR) is calculated.
  • Basis MA Type (Default: SMA): The moving average type for the basis line.
  • Multiplier (Default: 2.5: The deviation multiplier used to calculate the band distance from the basis line.


ADDITIONAL CHANNELS
  • Half of Multiplier Offset (Default: True): Toggles the display of the ATR bands that are set a distance of half of the ATR multiplier.
  • Quarter of Multiplier Offset (Default: false): Toggles the display of the ATR bands that are set a distance of one quarter of the ATR multiplier.
  • Phi (Φ) Offset (Default: false): Toggles the display of the ATR bands that are set a distance of phi (Φ) times the ATR multiplier.


WICK SETTINGS FOR CANDLE FILTERS
  • Wick Ratio for Bands (Default: 0.4): The ratio of wick size to total candle size for use at upper and lower bands.
  • Wick Ratio for Baseline (Default: 0.4): The ratio of wick size to total candle size for use at baseline.
  • Use Candle Body (rather than full candle size) (Default: false): Determines whether wick calculations use the candle body or the entire candle size.


VISUAL PREFERENCES - SIGNALS
  • Show Signals (Default: true): Allows signal labels to be shown.
  • Show Signals from 1/2 Band Offset (Default: false): Toggle signals originating from 1/2 offset upper and lower bands.
  • Show Signals from Phi (Φ) Band Offset (Default: false): Toggle signals originating from phi (Φ) offset upper and lower bands.
  • Show Baseline Signals (Default: false): Toggle Baseline signals.


VISUAL PREFERENCES - BANDS
  • Show ATR (Keltner) Bands (Default: true): Use a background color inside the Bollinger Bands.
  • Fill Bands (Default: true): Use a background color inside the Bollinger Bands.


STOCHASTIC SETTINGS
  • Use Stochastic RSI Filtering (Default: False): This will only trigger some SELL signals when the stochastic RSI is above 80, and BUY signals when below 20.
  • K (Default: 3): The smoothing level for the Stochastic RSI.
  • RSI Length (Default: 14): The period length for the RSI calculation.
  • Stochastic Length (Default: 8): The period length over which the stochastic calculation is performed.



Other Usage Notes and Limitations
To understand future price movement, this indicator assumes that 3 things must be known:

  1. Evidence of a change of market structure. This can be demonstrated by increased volatility, consolidation, volume spikes (which can be tracked with the MW Volume Impulse Indicator) or, in the case of this indicator, candle wicks.
  2. The potential cause of the change. It could be a VWAP line (which can be tracked with the Multi VWAP [MW], and Multi VWAP from Gaps [MW] indicators), an event, an important support or resistance level, a key moving average, or many other things. This indicator assumes the ATR bands can be a cause.
  3. The current position in the price cycle. Oscillators like the RSI, and MACD, are typical measures of price oscillation (other oscillators like the Price and Volume Stochastic Divergence [MW] indicator can also be useful). This indicator uses the Stochastic RSI oscillator to determine overbought and oversold conditions.


When evidence of the change appears, and the potential cause of the change is identified, and the price oscillation is at a favorable position for the desired trading direction, this indicator will generate a signal.

ATR Bands (or Keltner Channels) are used to determine when price might “revert to the mean”. Crossing, or being near the upper or lower band, can indicate an overbought or oversold condition, which could lead to a price reversal. By tracking the behavior of candle wicks during these events, we can see how active the battle is between buyers and sellers.

If the top of a wick is large, it may indicate that sellers are aggressively attempting to bring the price down. Conversely, if the bottom wick is large, it can indicate that buyers are actively trying to counter the price action caused by selling pressure.

When this wicking action occurs at times when price is not near the upper band, lower band, or baseline, it could indicate the presence of an important level. That could mean a nearby VWAP line, a supply or demand zone, a round price number, or a number of other factors. In any case, this wick may be the first indication of a price reversal.

Shorter baseline periods may be better for short period trading like scalping or day trading, while longer period baselines can show signals that are better suited to swing trading, or longer term investing.

It's important for traders to be aware of the limitations of any indicator and to use them as part of a broader, well-rounded trading strategy that includes risk management, fundamental analysis, and other tools that can help with reducing false signals, determining trend direction, and providing additional confirmation for a trade decision. Diversifying strategies and not relying solely on one type of indicator or analysis can help mitigate some of these risks.

The TradingView platform allows a maximum of 500 labels per chart. This means that if your settings allow for a lot of signals, labels for earlier ones may not appear if the total number of labels exceeds 500 for the chart.
ملاحظات الأخبار
v1.1
  • Added a Timeframe Extender that turns each candle into a candle that represents a longer timeframe. For example, in the 5 minute timeframe, a Timeframe Extender value of 3 uses a candle that represents a candle for the previous 5 x 3 minutes - 15 minutes. In this case, we're using the wicks for 15 minute candles for EVERY candle. This provides a way to account for wicking that might otherwise not be captured in the current timeframe.
  • Fixed a bug with the smoothing of Half and Phi bands
  • Added color coding to the baseline to indicate uptrends, downtrends, and consolidation using 3 EMAs. If the EMAs are in order (Fast, Mid, Slow), then an uptrend color is used. If the EMAs are in reverse order (Slow, Mid, Fast), then a downtrend color is used. Otherwise, a neutral color is used, which identifies consolidation, or a ranging pattern. This was added because it seemed that the wicking of a baseline during a trend seems to often be a good indicator of a trend continuation.
  • Increased the size of the Baseline Signal labels
ملاحظات الأخبار
v1.11
  • Revised image for indicator description
ATRAverage True Range (ATR)keltnerchannelKeltner Channels (KC)signalsStochastic RSI (STOCH RSI)wick

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعد‎‎قوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟


يعمل أيضًا:

إخلاء المسؤولية