Price Imbalance as Consecutive Levels of AveragesOverview
The Price Imbalance as Consecutive Levels of Averages indicator is an advanced technical analysis tool designed to identify and visualize price imbalances in financial markets. Unlike traditional moving average (MA) indicators that update continuously with each new price bar, this indicator employs moving averages calculated over consecutive, non-overlapping historical windows. This unique approach leverages comparative historical data to provide deeper insights into trend strength and potential reversals, offering traders a more nuanced understanding of market dynamics and reducing the likelihood of false signals or fakeouts.
Key Features
Consecutive Rolling Moving Averages: Utilizes three distinct simple moving averages (SMAs) calculated over consecutive, non-overlapping windows to capture different historical segments of price data.
Dynamic Color-Coded Visualization: SMA lines change color and style based on the relationship between the averages, highlighting both extreme and normal market conditions.
Median and Secondary Median Lines: Provides additional layers of price distribution insight during normal trend conditions through the plotting of primary and secondary median lines.
Fakeout Prevention: Filters out short-term volatility and sharp price movements by requiring consistent historical alignment of multiple moving averages.
Customizable Parameters: Offers flexibility to adjust SMA window lengths and line extensions to align with various trading strategies and timeframes.
Real-Time Updates with Historical Context: Continuously recalculates and updates SMA lines based on comparative historical windows, ensuring that the indicator reflects both current and past market conditions.
Inputs & Settings
Rolling Window Lengths:
Window 1 Length (Most Recent) Bars: Number of bars used to calculate the most recent SMA. (Default: 5, Range: 2–300)
Window 2 Length (Preceding) Bars: Number of bars for the second SMA, shifted by Window 1. (Default: 8, Range: 2–300)
Window 3 Length (Third Rolling) Bars: Number of bars for the third SMA, shifted by the combined lengths of Window 1 and Window 2. (Default: 13, Range: 2–300)
Horizontal Line Extension:
Horizontal Line Extension (Bars): Determines how far each SMA line extends horizontally on the chart. (Default: 10 bars, Range: 1–100)
Functionality and Theory
1. Calculating Consecutive Simple Moving Averages (SMAs):
The indicator calculates three SMAs, each based on distinct and consecutive historical windows of price data. This approach contrasts with traditional MAs that continuously update with each new price bar, offering a static view of past trends rather than an ongoing one.
Mean1 (SMA1): Calculated over the most recent Window 1 Length bars. Represents the short-term trend.
Mean1=∑i=1N1CloseiN1
Mean1=N1∑i=1N1Closei
Where N1N1 is the length of Window 1.
Mean2 (SMA2): Calculated over the preceding Window 2 Length bars, shifted back by Window 1 Length bars. Represents the medium-term trend.
\text{Mean2} = \frac{\sum_{i=1}^{N_2} \text{Close}_{i + N_1}}}{N_2}
Where N2N2 is the length of Window 2.
Mean3 (SMA3): Calculated over the third rolling Window 3 Length bars, shifted back by the combined lengths of Window 1 and Window 2 bars. Represents the long-term trend.
\text{Mean3} = \frac{\sum_{i=1}^{N_3} \text{Close}_{i + N_1 + N_2}}}{N_3}
Where N3N3 is the length of Window 3.
2. Determining Market Conditions:
The relationship between the three SMAs categorizes the market condition into either extreme or normal states, enabling traders to quickly assess trend strength and potential reversals.
Extreme Bullish:
Mean3Mean2>Mean1
Mean3>Mean2>Mean1
Indicates a strong and sustained downward trend. SMA lines are colored purple and styled as dashed lines.
Normal Bullish:
Mean1>Mean2andnot in extreme bullish condition
Mean1>Mean2andnot in extreme bullish condition
Indicates a standard upward trend. SMA lines are colored green and styled as solid lines.
Normal Bearish:
Mean1Mean2>Mean1
Mean3>Mean2>Mean1
Normal Bullish:
Mean1>Mean2andnot in Extreme Bullish
Mean1>Mean2andnot in Extreme Bullish
Normal Bearish:
Mean1 Mean2 > Mean3
Visualization: All three SMAs are displayed as gold dashed lines.
Median Lines: Not displayed to maintain chart clarity.
Interpretation: Indicates a strong and sustained upward trend. Traders may consider entering long positions, confident in the trend's strength without the distraction of additional lines.
2. Normal Bullish Condition:
SMAs Alignment: Mean1 > Mean2 (not in extreme condition)
Visualization: Mean1 and Mean2 are green solid lines; Mean3 is gray.
Median Lines: A thin blue dotted median line is plotted between Mean1 and Mean2, with two additional thin blue dashed lines as secondary medians.
Interpretation: Confirms an upward trend while providing deeper insights into price distribution. Traders can use the median and secondary median lines to identify optimal entry points and manage risk more effectively.
3. Extreme Bearish Condition:
SMAs Alignment: Mean3 > Mean2 > Mean1
Visualization: All three SMAs are displayed as purple dashed lines.
Median Lines: Not displayed to maintain chart clarity.
Interpretation: Indicates a strong and sustained downward trend. Traders may consider entering short positions, confident in the trend's strength without the distraction of additional lines.
4. Normal Bearish Condition:
SMAs Alignment: Mean1 < Mean2 (not in extreme condition)
Visualization: Mean1 and Mean2 are red solid lines; Mean3 is gray.
Median Lines: A thin blue dotted median line is plotted between Mean1 and Mean2, with two additional thin blue dashed lines as secondary medians.
Interpretation: Confirms a downward trend while providing deeper insights into price distribution. Traders can use the median and secondary median lines to identify optimal entry points and manage risk more effectively.
Customization and Flexibility
The Price Imbalance as Consecutive Levels of Averages indicator is highly adaptable, allowing traders to tailor it to their specific trading styles and market conditions through adjustable parameters:
SMA Window Lengths: Modify the lengths of Window 1, Window 2, and Window 3 to capture different historical trend segments, whether focusing on short-term fluctuations or long-term movements.
Line Extension: Adjust the horizontal extension of SMA and median lines to align with different trading horizons and chart preferences.
Color and Style Preferences: While default colors and styles are optimized for clarity, traders can customize these elements to match their personal chart aesthetics and enhance visual differentiation.
This flexibility ensures that the indicator remains versatile and applicable across various markets, asset classes, and trading strategies, providing valuable insights tailored to individual trading needs.
Conclusion
The Price Imbalance as Consecutive Levels of Averages indicator offers a comprehensive and innovative approach to analyzing price trends and imbalances within financial markets. By utilizing three consecutive, non-overlapping SMAs and incorporating median lines during normal trend conditions, the indicator provides clear and actionable insights into trend strength and price distribution. Its unique design leverages comparative historical data, distinguishing it from traditional moving averages and enhancing its utility in identifying genuine market movements while minimizing false signals. This dynamic and customizable tool empowers traders to refine their technical analysis, optimize their trading strategies, and navigate the markets with greater confidence and precision.
単純移動平均 (SMA)
Pin Bar Signal with SMA and Bollinger Bands FilterИндикатор выдаёт сигнал на вход в сделку, если появляется пин-бар. В зависимости от настроек, это будет бычий пин-бар от нижней границы полос Боллинджера или медвежий пин-бар - от верхней. Если вы выберете фильтр по SMA, то это будет бычий пин-бар, когда график над линией SMA, и медвежий пин-бар - под линией SMA. В настройках можно включить оба способа фильтрации или отдельно каждый.
Особенности индикатора:
1. Определяет пин-бары по критериям:
- Для бычьего пин-бара: нижняя тень > 2× верхней тени и тела
- Для медвежьего пин-бара: верхняя тень > 2× нижней тени и тела
2. Фильтрация:
- SMA (20 периодов по умолчанию)
- Полосы Боллинджера (20 периодов по умолчанию)
3. Настройки:
- Можно включать/выключать фильтры (SMA, полосы Боллинджера)
- Настраиваемые периоды и параметры
- Визуализация сигналов
Оптимизировано для 15M графика:
- Использует быстрые встроенные функции (ta.sma, ta.stdev)
- Минимизирует сложные вычисления
- Подходит для работы в реальном времени
EMA & SMA by TTC1. EMA 9, 15, 21:
Short-term trends: These EMAs are typically used for analyzing short-term price movements and finding quick trend reversals.
Use cases:
EMA 9: Reacts quickly to price changes and is often used as a trigger line for entry or exit.
EMA 15 and EMA 21: Offer slightly less sensitivity, reducing false signals compared to EMA 9.
2. 200 EMA and 200 SMA:
Long-term trend indicators: These averages are widely used to identify overall market direction.
Differences:
200 EMA: Puts more weight on recent prices, making it more responsive to recent market movements.
200 SMA: Gives equal weight to all prices in the 200-period, showing a smoother long-term trend.
Use cases:
Price above 200 EMA/SMA: Bullish trend.
Price below 200 EMA/SMA: Bearish trend.
Both averages act as key support/resistance levels.
Strategies Combining These Averages:
Trend Confirmation:
If EMAs (9, 15, 21) are aligned above the 200 EMA/SMA, it confirms a strong bullish trend.
If aligned below the 200 EMA/SMA, it confirms a strong bearish trend.
Crossover Signals:
When EMA 9 crosses above EMA 21: Potential buy signal.
When EMA 9 crosses below EMA 21: Potential sell signal.
Price crossing the 200 EMA/SMA can signal long-term trend shifts.
Dynamic Support/Resistance:
Use the EMAs (especially 9 and 21) as dynamic support/resistance for trailing stop-losses in trending markets.
The 200 EMA/SMA serves as a critical level where price often reacts significantly.
SMA 9, SMA 33 y HMA PersonalizablesUn indicador con SMA 9, SMA 33 y HMA es ideal para analizar tendencias y detectar giros. La SMA 9 muestra la tendencia a corto plazo, mientras que la SMA 33 refleja el medio plazo. La HMA, más rápida y suave, destaca cambios de dirección sin tanto ruido. Los cruces entre las SMAs y la dirección de la HMA generan señales claras de entrada o salida.
Gelişmiş SMA İndikatörü//@version=5
indicator("Gelişmiş SMA İndikatörü", overlay=true)
// Kullanıcıdan alınacak SMA periyotları
sma1_period = input.int(20, minval=1, title="SMA 1 Periyodu")
sma2_period = input.int(50, minval=1, title="SMA 2 Periyodu")
sma3_period = input.int(200, minval=1, title="SMA 3 Periyodu")
// Renk ve stil seçenekleri
sma1_color = input.color(color.blue, title="SMA 1 Rengi")
sma2_color = input.color(color.red, title="SMA 2 Rengi")
sma3_color = input.color(color.green, title="SMA 3 Rengi")
line_width = input.int(2, minval=1, title="Çizgi Kalınlığı")
// SMA hesaplamaları
sma1 = ta.sma(close, sma1_period)
sma2 = ta.sma(close, sma2_period)
sma3 = ta.sma(close, sma3_period)
// Çizimleri grafiğe ekleme
plot(sma1, color=sma1_color, linewidth=line_width, title="SMA 1")
plot(sma2, color=sma2_color, linewidth=line_width, title="SMA 2")
plot(sma3, color=sma3_color, linewidth=line_width, title="SMA 3")
// Alarm oluşturma (opsiyonel)
alertcondition(ta.cross(sma1, sma2), title="SMA 1 ve SMA 2 Kesişti", message="SMA 1 ve SMA 2 kesişimi oluştu!")
alertcondition(ta.cross(sma2, sma3), title="SMA 2 ve SMA 3 Kesişti", message="SMA 2 ve SMA 3 kesişimi oluştu!")
alertcondition(ta.cross(sma1, sma3), title="SMA 1 ve SMA 3 Kesişti", message="SMA 1 ve SMA 3 kesişimi oluştu!")
. Kullanıcı Tanımlı SMA Periyotları
SMA 1 Periyodu: Varsayılan 20 (kullanıcı tarafından değiştirilebilir).
SMA 2 Periyodu: Varsayılan 50 (kullanıcı tarafından değiştirilebilir).
SMA 3 Periyodu: Varsayılan 200 (kullanıcı tarafından değiştirilebilir).
2. Renk ve Çizgi Stilleri
Her bir SMA'nın rengini ayarlayabilirsiniz (varsayılan: mavi, kırmızı ve yeşil).
Çizgi kalınlığını seçebilirsiniz (varsayılan: 2 piksel).
3. Alarm Özelliği
SMA'ların kesişimi gerçekleştiğinde alarm kurulabilir:
SMA 1 ve SMA 2 kesişimi.
SMA 2 ve SMA 3 kesişimi.
SMA 1 ve SMA 3 kesişimi.
Alarm mesajı: "SMA kesişimi oluştu!" şeklinde gösterilir.
4. Kolay Kullanım ve Görsellik
Çizgiler doğrudan grafik üzerine eklenir (overlay=true).
Tüm ayarlar kullanıcı dostu bir arayüzle yapılabilir.
Bitcoin Buy at 120 SMA, Sell Below 30 SMA How It Works
Buy Signal:
Triggered when the price moves from below to above the 120-day SMA.
Sell Signal:
Triggered when the price moves from above to below the 30-day SMA.
Visualization:
The 120-day SMA is plotted in blue.
The 30-day SMA is plotted in red.
Invest SMA|MACD|ADX Long Weekly Strategy (BtTL)Diese Strategie kombiniert drei bewährte technische Indikatoren (SMA, MACD und ADX) für präzise Long-Einstiege auf dem Wochenchart.
Hauptmerkmale:
Einstiegssignale basieren auf einer Kombination aus SMA (30), MACD (9,18,9) und ADX (14)
Intelligentes Stop-Loss-Management durch Swing-Low-Erkennung
Trendbestätigung durch ADX > 25
Optimiert für Wochencharts
Konservatives Risikomanagement durch mehrfache Signalbestätigung
Einstiegsbedingungen:
Kurs über SMA
MACD über Signallinie und im positiven Bereich
ADX zeigt starken Trend (>25)
Ausstiegsstrategie:
Stop-Loss wird automatisch am vorletzten Swing-Low gesetzt
Position wird geschlossen, wenn der Kurs unter den SMA fällt
🇬🇧 English:
This strategy combines three proven technical indicators (SMA, MACD, and ADX) for precise long entries on the weekly chart.
Key Features:
Entry signals based on a combination of SMA (30), MACD (9,18,9), and ADX (14)
Intelligent stop-loss management through swing low detection
Trend confirmation using ADX > 25
Optimized for weekly charts
Conservative risk management through multiple signal confirmation
Entry Conditions:
Price above SMA
MACD above signal line and in positive territory
ADX showing strong trend (>25)
Exit Strategy:
Stop-loss automatically set at second-last swing low
Position closes when price falls below SMA
Multi-Timeframe SMA Crossover TrackerThis script allows traders to monitor popular SMA crossovers, such as the 9/20, on any ticker and timeframe of their choice.
Green Background: Fast SMA (e.g., 9) is above the Slow SMA (e.g., 20), signaling bullish conditions.
Red Background: Fast SMA is below the Slow SMA, indicating bearish conditions.
The indicator plots both SMAs for easy visualization and highlights crossovers to help traders identify momentum shifts. Perfect for swing and intraday trading strategies based on cross-timeframe trend signals.
Ultimate Total MA + ATRIndicator Description (English)
Name: Tendencias FX - Multi-Line with Customizable Offsets (1x..6x)
This script is a multi-purpose trend-following indicator that calculates a central Moving Average (Mid Line) plus a set of 6 different bands (1x to 6x) above and below that average. Each band is determined by a user-defined ATR length and multiplier. Key features include:
Independent MA Types
Choose different moving average methods for the Mid Line and for the ATR calculation.
Available types: SMA, EMA, WMA, RMA, HMA, and ALMA.
Separate Lengths
Configure the length of the Mid Line independently from the ATR length.
This allows fine-tuning of both the central average and the volatility measure.
6 Customizable Multipliers
Bands are calculated for 1x, 2x, 3x, 4x, 5x, and 6x multiples of the chosen ATR.
Each level has its own checkbox in the Inputs tab so you can show or hide them at will.
Color Dynamics
The Mid Line automatically changes color to green when its current value is higher than the previous bar’s value, and red otherwise.
All upper/lower bands are rendered in a neutral gray (#787b86) for easy distinction.
Time Shift (Offset)
An offset parameter allows shifting the entire indicator (Mid Line plus bands) forward (to the right) or backward (to the left) by a certain number of bars.
This can help evaluate leads/lags, or compare the past behavior of these lines against future price developments.
Check Boxes for Visibility
Checkboxes in the Inputs let you toggle 1x..6x band levels.
By default, 1x, 2x, and 3x are visible, while 4x, 5x, and 6x are off.
Overlay with Shared Price Scale
The script is set as overlay=true and uses scale=scale.right, so it draws directly on the main chart and shares the same price axis as your candles.
This indicator is ideal if you want:
A central MA for trend detection.
ATR-based volatility bands (up to 6 multipliers).
Full control over the type and length of both the Mid Line MA and the ATR.
An optional offset to shift the lines in time for backtesting or forward-projection.
Usage Tips
In the Inputs tab, customize:
Mid Line length and ATR length independently.
MA methods for both Mid Line and ATR (SMA, EMA, WMA, RMA, HMA, ALMA).
Band visibility via checkboxes for 1x..6x.
Offset for shifting lines in time.
In the Style tab, you can further customize colors, line widths, and visibility of each element (Mid line, ±1x..±6x).
Enjoy exploring different settings to best match your preferred trading style and timeframe!
Smooth Moving Average (SMA) MTF Trend PanelDescription:
The SMA MTF Trend Panel is a multi-timeframe (MTF) trend visualization tool designed to help traders quickly assess market conditions across multiple timeframes based on the Simple Moving Average (SMA). This script calculates the trend direction (Bullish, Bearish, or Neutral) and the trend strength percentage for each selected timeframe. It displays the information in an intuitive panel that is dynamically updated in real-time.
How It Works:
1. SMA Calculation:
• For each timeframe, the script calculates the SMA based on a user-defined length (default: 50).
2. Trend Identification:
• Compares the current price to the SMA and assigns a label: “Bull,” “Bear,” or “Neutral.”
3. Panel Display:
• Displays trends, strengths, and shifts for each timeframe in an interactive table.
4. Real-Time Updates:
• Continuously monitors price movements and updates the panel to reflect the latest data.
Customizable Inputs:
1. Panel Settings:
• Orientation: Choose vertical or horizontal layout.
• Position: Select panel location on the chart.
• Border Width/Color: Adjust panel borders for better visualization.
2. Trend Colors:
• Define custom colors for bullish, bearish, neutral, and shift conditions.
3. SMA Length:
• Adjust the SMA period to suit your trading style (e.g., short-term scalping or long-term trend following).
4. Timeframes:
• Set specific timeframes to analyze based on your trading strategy.
Composite Indicator (CCI + ATR)Composite Indicator (CCI + ATR)
The Composite Indicator (CCI + ATR) combines the Commodity Channel Index (CCI) with the Average True Range (ATR) , providing traders with a dynamic tool for identifying entry and exit points based on momentum and volatility. This indicator is particularly useful for markets like cryptocurrencies, which often exhibit sharp sell-offs and gradual upward trends.
Key Features
Momentum Analysis with CCI: The CCI calculates price momentum by comparing the current price level to its average over a specific period. The indicator generates signals when CCI crosses predefined thresholds.
- Buy Signal: Triggered when CCI crosses above the lower threshold (e.g., -100).
- Sell Signal: Triggered when CCI crosses below the upper threshold (e.g., +100).
Volatility Filtering with ATR: The ATR measures market volatility, ensuring signals occur only during significant price movements.
Separate multipliers for buy and sell signals allow tailored filtering based on market behavior.
Stop Loss Calculation: Dynamic stop loss levels are calculated using the ATR multiplier to adapt to market volatility, offering better risk management.
How It Works
CCI Calculation: The CCI is calculated using the typical price ((High + Low + Close) / 3) and a user-defined length. It detects momentum changes by measuring deviations from the average price.
ATR Calculation: The ATR determines the average price range over a specified period, identifying the market’s volatility. The ATR SMA acts as a baseline to filter signals.
Buy Signal: A buy signal is triggered when:
- CCI crosses above the lower threshold (e.g., -100).
- ATR exceeds its SMA multiplied by the buy multiplier (e.g., 1.0).
Sell Signal: A sell signal is triggered when:
- CCI crosses below the upper threshold (e.g., +100).
- ATR exceeds its SMA multiplied by the sell multiplier (e.g., 0.95).
Stop Loss Integration:
- Long positions: Stop loss = Low – (ATR * ATR Multiplier)
- Short positions: Stop loss = High + (ATR * ATR Multiplier)
Advantages
Combines momentum (CCI) and volatility (ATR) for precise signal generation.
Customizable thresholds and multipliers for different market conditions.
Dynamic stop loss ensures better risk management in volatile markets.
Suggested Parameter Settings
CCI Length: 20 (default). Adjust as follows:
- 10–15: Shorter timeframes (e.g., 5-15 minutes).
- 20: General use for 1-hour timeframes.
- 30–50: Longer timeframes (e.g., 4-hour or daily charts).
CCI Threshold: 100 (default). Adjust as follows:
- 50–75: For more frequent signals in ranging markets.
- 100: Balanced for most trading conditions.
- 150–200: For strong trends to reduce noise.
ATR Length: 14 (default). Adjust as follows:
- 10–14: For assets with moderate volatility.
- 20: For assets with lower volatility.
ATR Buy Multiplier: 1.0 (default). Adjust as follows:
- 0.9–1.0: For gradual uptrends in crypto markets.
- 1.1–1.2: For stronger trend filtering.
ATR Sell Multiplier: 0.95 (default). Adjust as follows:
- 0.8–0.95: For sharp sell-offs.
- 1.0–1.1: For stable downward trends.
ATR Multiplier (Stop Loss): 1.5 (default). Adjust as follows:
- 1.0–1.2: For shorter timeframes or less volatile markets.
- 2.0–2.5: For highly volatile markets like cryptocurrencies.
Example Use Cases
Scalping (5-15 minute charts): Use CCI Length = 10, CCI Threshold = 75, ATR Buy Multiplier = 0.9, ATR Sell Multiplier = 0.8.
Day Trading (1-hour charts): Use CCI Length = 20, CCI Threshold = 100, ATR Buy Multiplier = 1.0, ATR Sell Multiplier = 0.95.
Swing Trading (4-hour or daily charts): Use CCI Length = 30, CCI Threshold = 150, ATR Buy Multiplier = 1.2, ATR Sell Multiplier = 1.0.
Final Thoughts The Composite Indicator (CCI + ATR) is a versatile tool designed to enhance trading decisions by combining momentum analysis with volatility filtering. Whether scalping or swing trading, this indicator provides actionable insights and robust risk management to navigate complex markets effectively.
Composite Indicator (Donchian + OBV)Composite Indicator (Donchian + OBV)
The Composite Indicator (Donchian + OBV) is a powerful tool designed to evaluate the strength of market breakouts and momentum trends , offering traders a comprehensive perspective on price action. This indicator combines the Donchian Channel with On-Balance Volume (OBV) to create a dynamic and easy-to-interpret metric scaled between -1 and 1 .
Key Features
Breakout Strength Analysis:
- The indicator assesses the strength of price breakouts relative to the upper and lower bounds of the Donchian Channel.
- Positive values close to 1 indicate a strong bullish breakout.
- Negative values close to -1 indicate a strong bearish breakout.
Momentum Detection with OBV:
- On-Balance Volume (OBV) tracks the cumulative buying and selling volume to gauge market momentum.
- The smoothed OBV trend ensures the momentum component aligns with price action, reducing noise.
Integrated Composite Value:
- Combines breakout strength and OBV momentum into a single metric for enhanced clarity.
- The final composite value highlights whether the market is bullish, bearish, or neutral.
Divergence Detection:
- Spot bullish divergences when the indicator rises while price falls, suggesting a potential upward reversal.
- Identify bearish divergences when the indicator falls while price rises, hinting at a potential downward reversal.
How It Works
Donchian Channel Analysis:
- Calculates the highest high and lowest low over a user-defined period to establish the upper and lower channels .
- Breakouts beyond these channels contribute to the breakout strength component.
OBV Momentum:
- Measures cumulative volume trends to validate price movements.
- Momentum is derived from the rate of change in smoothed OBV values.
Composite Calculation:
- Combines breakout strength and OBV momentum, normalized and scaled to -1 to 1 for clarity.
How to Use
Bullish Breakout:
- When the indicator value approaches 1 , it signals a strong upward breakout supported by positive OBV momentum.
- Example Action: Consider a Buy if price breaks the upper Donchian Channel with increasing OBV.
Bearish Breakout:
- When the indicator value approaches -1 , it indicates a strong downward breakout supported by negative OBV momentum.
- Example Action: Consider a Sell if price breaks the lower Donchian Channel with decreasing OBV.
Neutral Market:
- When the value is near 0 , the market is likely balanced with no significant breakout or momentum detected.
Divergence Opportunities:
- Bullish Divergence: Price makes lower lows, but the indicator trends upward → Potential upward reversal.
- Bearish Divergence: Price makes higher highs, but the indicator trends downward → Potential downward reversal.
Customization Options
Donchian Channel Length: Adjust the period for the upper and lower bounds.
OBV Smoothing Length: Modify the smoothing period for OBV to fine-tune momentum detection.
Scaling Adjustments: The composite value is automatically normalized for consistency across timeframes.
Ideal Use Cases
Breakout Trading: Identify and confirm strong breakouts in volatile markets.
Momentum Confirmation: Validate price movements with volume-based momentum.
Reversal Detection: Leverage divergences to spot potential market reversals.
Example Applications
Strong Bullish Signal:
- Price breaks the upper channel , and OBV shows increasing volume → Composite value near 1 .
- Action: Enter a Buy position and set a Stop Loss below the upper channel.
Strong Bearish Signal:
- Price breaks the lower channel , and OBV shows decreasing volume → Composite value near -1 .
- Action: Enter a Sell position and set a Stop Loss above the lower channel.
Neutral Market:
- Composite value near 0 suggests indecision or consolidation. Wait for a breakout.
Limitations
Best used alongside additional tools like RSI or MACD for filtering noise and improving decision-making.
Requires careful parameter tuning based on the asset and timeframe.
Final Thoughts
The Composite Indicator (Donchian + OBV) offers traders a versatile tool to navigate complex markets. By blending breakout analysis with volume-based momentum, this indicator provides an actionable edge for identifying high-probability opportunities and potential reversals.
Golden/Death Cross HighlighterThis indicator helps you easily identify and visualize Golden Cross and Death Cross patterns combined with price action confirmation. It highlights chart backgrounds when specific conditions are met, making it easy to spot potential trend changes.
🔑 Key Features:
Highlights Golden Cross conditions (50 SMA crosses above 200 SMA) when price closes above both MAs
Highlights Death Cross conditions (50 SMA crosses below 200 SMA) when price closes below both MAs
Customizable MA lengths (default: 50 and 200)
Adjustable highlight opacity
Built-in alerts for cross events
Clear visualization of both moving averages
📈 Color Guide:
Yellow Background: Golden Cross active + price above both MAs
Red Background: Death Cross active + price below both MAs
⚙️ Settings:
Fast MA Length: Length of faster moving average (default 50)
Slow MA Length: Length of slower moving average (default 200)
Golden Cross Highlight Opacity: Adjust visibility of bullish highlights
Death Cross Highlight Opacity: Adjust visibility of bearish highlights
💡 Usage Tips:
Use in combination with other indicators for confirmation
Set up alerts for potential trend changes
Adjust opacity to match your chart style
Works best on higher timeframes (4H, Daily, Weekly)
200WMA ScreenerDescription:
This custom indicator helps identify stocks trading below their 200-week moving average (200WMA), a key technical indicator often used to analyze long-term trends. The script calculates the 200WMA using weekly close prices and provides the following features:
Visual Plot: Displays the 200WMA as a smooth line on the chart for easy trend analysis.
Background Highlight: Automatically highlights the chart background when the current price is below the 200WMA, signaling a potential bearish trend or undervalued stock.
Alert System: Includes an alert condition to notify you when a stock trades below its 200WMA, so you never miss an opportunity.
Compatibility: Works across all assets (stocks, forex, crypto) and automatically adapts to the selected ticker.
This script is ideal for traders and investors looking for long-term opportunities, identifying potential trend reversals, or spotting undervalued stocks.
2 MA Simplified Sideways Candle ColorsHow to Use the Indicator: A Simple Guide
This custom indicator colors candlesticks to help you quickly identify market conditions based on two moving averages (9-period and 21-period). Here’s how to get started:
Add the Indicator to Your Chart:
Copy the provided Pine Script code.
Open TradingView and navigate to the Pine Editor.
Paste the code into a new script, save it, and then add the indicator to your chart.
Understand the Candlestick Colors:
Green Candles (Bullish):
Indicates a bullish market when the price is above the 9-period SMA and the 9 SMA is above the 21 SMA.
Red Candles (Bearish):
Indicates a bearish market when the price is below the 21-period SMA and the 9 SMA is below the 21 SMA.
Yellow Candles (Sideways):
Indicates a sideways (neutral) market when:
Condition 1: Price is below the 9 SMA but above the 21 SMA, with the 9 SMA above the 21 SMA, or
Condition 2: The 9 SMA is below the 21 SMA, and the price lies between them.
White Candles (No Clear Signal):
Used when none of the above conditions apply.
Interpreting the Signals:
When you see green candles, the market is showing bullish momentum.
When you see red candles, bearish pressure is dominant.
Yellow candles suggest the market is moving sideways without a strong trend.
White candles mean that none of the specific conditions (bullish, bearish, or sideways) are currently met.
Chart Reference:
The script also plots two moving averages on your chart (a blue line for the 9-period SMA and an orange line for the 21-period SMA). These lines help visualize how price interacts with these averages.
Using the Indicator in Practice:
Once added to your chart, monitor the color of the candlesticks:
Green signals may be opportunities to consider long positions.
Red signals may indicate a good time to consider short positions or tighten stops.
Yellow signals suggest caution as the market isn’t trending strongly.
White candles indicate no strong signal, so it might be a period of consolidation or indecision.
This simple visual cue system allows you to quickly assess market sentiment and make more informed trading decisions based on the relationship between price and the two moving averages.
Adaptive Moving Averagewhat is the purpose of the indicator?
When short-length moving averages are used as trailing stops, they cause exiting the trade too early. Keeping the length value too high will result in exiting the transaction too late and losing most of the profits earned. I aimed to prevent this problem with this indicator.
what is "Adaptive Moving Average"?
it is a moving average that can change its length on each candle depending on the selected source.
what it does?
The indicator first finds the average lengths of the existing candles and defines different distances accordingly. When the moving average drawn by the indicator enters the area defined as "far" by the indicator, the indicator reduces the length of the moving average, preventing it from moving too far from the price, and continues to do so at different rates until the moving average gets close enough to the price. If the moving average gets close enough to the price, it starts to increase the length of the average and thus the adaptation continues.
how it does it?
Since the change of each trading pair is different in percentage terms, I chose to base the average height of the candles instead of using constant percentage values to define the concept of "far". While doing this, I used a weighted moving average so that the system could quickly adapt to the latest changes (you can see it on line 17). After calculating what percentage of the moving average this value is, I caused the length of the moving average to change in each bar depending on the multiples of this percentage value that the price moved away from the average (look at line 20, 21 and 22). Finally, I created a new moving average using this new length value I obtained.
how to use it?
Although the indicator chooses its own length, we have some inputs to customize it. First of all, we can choose which source we will use the moving average on. The "source" input allows us to use it with other indicators.
"max length" and "min length" determine the maximum and minimum value that the length of the moving average can take.
Apart from this, there are options for you to add a standard moving average to the chart so that you can compare the adaptive moving average, and bollinger band channels that you can use to create different strategies.
This indicator was developed due to the need for a more sophisticated trailing stop, but once you understand how it works, it is completely up to you to combine it with other indicators and create different strategies.
BS | Buy&Sell Signals With EMAKey Features:
EMA Intersections: Generates clear buy and sell signals based on predefined EMA crossings.
5 EMA Lines: Visualize market trends with five distinct EMA lines plotted on the chart.
Support and Resistance Levels: Easily identify crucial support and resistance levels with our integrated marker.
Comprehensive Indicator Panel: At the bottom of the chart, track Stochastic, RSI, Supertrend, and SMA across multiple timeframes (1m, 5m, 15m, 1H, 4H, Daily, Weekly).
Fully Customizable: Almost every indicator within the tool is adjustable to suit your preferences and trading style.
Alarm Feature: Set up alarms to stay informed of important market movements.
Unlock the full potential of your trading strategy with BS | Buy&Sell Signals With EMA. Customize, analyze, and trade with confidence.
created by @bahadirsezer
Enhanced SMA Signal Box With TargetsEnhanced SMA Signal Box With Targets
The Enhanced SMA Signal Box With Targets indicator is a versatile tool designed to help traders identify buy and sell signals based on various technical analysis methods, including Simple Moving Averages (SMA), Exponential Moving Averages (EMA), and Average True Range (ATR). This indicator provides clear visual signals and target levels to assist traders in making informed decisions.
Key Features
Simple Moving Averages (SMA):
20 SMA: Represents short-term price trends.
50 SMA: Represents long-term price trends.
Exponential Moving Average (EMA):
50 EMA: Adds additional trend confirmation to the SMA.
Signal Visualization:
Buy Signals: Displayed with a green "🚀" emoji below the candle when the closing price crosses above the 20 SMA.
Sell Signals: Displayed with a red "💣" emoji above the candle when the closing price crosses below the 20 SMA.
Yellow Box: Highlights the signal candle, making it easy to identify the most recent and historical signals.
Target Prices:
First Target: Based on the size of the signal candle.
Second and Third Targets: Calculated using the ATR multiplied by a user-defined factor to help set profit-taking levels.
Customizable Filters:
MACD Filter: Users can enable this filter to use MACD line crossings for signal confirmation.
Higher Timeframe SMA Filter: Users can set a higher timeframe SMA to filter signals based on the long-term trend.
Volume Filter: Users can set a minimum volume threshold for signals.
Alerts:
Users can enable alerts for buy and sell signals, ensuring they never miss a trading opportunity.
Customizable Settings:
Line Colors and Thickness: Users can adjust the colors and thickness of the SMAs, EMA, and signal boxes.
Signal Emojis: Users can choose custom emojis for buy and sell signals.
How It Works
Trend Calculation: The indicator calculates short-term and long-term trends using the 20 SMA, 50 SMA, and 50 EMA.
Signal Generation: Buy and sell signals are generated when the price crosses the 20 SMA, with optional confirmation from MACD and volume filters.
Target Calculation: Profit targets are based on the size of the signal candle and ATR, helping traders set realistic profit-taking levels.
Important Notice
This indicator is designed for educational purposes and should not be considered as financial advice. Past performance does not guarantee future results. Users should conduct their own research and analysis before making any trading decisions. Trading involves substantial risk and is not suitable for every investor. Always consider your financial situation, investment objectives, and risk tolerance before trading. Please ensure you comply with all the relevant regulations and TradingView's house rules while using this indicator.
Bitcoin Pi Cycle TrackerThe Bitcoin Pi Cycle Tracker is based on the widely recognized Pi Cycle Top Indicator, a concept used to identify potential market cycle tops in Bitcoin's price. This implementation combines the 111-day Simple Moving Average (SMA) and the 350-day SMA (multiplied by 2) to detect key crossover points. When the 111-day SMA crosses above the 350-day SMA x2, it signals a potential market peak.
Key Features:
Plots the 111-day SMA (blue) and the 350-day SMA x2 (red) for clear visualization.
Displays visual markers and vertical lines at crossover points to highlight key moments.
Sends alerts for crossovers, helping traders stay ahead of market movements.
This tool is an implementation of the Pi Cycle concept originally popularized by Bitcoin market analysts. Use it to analyze historical price cycles and prepare for significant market events. Please note that while the Pi Cycle Indicator has been historically effective, it should be used alongside other tools for a comprehensive trading strategy.
Multi SMA EMA VWAP1. Moving Average Crossover
This is one of the most common strategies with moving averages, and it involves observing crossovers between EMAs and SMAs to determine buy or sell signals.
Buy signal: When a faster EMA (like a short-term EMA) crosses above a slower SMA, it can indicate a potential upward movement.
Sell signal: When a faster EMA crosses below a slower SMA, it can indicate a potential downward movement.
With 4 EMAs and 5 SMAs, you can set up crossovers between different combinations, such as:
EMA(9) crosses above SMA(50) → buy.
EMA(9) crosses below SMA(50) → sell.
2. Divergence Confirmation Between EMAs and SMAs
Divergence between the EMAs and SMAs can offer additional confirmation. If the EMAs are pointing in one direction and the SMAs are still in the opposite direction, it is a sign that the movement could be stronger and continue in the same direction.
Positive divergence: If the EMAs are making new highs while the SMAs are still below, it could be a sign that the market is in a strong trend.
Negative divergence: If the EMAs are making new lows and the SMAs are still above, you might consider that the market is in a downtrend or correction.
3. Using EMAs as Dynamic Support and Resistance
EMAs can act as dynamic support and resistance in strong trends. If the price approaches a faster EMA from above and doesn’t break it, it could be a good entry point for a long position (buy). If the price approaches a slower EMA from below and doesn't break it, it could be a good point to sell (short).
Buy: If the price is above all EMAs and approaches the fastest EMA (e.g., EMA(9)), it could be a good buy point if the price bounces upward.
Sell: If the price is below all EMAs and approaches the fastest EMA, it could be a good sell point if the price bounces downward.
4. Combining SMAs and EMAs to Filter Signals
SMAs can serve as a trend filter to avoid trading in sideways markets. For example:
Bullish trend condition: If the longer-term SMAs (such as SMA(100) or SMA(200)) are below the price, and the shorter EMAs are aligned upward, you can look for buy signals.
Bearish trend condition: If the longer-term SMAs are above the price and the shorter EMAs are aligned downward, you can look for sell signals.
5. Consolidation Zone Between EMAs and SMAs
When the price moves between EMAs and SMAs without a clear trend (consolidation zone), you can expect a breakout. In this case, you can use the EMAs and SMAs to identify the direction of the breakout:
If the price is in a narrow range between the EMAs and SMAs and then breaks above the fastest EMA, it’s a sign that an upward trend may begin.
If the price breaks below the fastest EMA, it could indicate a potential downward trend.
6. "Golden Cross" and "Death Cross" Strategy
These are classic strategies based on crossovers between moving averages of different periods.
Golden Cross: Occurs when a faster EMA (e.g., EMA(50)) crosses above a slower SMA (e.g., SMA(200)), which suggests a potential bullish trend.
Death Cross: Occurs when a faster EMA crosses below a slower SMA, which suggests a potential bearish trend.
Additional Recommendations:
Combining with other indicators: You can combine EMA and SMA signals with other indicators like the RSI (Relative Strength Index) or MACD (Moving Average Convergence/Divergence) for confirmation and to avoid false signals.
Risk management: Always use stop-loss and take-profit orders to protect your capital. Moving averages are trend-following indicators but don’t guarantee that the price will move in the same direction.
Timeframe analysis: It’s recommended to use different timeframes to confirm the trend (e.g., use EMAs on hourly charts along with SMAs on daily charts).
VWAP
1. VWAP + EMAs for Trend Confirmation
VWAP can act as a trend filter, confirming the direction provided by the EMAs.
Buy Signal: If the price is above the VWAP and the EMAs are aligned in an uptrend (e.g., short-term EMAs are above longer-term EMAs), this indicates that the trend is bullish and you can look for buy opportunities.
Sell Signal: If the price is below the VWAP and the EMAs are aligned in a downtrend (e.g., short-term EMAs are below longer-term EMAs), this suggests a bearish trend and you can look for sell opportunities.
In this case, VWAP is used to confirm the overall trend. For example:
Bullish: Price above VWAP, EMAs aligned to the upside (e.g., EMA(9) > EMA(50) > EMA(200)), buy.
Bearish: Price below VWAP, EMAs aligned to the downside (e.g., EMA(9) < EMA(50) < EMA(200)), sell.
2. VWAP as Dynamic Support and Resistance
VWAP can act as a dynamic support or resistance level during the day. Combining this with EMAs and SMAs helps you refine your entry and exit points.
Support: If the price is above VWAP and starts pulling back to VWAP, it could act as support. If the price bounces off the VWAP and aligns with bullish EMAs (e.g., EMA(9) crossing above EMA(50)), you can consider entering a buy position.
Resistance: If the price is below VWAP and approaches VWAP from below, it can act as resistance. If the price fails to break through VWAP and aligns with bearish EMAs (e.g., EMA(9) crossing below EMA(50)), it could be a good signal for a sell.
20/50 SMA Cross 200 SMAThis Pine Script code is designed to identify and visualize crossovers of two shorter-term Simple Moving Averages (SMAs), a 20-period SMA and a 50-period SMA, with a longer-term 200-period SMA on a price chart. It also includes alerts for these crossover events. Here's a breakdown:
**Purpose:**
The core idea behind this script is to detect potential trend changes. Crossovers of shorter-term moving averages over a longer-term moving average are often interpreted as bullish signals, while crossovers below are considered bearish.
**Key Components:**
1. **Moving Average Calculation:**
* `sma20 = ta.sma(close, 20)`: Calculates the 20-period SMA of the closing price.
* `sma50 = ta.sma(close, 50)`: Calculates the 50-period SMA of the closing price.
* `sma200 = ta.sma(close, 200)`: Calculates the 200-period SMA of the closing price.
2. **Crossover Detection:**
* `crossUp20 = ta.crossover(sma20, sma200)`: Returns `true` when the 20-period SMA crosses above the 200-period SMA.
* `crossDown20 = ta.crossunder(sma20, sma200)`: Returns `true` when the 20-period SMA crosses below the 200-period SMA.
* Similar logic applies for `crossUp50` and `crossDown50` with the 50-period SMA.
3. **Recent Crossover Tracking (Crucial Improvement):**
* `lookback = 7`: Defines a lookback period of 7 bars.
* `var bool hasCrossedUp20 = false`, etc.: Declares `var` (persistent) boolean variables to track if a crossover has occurred *within* the last 7 bars. This is the most important correction from previous versions.
* The logic using `ta.barssince()` is the key:
* If a crossover happens (`crossUp20` is true), the corresponding `hasCrossedUp20` is set to `true`.
* If no crossover happens on the current bar, it checks if a crossover happened within the last 7 bars using `ta.barssince(crossUp20) <= lookback`. If so, it keeps `hasCrossedUp20` as `true`. After 7 bars, it becomes `false`.
4. **Plotting Crossovers:**
* `plotshape(...)`: Plots circles on the chart to visually mark the crossovers.
* Green circles below the bars for bullish crossovers (20 and 50).
* Red circles above the bars for bearish crossovers (20 and 50).
* Different shades of green/red (green/lime, red/maroon) distinguish between 20 and 50 SMA crossovers.
5. **Plotting Moving Averages (Optional but Helpful):**
* `plot(sma20, color=color.blue, linewidth=1)`: Plots the 20-period SMA in blue.
* Similar logic for the 50-period SMA (orange) and 200-period SMA (gray).
6. **Alerts:**
* `alertcondition(...)`: Triggers alerts when crossovers occur. This is essential for real-time trading signals.
**How it Works (in Simple Terms):**
The script continuously calculates the 20, 50, and 200 SMAs. It then monitors for instances where the 20 or 50 SMA crosses the 200 SMA. When such a crossover happens, a colored circle is plotted on the chart, and an alert is triggered. The key improvement is that it remembers if a crossover occurred in the last 7 bars and continues to display the circle during that period.
**Use Case:**
Traders use this type of indicator to identify potential entry and exit points in the market. A bullish crossover (shorter SMA crossing above the longer SMA) might be a signal to buy, while a bearish crossover might be a signal to sell.
**Key Improvements over Previous Versions:**
* **Correct Lookback Implementation:** The use of `ta.barssince()` and `var` variables is the correct and efficient way to check for crossovers within a lookback period. This fixes the major flaw in earlier versions.
* **Clear Visualizations:** The use of `plotshape` with distinct colors makes it easy to distinguish between 20 and 50 SMA crossovers.
* **Alerts:** The inclusion of alerts makes the script much more practical for real-time trading.
This improved version provides a robust and useful tool for identifying and tracking SMA crossovers.