OPEN-SOURCE SCRIPT

Custom EMA/ATR/Keltner/Bollinger with Squeeze Setup

21-EMA and ATR-Based Analysis
21-EMA (Exponential Moving Average):

Acts as a dynamic support/resistance level.
The price's relationship with the 21-EMA is used to detect trends and potential reversals.
ATR (Average True Range):

Measures volatility.
Used to define price thresholds for buy/sell conditions (e.g., price not more than 1 ATR above 21-EMA for a buy signal).
2. Bollinger Bands and Keltner Channels for Squeeze Setup
Bollinger Bands (BB):

Calculated using a 20-period simple moving average and standard deviations.
Represents high and low volatility zones.
Keltner Channels (KC):

Based on a 20-period EMA and ATR.
Provides narrower channels for price action compared to Bollinger Bands.
Squeeze Condition:

Occurs when Bollinger Bands fall inside Keltner Channels, signaling low volatility.
These periods often precede significant price movements (breakouts).
3. Momentum Indicator (MACD Histogram)
MACD Histogram:
Measures momentum during a squeeze.
Positive histogram values suggest bullish momentum, while negative values suggest bearish momentum.
Used to predict breakout direction from a squeeze.
4. RSI (Relative Strength Index) for Overbought/Oversold Conditions
Buy Signal:
RSI below 50 indicates a potential oversold condition, supporting a buy signal.
Sell Signal:
RSI above 80 indicates overbought conditions, supporting a sell signal.
5. Buy/Sell Signal Conditions
Buy Signal:

Price is not more than 1 ATR above the 21-EMA.
RSI is below 50 (oversold).
Price touches the 21-EMA within a small tolerance.
Squeeze condition is active.
Sell Signal:

Price is 3 ATR above the 21-EMA.
RSI is above 80 (overbought).
Additional Signals:

Buy: Price is 2 standard deviations below the 21-EMA.
Sell: Price is 2 standard deviations above the 21-EMA.
6. Visual Enhancements
Chart patternsforecastingMoving Averages

Script open-source

In pieno spirito TradingView, l'autore di questo script lo ha pubblicato open-source, in modo che i trader possano comprenderlo e verificarlo. Un saluto all'autore! È possibile utilizzarlo gratuitamente, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?

Declinazione di responsabilità