Avi - Trendlines EnhancedDeveloped from open-source code by © pikusov (Diagonal Supports and Resistances), this indicator provides traders with a robust and visually intuitive method to identify and monitor key support and resistance levels. Its ability to check for multiple test touches, combined with dynamic updates, customizable visuals, and integrated alert systems, makes it an effective tool for comprehensive technical market analysis.
This advanced TradingView Pine Script indicator dynamically detects and draws support and resistance trendlines based on historical pivot points while also checking for multiple test touches. Here’s a detailed summary of its functionality:
Customizable Trendline Detection:
Historical Analysis: Users specify the number of historical bars to examine for identifying pivot points, enabling a deep scan for reliable support and resistance levels.
Pivot Lookback Settings: The primary pivot lookback period (x1) is user-defined, with a secondary period (x2) calculated as half of x1, allowing the indicator to capture both local lows and highs accurately.
Dynamic Trendline Construction and Multiple Test Validation:
Iterative Pivot Pairing: The script uses nested loops to identify pairs of pivot points (lows for support, highs for resistance) and calculates an interpolated price along the line connecting these pivots.
Testing and Updating Trendlines:
The indicator continuously checks whether the price respects the drawn trendlines.
It verifies if the trendlines have been tested multiple times by iterating through historical bars, ensuring that the level holds up under repeated tests.
When a level is retested, the trendline is updated and a test counter is incremented, thereby reinforcing the significance of the support or resistance level.
Visual Customization Options:
Line Appearance: Users can tailor the trendlines with customizable thickness, dash patterns (solid, dotted, or dashed), and specific colors for support and resistance lines.
Label Settings: Labels display the precise price levels (and optionally the number of tests), with configurable sizes and styles, offering clear visual cues on the chart.
Alerting and Confirmation Mechanisms:
Breakout Alerts: The script triggers alerts when the price action breaches a trendline. It differentiates between standard alerts and those that are volume-confirmed—where the volume exceeds a set multiple of the average—thus minimizing false signals.
RSI-Based Bar Coloring: When enabled, the Relative Strength Index (RSI) is computed, and bars at trendline test points are color-coded (dark red for overbought and dark green for oversold conditions), providing immediate visual feedback on market momentum.
Supporting Analytical Tools:
Pivot Labels: The indicator can display pivot labels using built-in functions, marking key pivot highs and lows with their corresponding price values.
Moving Averages: Two customizable moving averages (fast and slow) can be plotted (using either SMA or EMA), helping to contextualize the trendlines within the broader market trend.
Efficient Object Management:
Array-Based Storage and Cleanup: Arrays are used to store drawn objects (lines and labels), and a cleanup routine ensures that outdated objects are removed with every new bar, keeping the chart clutter-free.
Helper Functions: Utility functions such as price_at for interpolating prices along the trendline and round_to_tick for rounding values enhance the script’s precision and usability.
Simple Moving Average (SMA)
Avi - TablesThe "Avi - Tables" indicator is a comprehensive tool designed to display a wealth of technical information directly on your TradingView chart using dynamic tables and visual elements. It combines multiple analysis techniques and multi-timeframe metrics into an easy-to-read layout. Key features include:
Moving Averages & VWMA:
The indicator calculates up to six user-configurable moving averages (with options for both SMA and EMA) and a 20-period Volume-Weighted Moving Average (VWMA). It plots these averages on the chart and computes the percentage difference between the current price and each moving average. It also checks if the price has touched these levels.
ATR and Volatility:
A 14-period Average True Range (ATR) is calculated and expressed as a percentage of the close price, providing a measure of market volatility.
Volume Analysis:
Using daily volume data and a user-defined volume period, the indicator computes the relative volume (RVOL) as a multiple compared to the average volume. It estimates the full-day volume based on the elapsed trading day and compares it with the previous day’s volume, applying conditional formatting based on these comparisons.
Pressure Metrics:
The script calculates buyer and seller pressure based on price movement and volume, determining the dominant pressure (BP or SP) and displaying the result with corresponding color cues.
Multi-Timeframe Analysis Table:
Users can select various timeframes (15-min, 1-hour, 4-hour, daily, weekly, and monthly) for additional indicators such as MACD, ADX, CCI, and RSI. Each timeframe’s data is displayed in a dedicated table cell, with colors and text dynamically indicating bullish, bearish, or neutral conditions.
Customizable Tables & Layout:
The indicator provides several inputs for table positioning, text size, and layout options—including an option to flip the table rows and columns—allowing you to customize the display to best suit your chart and analysis needs.
Pivot Points & Gap Analysis:
Beyond the tables, the script includes functionality for detecting pivot highs and lows as well as identifying chart gaps. It draws labels for pivot points and, in an optional section, detects and manages gaps (with partial or full closures) and triggers alerts when new gaps appear or are closed.
Overall, "Avi - Tables" is designed to deliver a multi-layered view of the market —from moving averages and volatility to volume dynamics and multi-timeframe indicator signals—all organized neatly into customizable tables. This makes it a powerful resource for traders seeking an integrated and visually intuitive technical analysis tool.
Avi - Live 20 ChecklistThis indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
1 hour ago
Release Notes
This indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
1 hour ago
Release Notes
This indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
7 minutes ago
Release Notes
This indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
Avi - 8 MAMoving Averages (MA) Section
User Inputs:
The script lets you enable/disable and configure eight different moving averages. For each MA, you can choose:
The type: Simple Moving Average (SMA) or Exponential Moving Average (EMA)
The period (length)
The color used for plotting
Calculation:
A custom function (maFunc) calculates the MA value based on the selected type and length. Each moving average (from MA 1 to MA 8) is computed accordingly and then plotted on the chart.
2. EMA Cloud
Inputs:
There are inputs for a "Fast EMA" (default 8) and a "Slow EMA" (default 21).
Calculation & Plotting:
The script calculates the 8-period and 21-period EMAs. Although these EMAs are not directly plotted (they’re set with display.none), they are used to determine the market condition:
If the fast EMA is above the slow EMA, the area between them is filled with a greenish color.
If the fast EMA is below the slow EMA, the fill color turns reddish.
3. Buyer/Seller Pressure & ATR Calculations
Price Difference:
The script computes the difference between the close and open prices (as well as the percentage difference), which can be used as a measure of buyer vs. seller pressure.
ATR (Average True Range):
A 14-period ATR is calculated and then expressed as a percentage of the current close price. This gives a sense of volatility relative to the price level.
4. Volume Metrics & Relative Volume
Daily Volume & Averages:
The script retrieves daily volume data and computes a moving average for volume over a configurable length (default 20).
Relative Volume:
It calculates:
The average volume for the current period.
A relative volume multiplier comparing current volume to its moving average.
An estimated full-day volume based on the elapsed trading time, and checks if it will exceed the previous day’s volume.
The values are then formatted (e.g., converting to millions) for easier reading.
Conditional Formatting:
A background color is set based on whether the estimated relative volume is above or below a threshold.
5. Table Display
Purpose:
A table is created (position is configurable) to display key metrics:
14-day ATR percentage
Relative volume information (as a multiple and whether it exceeds the previous day)
Price difference (absolute and percentage change)
Style:
The table cells include conditional background and text colors to highlight different market conditions.
6. Pivot Points & Labels
Pivot Calculation:
The script calculates pivot highs and lows using user-defined left/right bar lengths.
Label Drawing:
When a pivot point is detected, a label is drawn on the chart to display its value. The style and colors for these labels are also configurable by the user.
Summary
This indicator script is quite comprehensive. It not only provides multiple moving averages and an EMA cloud to help visualize trend conditions but also includes features to assess market volatility, volume dynamics, and pivot levels—all of which are displayed neatly on the chart through plots and a customizable table. The commented-out gap detection code suggests that further features could be integrated if gap analysis is required.
If you have any specific questions or need further modifications, feel free to ask!
2 days ago
Release Notes
1. Moving Averages (MA) Section
User Inputs:
The script lets you enable/disable and configure eight different moving averages. For each MA, you can choose:
The type: Simple Moving Average (SMA) or Exponential Moving Average (EMA)
The period (length)
The color used for plotting
Calculation:
A custom function (maFunc) calculates the MA value based on the selected type and length. Each moving average (from MA 1 to MA 8) is computed accordingly and then plotted on the chart.
2. EMA Cloud
Inputs:
There are inputs for a "Fast EMA" (default 8) and a "Slow EMA" (default 21).
Calculation & Plotting:
The script calculates the 8-period and 21-period EMAs. Although these EMAs are not directly plotted (they’re set with display.none), they are used to determine the market condition:
If the fast EMA is above the slow EMA, the area between them is filled with a greenish color.
If the fast EMA is below the slow EMA, the fill color turns reddish.
3. Buyer/Seller Pressure & ATR Calculations
Price Difference:
The script computes the difference between the close and open prices (as well as the percentage difference), which can be used as a measure of buyer vs. seller pressure.
ATR (Average True Range):
A 14-period ATR is calculated and then expressed as a percentage of the current close price. This gives a sense of volatility relative to the price level.
4. Volume Metrics & Relative Volume
Daily Volume & Averages:
The script retrieves daily volume data and computes a moving average for volume over a configurable length (default 20).
Relative Volume:
It calculates:
The average volume for the current period.
A relative volume multiplier comparing current volume to its moving average.
An estimated full-day volume based on the elapsed trading time, and checks if it will exceed the previous day’s volume.
The values are then formatted (e.g., converting to millions) for easier reading.
Conditional Formatting:
A background color is set based on whether the estimated relative volume is above or below a threshold.
5. Table Display
Purpose:
A table is created (position is configurable) to display key metrics:
14-day ATR percentage
Relative volume information (as a multiple and whether it exceeds the previous day)
Price difference (absolute and percentage change)
Style:
The table cells include conditional background and text colors to highlight different market conditions.
6. Pivot Points & Labels
Pivot Calculation:
The script calculates pivot highs and lows using user-defined left/right bar lengths.
Label Drawing:
When a pivot point is detected, a label is drawn on the chart to display its value. The style and colors for these labels are also configurable by the user.
Summary
This indicator script is quite comprehensive. It not only provides multiple moving averages and an EMA cloud to help visualize trend conditions but also includes features to assess market volatility, volume dynamics, and pivot levels—all of which are displayed neatly on the chart through plots and a customizable table. The commented-out gap detection code suggests that further features could be integrated if gap analysis is required.
If you have any specific questions or need further modifications, feel free to ask.
200 Day SMA HighlighterHighlights area under chart for 200 day moving average (adjustable).
Shows color coding for when price is above or below the sma.
Simple Moving Averages MTFSimple Moving Averages MTF
This indicator plots Simple Moving Averages (SMAs) from multiple timeframes—intraday, daily, weekly, and monthly—right on your chart. It’s built for traders who want a clear, adaptable way to spot trends, whether trading short-term or holding long-term positions.
Key Features:
- Multi-Timeframe SMAs: View intraday, daily, weekly, and monthly SMAs in one place.
- Fully Customizable: Set lengths and colors for each SMA.
- Toggle On/Off: Show or hide SMAs to keep your chart clean.
- Quick Setup: Adjust settings inline with ease.
How to Use:
Add the indicator to your chart.
Open settings and pick a timeframe group (e.g., "Intraday Timeframes").
Enable/disable SMAs, tweak lengths and colors.
Hit "OK" to see it in action.
Interpretation:
- Support/Resistance: SMAs serve as dynamic levels for price reactions.
- Trend Signals: Rising SMAs indicate bullish momentum; falling SMAs suggest bearish.
- Crossovers: Short SMA crossing above a long SMA may signal a buy; below, a sell.
- Divergence: Price diverging from SMAs can hint at reversals.
Why Use It?
"Simple Moving Averages MTF" is a versatile, no-fuss tool for trend analysis. Use it solo or pair it with other indicators to match your trading style. Get multi-timeframe insights, simplified.
5-Day SMA Trend Indicator (30m)This 5-Day SMA Trend Indicator is a simple yet powerful tool designed to help traders visualize short-term trend strength and direction. It analyzes the 5-day simple moving average (SMA) on an intraday timeframe (default: 30 minutes) to determine whether the market is in a bullish or bearish short-term trend.
Key Features:
✅ 5-Day SMA Calculation – Plots a 5-period simple moving average (SMA) on an intraday chart
✅ Trend Detection – Identifies when the SMA is rising or falling
✅ Price Positioning – Determines whether price is above or below the SMA
✅ Color-Coded Background –
• 🟩 Green → Price is above a rising SMA (bullish trend)
• 🟥 Red → Price is below a falling SMA (bearish trend)
✅ Intraday Analysis – Uses 30-minute candles by default, but you can adjust the timeframe
How It Works:
1. The script calculates the 5-day SMA using intraday price data.
2. It determines if the SMA is rising (bullish) or falling (bearish) by checking the slope of the moving average.
3. It checks if the current price is above or below the SMA.
4. If price is above a rising SMA, the background turns green (bullish signal).
5. If price is below a falling SMA, the background turns red (bearish signal).
6. If neither condition is met, no background color is applied.
Use Cases:
📌 Trend Confirmation – Helps traders confirm if a rally is sustainable or likely to fail
📌 Entry & Exit Signals – Can assist in timing buy and sell decisions based on short-term trend direction
📌 Risk Management – Avoid buying into weak rallies below a falling SMA
SMA 20/50/150/2004 simple SMAs to detect the symbol's trend. The SMA 20 and 50 show you the short term trend. The SMA 150 and 200 show you the long term trend. SMA is preferred over EMA due to EMA being too fast.
sma 9/20 crossThis Pine Script is designed to visualize the crossover between two Simple Moving Averages (SMAs) on a chart: a fast SMA (9-period) and a slow SMA (20-period). The script will dynamically adjust the background color based on whether the fast SMA is above or below the slow SMA.
Key Components of the Script:
Inputs for SMA Lengths:
The script allows you to adjust the lengths of the two SMAs by inputting values for smaFastLength (default = 9) and smaSlowLength (default = 20). These lengths define how many periods (candles) the SMAs consider when calculating the moving averages.
SMA Calculations:
The script calculates two SMAs using the close price:
smaFast is the 9-period SMA.
smaSlow is the 20-period SMA.
These are calculated using TradingView’s built-in ta.sma function, which computes the simple moving average for the given period.
Background Color Logic:
The background color is dynamically updated based on the crossover condition:
Green background: When the fast SMA (smaFast) is above the slow SMA (smaSlow), indicating a bullish trend.
Red background: When the fast SMA is below the slow SMA, indicating a bearish trend.
The bgcolor function is used to change the background color on the chart. The transparency of the background color is set to 35% using color.new(color.green, 35) or color.new(color.red, 35).
Plotting the SMAs:
The two SMAs are plotted on the chart for visual reference:
The fast SMA is plotted in lime green (color.blue).
The slow SMA is plotted in red (color.red).
sma 9/20 crossThis Pine Script is designed to visualize the crossover between two Simple Moving Averages (SMAs) on a chart: a fast SMA (9-period) and a slow SMA (20-period). The script will dynamically adjust the background color based on whether the fast SMA is above or below the slow SMA.
Key Components of the Script:
Inputs for SMA Lengths:
The script allows you to adjust the lengths of the two SMAs by inputting values for smaFastLength (default = 9) and smaSlowLength (default = 20). These lengths define how many periods (candles) the SMAs consider when calculating the moving averages.
SMA Calculations:
The script calculates two SMAs using the close price:
smaFast is the 9-period SMA.
smaSlow is the 20-period SMA.
These are calculated using TradingView’s built-in ta.sma function, which computes the simple moving average for the given period.
Background Color Logic:
The background color is dynamically updated based on the crossover condition:
Green background: When the fast SMA (smaFast) is above the slow SMA (smaSlow), indicating a bullish trend.
Red background: When the fast SMA is below the slow SMA, indicating a bearish trend.
The bgcolor function is used to change the background color on the chart. The transparency of the background color is set to 35% using color.new(color.green, 35) or color.new(color.red, 35).
Plotting the SMAs:
The two SMAs are plotted on the chart for visual reference:
The fast SMA is plotted in lime green (color.lime).
The slow SMA is plotted in red (color.red).
Cycle Buy-SellThis is just for the 4-year market cycle highs and lows for those who are buying and hodling but still want to take profits each cycle. Buy and sell rules are as follows:
### **📊 Buy & Sell Signal Conditions Summary**
---
### **✅ Buy Signal Conditions (`▲` Buy Signal)**
A **buy signal** is triggered when **any** of the following conditions are met:
#### **1️⃣ Standard Buy Condition (Momentum-Based)**
✅ **55 SMA is Below the 220 SMA** (`ma1 < ma2`)
- Confirms that the market is in a **longer-term downtrend** before considering a buy.
✅ **RSI is Below 30** (`rsi < 30`)
- Signals that the asset is **oversold** and could be due for a reversal.
✅ **Stochastic RSI K is Below 25** (`stoch_k < 25`)
- Indicates **extreme bearish momentum**, often preceding a bounce.
✅ **Money Flow Index (MFI) is Below 30** (`mfi < 30`)
- Suggests **weak buying pressure**, often seen at market bottoms.
✅ **Volume is Above 1.2x the 20-Period Moving Average** (`highVolume`)
- Confirms that the buy signal occurs **during strong market participation** to reduce false signals.
---
#### **2️⃣ 1400 SMA Cross Buy Condition (Cycle-Based)**
✅ **Price Crosses Below the 1400 SMA** (`ta.crossunder(close, ma4)`)
- Signals a **potential long-term accumulation opportunity**.
- **Triggers a separate buy signal**, independent of other conditions.
---
### **📉 Sell Signal Conditions (`▼` Sell Signal)**
A **sell signal** is triggered when **any** of the following conditions are met:
#### **1️⃣ Standard Sell Condition (Momentum-Based)**
✅ **55 SMA is Above the 220 SMA** (`ma1 > ma2`)
- Confirms that the market is in a **longer-term uptrend** before considering a sell.
✅ **RSI is Above 70** (`rsi > 70`)
- Indicates that the asset is **overbought** and could be due for a correction.
✅ **Stochastic RSI K is Above 80** (`stoch_k > 80`)
- Signals **extreme bullish momentum**, often seen before a drop.
✅ **Money Flow Index (MFI) is Above 80** (`mfi > 80`)
- Suggests **strong buying pressure**, often occurring near market tops.
✅ **Volume is Above 1.2x the 20-Period Moving Average OR MVRV Z-Score > 2.5**
- `highVolume` = Volume is significantly above the average.
- `mvrvTop = mvrv > 2.5` (Suggests Bitcoin is overvalued based on historical trends).
---
#### **2️⃣ Pi Cycle Top Sell Condition (Cycle-Based)**
✅ **Pi Cycle Top Signal Triggers (`piCycleTop`)**
- `piCycleTop = ta.crossover(ma111, ma350x2)`
- **Overrides all other conditions and forces a sell signal**.
- Historically aligns with **major cycle tops in Bitcoin**.
---
### **📝 Summary of Buy & Sell Conditions**
📍 **A Buy (`▲`) is triggered when**:
- **Momentum-based buy conditions** (RSI, Stoch RSI, MFI, Volume, SMA) are met.
- **OR the price crosses below the 1400 SMA** (Separate buy signal).
📍 **A Sell (`▼`) is triggered when**:
- **Momentum-based sell conditions** (RSI, Stoch RSI, MFI, Volume, SMA, MVRV) are met.
- **OR the Pi Cycle Top is triggered** (Forces a sell).
🚀 **Your strategy now integrates both short-term momentum signals and long-term cycle analysis!** Let me know if you need refinements. 🎯
Custom MA Indicator// @version=6
indicator("Custom MA Indicator", overlay=true)
// Define the moving average periods
ma_red_period = 50
ma_orange_period = 100
ma_green_period = 200
// Calculate the moving averages
ma_red = ta.sma(close, ma_red_period)
ma_orange = ta.sma(close, ma_orange_period)
ma_green = ta.sma(close, ma_green_period)
// Plot the moving averages with specified colors
plot(ma_red, color=color.red, title="Red MA")
plot(ma_orange, color=color.orange, title="Orange MA")
plot(ma_green, color=color.green, title="Green MA")
SMA Strategy Builder: Create & Prove Profitability📄 Pine Script Strategy Description (For Publishing on TradingView)
🎯 Strategy Title:
SMA Strategy Builder: Create & Prove Profitability
✨ Description:
This tool is designed for traders who want to build, customize, and prove their own SMA-based trading strategies. The strategy tracks capital growth in real-time, providing clear evidence of profitability after each trade. Users can adjust key parameters such as SMA period, take profit levels, and initial capital, making it a flexible solution for backtesting and strategy validation.
🔍 Key Features:
✅ SMA-Based Logic:
Core trading logic revolves around the Simple Moving Average (SMA).
SMA period is fully adjustable to suit various trading styles.
🎯 Customizable Take Profit (TP):
User-defined TP percentages per position.
TP line displayed as a Step Line with Breaks for clear segmentation.
Visual 🎯TP label for quick identification of profit targets.
💵 Capital Tracking (Proof of Profitability):
Initial capital is user-defined.
Capital balance updates after each closed trade.
Shows both absolute profit/loss and percentage changes for every position.
Darker green profit labels for better readability and dark red for losses.
📈 Capital Curve (Performance Visualization):
Capital growth curve available (hidden by default, can be enabled via settings).
📏 Dynamic Label Positioning:
Label positions adjust dynamically based on the price range.
Ensures consistent visibility across low and high-priced assets.
⚡ How It Works:
Long Entry:
Triggered when the price crosses above the SMA.
TP level is calculated as a user-defined percentage above the entry price.
Short Entry:
Triggered when the price crosses below the SMA.
TP level is calculated as a user-defined percentage below the entry price.
TP Execution:
Positions close immediately once the TP level is reached (no candle close confirmation needed).
🔔 Alerts:
🟩 Long Signal Alert: When the price crosses above the SMA.
🟥 Short Signal Alert: When the price crosses below the SMA.
🎯 TP Alert: When the TP target is reached.
⚙️ Customization Options:
📅 SMA Period: Choose the moving average period that best fits your strategy.
🎯 Take Profit (%): Adjust TP percentages for flexible risk management.
💵 Initial Capital: Set the starting capital for realistic backtesting.
📈 Capital Curve Toggle: Enable or disable the capital curve to track overall performance.
🌟 Why Use This Tool?
🔧 Flexible Strategy Creation: Adjust core parameters and create tailored SMA-based strategies.
📈 Performance Proof: Capital tracking acts as real proof of profitability after each trade.
🎯 Immediate TP Execution: No waiting for candle closures; profits lock in as soon as targets are hit.
💹 Comprehensive Performance Insights: Percentage-based and absolute capital tracking with dynamic visualization.
🏦 Clean Visual Indicators: Strategy insights made clear with dynamic labeling and adjustable visuals.
⚠️ Disclaimer:
This script is provided for educational and informational purposes only. Trading financial instruments carries risk, and past performance does not guarantee future results. Always perform your own due diligence before making any trading decisions.
C&P MA/KT Compare & Predict Moving average / Current market price.
This is simple table indicator. Located at right-top of chart. Shows which way will MA's head go.
I made this indicator for automate candle countings & compare price. With this friend, you will be know trend more faster then waiting traditional MA golden / dead crossing.
In factory settings, current market price will be compared with closing price of the candle, corresponding to previous number 7, 25, 60, 99, 130, 240. If Current market price is lower then past, the box for the corresponding MA is highlighted in red and appears as Down. In opposite case, it will be highlighted in green and indicates Up.
MA와 시장가 차이로 MA의 머리 방향을 예측해주는 간단한 지표입니다.
수동으로 캔들 되돌려서 종가와 시장가 비교하는게 너무 번거로워서 자동화를 위해 제작되었습니다. 해당 지표를 이용하시면 MA의 골든/데드 크로스를 기다리는 것보다 더 빠른 예측이 가능합니다.
차트 우측 상단에 예측 값이 표시되며, 기본 설정에선 7, 25, 60, 99, 130, 240개 전 캔들의 종가와 시장가가 비교됩니다. 시장가가 비교 값보다 높을 때는 초록 배경에 Up 텍스트가 출력됩니다. 반대의 경우엔 빨간색 배경에 Down 표기가 나타납니다.
Smart MA Crossover BacktesterSmart MA Crossover Backtester - Strategy Overview
Strategy Name: Smart MA Crossover Backtester
Published on: TradingView
Applicable Markets: Works well on crypto (tested profitably on ETH)
Strategy Concept
The Smart MA Crossover Backtester is an improved Moving Average (MA) crossover strategy that incorporates a trend filter and an ATR-based stop loss & take profit mechanism for better risk management. It aims to capture trends efficiently while reducing false signals by only trading in the direction of the long-term trend.
Core Components & Logic
Moving Averages (MA) for Entry Signals
Fast Moving Average (9-period SMA)
Slow Moving Average (21-period SMA)
A trade signal is generated when the fast MA crosses the slow MA.
Trend Filter (200-period SMA)
Only enters long positions if price is above the 200-period SMA (bullish trend).
Only enters short positions if price is below the 200-period SMA (bearish trend).
This helps in avoiding counter-trend trades, reducing whipsaws.
ATR-Based Stop Loss & Take Profit
Uses the Average True Range (ATR) with a multiplier of 2 to calculate stop loss.
Risk-Reward Ratio = 1:2 (Take profit is set at 2x ATR).
This ensures dynamic stop loss and take profit levels based on market volatility.
Trading Rules
✅ Long Entry (Buy Signal):
Fast MA (9) crosses above Slow MA (21)
Price is above the 200 MA (bullish trend filter active)
Stop Loss: Below entry price by 2× ATR
Take Profit: Above entry price by 4× ATR
✅ Short Entry (Sell Signal):
Fast MA (9) crosses below Slow MA (21)
Price is below the 200 MA (bearish trend filter active)
Stop Loss: Above entry price by 2× ATR
Take Profit: Below entry price by 4× ATR
Why This Strategy Works Well for Crypto (ETH)?
🔹 Crypto markets are highly volatile – ATR-based stop loss adapts dynamically to market conditions.
🔹 Long-term trend filter (200 MA) ensures trading in the dominant direction, reducing false signals.
🔹 Risk-reward ratio of 1:2 allows for profitable trades even with a lower win rate.
This strategy has been tested on Ethereum (ETH) and has shown profitable performance, making it a strong choice for crypto traders looking for trend-following setups with solid risk management. 🚀
MTF Ichimoku Conversion Line SMA with H/L mirrored levelsWelcome to MTF Ichimoku Conversion Line with SMA Highs/Lows Extended Lines!
1. Overview
It is designed to provide a multi-timeframe view of market trends and potential support/resistance levels by obtaining a Simple Moving Average (SMA) of the Conversion Line of Ichimoku Equibilium (Ichimoku Kinko-Hyo), which acts as a substantial trend line on the candlestick chart. The SMA of the conversion line smooths out price fluctuations and indicates the overall trend direction—if the candles are above it, the trend can be read as an uptrend, while below it, the trend can be read as a downtrend.
2. Calculation
The indicator first calculates the Conversion Line (see the description of Ichimoku theory anywhere, e.g., Wikipedia), as the average of the highest high and lowest low over a user-defined period (Conversion Line Length, default is 9, also recommended is 9).
It then retrieves this Conversion Line from a higher timeframe (MTF Timeframe) to add a broader perspective. Using a specified period (SMA Length)., an SMA is computed on this multi-timeframe conversion line. This SMA serves as a trend line that visually represents the prevailing price trend, making it easier to assess market direction.
3. Pivot Highs/low detection and drawing their extensions
In addition, the indicator identifies pivot highs and lows from the SMA data using a defined pivot length. When these pivots occur, horizontal lines are drawn and extended across the chart. These extended lines (drawn in a yellowish color by default) include a full extension, a half extension, and a middle extension line representing the midpoint between the high and low pivot.
4. Mirror lines
The indicator also offers optional mirror line features. When the Mirror Upside option is enabled, five additional lines are drawn above the highest extended yellow line at equal intervals. Similarly, when the Mirror Downside option is enabled, five lines are drawn below the lowest extended yellow line. These light gray mirror lines serve as extra reference levels, which can help identify potential support or resistance zones.
5. Parameters
User parameters include:
- Conversion Line Length: The period used to calculate the conversion line.
- MTF Timeframe: The higher timeframe from which the conversion line is obtained.
- SMA Length: The period over which the SMA is calculated on the conversion line.
- SMA Mode: A toggle to display either the SMA or the raw conversion line (SMA recommended).
- SMA Line Width: The thickness of the SMA line.
- Pivot Length for SMA Highs/Lows: The period used to detect pivot highs and lows in the SMA.
- Horizontal Extension: Number of bars by which the pivot and extended lines are drawn across the chart
- Colors for High and Low Pivot Lines and Extended Lines: Customizable colors are used to draw the lines.
Mirror Upside and Mirror Downside: These options enable drawing additional mirror lines above and below the extended lines.
- Hide Old Lines: An option to hide previous pivot lines once new ones are drawn for a cleaner chart. Turned on by default.
6. Conclusion
Overall, the Conversion Line SMA in this indicator smooths out the conversion line data and effectively functions as a trend line for the candlestick chart, helping traders visually interpret the underlying market trend. The extended and mirror lines provide further context for potential price reversal or continuation areas, making this a powerful tool for multi-timeframe technical analysis.
EMA/SMA Ribbon Pro (AUTO HTF + Labels)This indicator is a multi-timeframe (MTF) moving average ribbon that dynamically adjusts to the next highest timeframe. It provides a visual representation of market trends by stacking multiple EMAs and SMAs with customizable color fills and labels.
Features
✅ Multi-Timeframe (MTF) Support: Automatically detects the next highest time frame or allows for manual selection
✅ Customizable Moving Averages: Supports EMA and SMA with different lengths for flexible configuration
✅ Ribbon Visualization: Smooth color transitions between different moving averages for better trend identification
✅ Crossover Labels: Detects bullish and bearish EMA/SMA crossovers and marks them on the chart
✅ Price Labels & Timeframe Display: Displays moving average values to the right of the price axis with customizable label padding and colors
How It Works
Select the HTF mode: Manual or automatic
Choose EMA/SMA lengths to create different ribbons
Enable/disable price labels for each moving average
Customize colors and transparency for ribbons and labels
Crossover labels appear when faster moving averages cross slower ones and vice versa
Use Cases
📌 Trend Identification: Identify bullish and bearish trends using multiple EMAs and SMAs
📌 Support & Resistance Zones: MAs can act as dynamic support and resistance levels
📌 Reversal & Confirmation Signals: Watch for MTF crossovers to confirm trend changes
Customization
🔹 Standard EMA Lengths: 6, 8, 13, 21, 34, 48, 100, 200, 300, 400
🔹 SMA Lengths: 48, 100, 200
🔹 Color Adjustments: Set custom colors for bullish/bearish ribbons
🔹 Crossovers: Enable/disable custom crossover pairs (e.g., 100/200 EMA, 200 EMA/SMA).
This indicator is perfect for traders who rely on multi-timeframe confluence while seeking to enhance their market analysis and decision-making process.
As always, by combining EMA/SMA Ribbon with other tools, traders ensure that they are not relying on a single indicator. This layered approach can reduce the likelihood of false signals and improve overall trading accuracy.
As always, be sure to use any indicator with price action and volume indicators for better trade confirmation!
Sma Indicator with Ratio (pr)SMA Indicator with Ratio (PR) is a technical analysis tool designed to provide insights into the relationship between multiple Simple Moving Averages (SMAs) across different time frames. This indicator combines three key SMAs: the 111-period SMA, 730-period SMA, and 1400-period SMA. Additionally, it introduces a ratio-based approach, where the 730-period SMA is multiplied by factors of 2, 3, 4, and 5, allowing users to analyze potential market trends and price movements in relation to different SMA levels.
What Does This Indicator Do?
The primary function of this indicator is to track the movement of prices in relation to several SMAs with varying periods. By visualizing these SMAs, users can quickly identify:
Short-term trends (111-period SMA)
Medium-term trends (730-period SMA)
Long-term trends (1400-period SMA)
Additionally, the multiplied versions of the 730-period SMA provide deeper insights into potential price reactions at different levels of market volatility.
How Does It Work?
The 111-period SMA tracks the shorter-term price trend and can be used for identifying quick market movements.
The 730-period SMA represents a longer-term trend, helping users gauge overall market sentiment and direction.
The 1400-period SMA acts as a very long-term trend line, giving users a broad perspective on the market’s movement.
The ratio-based SMAs (2x, 3x, 4x, 5x of the 730-period SMA) allow for an enhanced understanding of how the price reacts to higher or lower volatility levels. These ratios are useful for identifying key support and resistance zones in a dynamic market environment.
Why Use This Indicator?
This indicator is useful for traders and analysts who want to track the interaction of price with different moving averages, enabling them to make more informed decisions about potential trend reversals or continuations. The added ratio-based values enhance the ability to predict how the market might react at different levels.
How to Use It?
Trend Confirmation: Traders can use the indicator to confirm the direction of the market. If the price is above the 111, 730, or 1400-period SMA, it may indicate an uptrend, and if below, a downtrend.
Support/Resistance Levels: The multiplied versions of the 730-period SMA (2x, 3x, 4x, 5x) can be used as dynamic support or resistance levels. When the price approaches or crosses these levels, it might indicate a change in the trend.
Volatility Insights: By observing how the price behaves relative to these SMAs, traders can gauge market volatility. Higher multiples of the 730-period SMA can signal more volatile periods where price movements are more pronounced.
EMA CROSS v1.0 by ScorpioneroIndicator Description: Multi-Timeframe SMA Table & Plot
This indicator displays a structured table of Simple Moving Averages (SMA) across multiple timeframes and plots them directly on the chart for better trend analysis.
Features:
✅ Multi-Timeframe SMA Calculation: Computes SMAs for different periods (10, 60, and 223) across six timeframes (1m, 3m, 5m, 15m, 30m, 60m).
✅ Sorted SMA Table: Displays a table in the bottom-right corner of the chart, showing the three SMAs per timeframe, sorted in descending order.
✅ Color-Coded Cells: Each SMA is highlighted with a specific color:
🟡 Yellow → 10-period SMA
🔵 Blue → 60-period SMA
🟣 Purple → 223-period SMA
⚪ Gray → Other values
✅ SMA Plotting on the Chart: All calculated SMAs are plotted directly on the price chart, allowing users to visualize their interaction with price movements.
How to Use:
The table provides a quick overview of SMA rankings across timeframes, helping identify bullish or bearish trends.
The SMA plots on the chart can be used for dynamic support/resistance analysis and trend confirmation.
This indicator is ideal for traders who rely on multi-timeframe trend analysis to make informed trading decisions! 🚀
by Scorpionero
Custom Length Moving AverageThe Custom Length Moving Average is a dynamic indicator that allows traders to plot a moving average with an adjustable length based on their preferred number of days. Users can choose between Simple Moving Average (SMA), Exponential Moving Average (EMA), or Weighted Moving Average (WMA) to match their trading strategy. The script automatically calculates the moving average length by factoring in the chart’s timeframe and trading session duration, ensuring precision and adaptability. This makes it an ideal tool for traders looking for a flexible moving average that adjusts to different market conditions and timeframes.
AI Volume Breakout for scalpingPurpose of the Indicator
This script is designed for trading, specifically for scalping, which involves making numerous trades within a very short time frame to take advantage of small price movements. The indicator looks for volume breakouts, which are moments when trading volume significantly increases, potentially signaling the start of a new price movement.
Key Components:
Parameters:
Volume Threshold (volumeThreshold): Determines how much volume must increase from one bar to the next for it to be considered significant. Set at 4.0, meaning volume must quadruplicate for a breakout signal.
Price Change Threshold (priceChangeThreshold): Defines the minimum price change required for a breakout signal. Here, it's 1.5% of the bar's opening price.
SMA Length (smaLength): The period for the Simple Moving Average, which helps confirm the trend direction. Here, it's set to 20.
Cooldown Period (cooldownPeriod): Prevents signals from being too close together, set to 10 bars.
ATR Period (atrPeriod): The period for calculating Average True Range (ATR), used to measure market volatility.
Volatility Threshold (volatilityThreshold): If ATR divided by the close price exceeds this, the market is considered too volatile for trading according to this strategy.
Calculations:
SMA (Simple Moving Average): Used for trend confirmation. A bullish signal is more likely if the price is above this average.
ATR (Average True Range): Measures market volatility. Lower volatility (below the threshold) is preferred for this strategy.
Signal Generation:
The indicator checks if:
Volume has increased significantly (volumeDelta > 0 and volume / volume >= volumeThreshold).
There's enough price change (math.abs(priceDelta / open) >= priceChangeThreshold).
The market isn't too volatile (lowVolatility).
The trend supports the direction of the price change (trendUp for bullish, trendDown for bearish).
If all these conditions are met, it predicts:
1 (Bullish) if conditions suggest buying.
0 (Bearish) if conditions suggest selling.
Cooldown Mechanism:
After a signal, the script waits for a number of bars (cooldownPeriod) before considering another signal to avoid over-trading.
Visual Feedback:
Labels are placed on the chart:
Green label for bullish breakouts below the low price.
Red label for bearish breakouts above the high price.
How to Use:
Entry Points: Look for the labels on your chart to decide when to enter trades.
Risk Management: Since this is for scalping, ensure each trade has tight stop-losses to manage risk due to the quick, small movements.
Market Conditions: This strategy might work best in markets with consistent volume and price changes but not extreme volatility.
Caveats:
This isn't real AI; it's a heuristic based on volume and price. Actual AI would involve machine learning algorithms trained on historical data.
Always backtest any strategy, and consider how it behaves in different market conditions, not just the ones it was designed for.
John Bob-Trading-BotDeveloped by Ayebale John Bob with the help of his bestie, this innovative strategy combines advanced Smart Money Concepts with practical risk management tools to help traders identify and capitalize on key market moves.
Key Features:
Smart Money Concepts & Fair Value Gaps (FVG):
The strategy monitors price action for fair value gaps, which are visualized as extremely faint horizontal lines on the chart. These FVGs signal potential areas where institutional traders might have entered or exited positions.
Dynamic Entry Signals:
Buy signals are triggered when the price crosses above the 50-bar lowest low or when a bullish FVG is detected. Conversely, sell signals are generated when the price falls below the 50-bar highest high or a bearish FVG is identified. Each signal is visually marked on the chart with clear buy (green) and sell (red) labels.
Multi-Level Order Execution:
Once an entry signal occurs, the strategy places five separate orders, each with its own take-profit (TP) level. The TP levels are calculated dynamically using the Average True Range (ATR) and a set of predefined multipliers. This allows traders to scale out of positions as the market moves favorably.
Dynamic Risk Management:
A stop-loss is automatically set at a distance determined by the ATR, ensuring that risk is managed in accordance with current market volatility.
Real-Time Trade Information Table:
In the bottom-right corner of the chart, a trade information table displays essential details about the current trade:
Side: Displays "BUY NOW" (with a dark green background) for long entries or "SELL NOW" (with a dark red background) for short entries.
Entry Price & Stop-Loss: Shows the entry price (highlighted in green) and the corresponding stop-loss level (highlighted in red).
Take-Profit Levels: Lists the five TP levels, each of which turns green once the market price reaches that target.
Timer: A live timer in minutes counts from the moment the current trade trigger started, helping traders track the duration of their active trades.
Visual Progress Bar:
A histogram-style progress bar is plotted on the chart, visually representing the percentage gain (or loss) relative to the entry price.
This strategy was meticulously designed to incorporate both technical analysis and smart risk management, offering a robust trading solution that adapts to changing market conditions. Whether you're a seasoned trader or just starting out, the AyebaleJohnBob Trading Bot equips you with the tools and visual cues needed to make well-informed trading decisions. Enjoy a seamless blend of strategy and style—crafted with passion by Ayebale John Bob and his bestie!
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.