Bayesian Price Projection Model [Pinescriptlabs]📊 Dynamic Price Projection Algorithm 📈
This algorithm combines **statistical calculations**, **technical analysis**, and **Bayesian theory** to forecast a future price while providing **uncertainty ranges** that represent upper and lower bounds. The calculations are designed to adjust projections by considering market **trends**, **volatility**, and the historical probabilities of reaching new highs or lows.
Here’s how it works:
🚀 Future Price Projection
A dynamic calculation estimates the future price based on three key elements:
1. **Trend**: Defines whether the market is predisposed to move up or down.
2. **Volatility**: Quantifies the magnitude of the expected change based on historical fluctuations.
3. **Time Factor**: Uses the logarithm of the projected period (`proyeccion_dias`) to adjust how time impacts the estimate.
🧠 **Bayesian Probabilistic Adjustment**
- Conditional probabilities are calculated using **Bayes' formula**:
\
This models future events using conditional information:
- **Probability of reaching a new all-time high** if the price is trending upward.
- **Probability of reaching a new all-time low** if the price is trending downward.
- These probabilities refine the future price estimate by considering:
- **Higher volatility** increases the likelihood of hitting extreme levels (highs/lows).
- **Market trends** influence the expected price movement direction.
🌟 **Volatility Calculation**
- Volatility is measured using the **ATR (Average True Range)** indicator with a 14-period window. This reflects the average amplitude of price fluctuations.
- To express volatility as a percentage, the ATR is normalized by dividing it by the closing price and multiplying it by 200.
- Volatility is then categorized into descriptive levels (e.g., **Very Low**, **Low**, **Moderate**, etc.) for better interpretation.
---
🎯 **Deviation Limits (Upper and Lower)**
- The upper and lower limits form a **projected range** around the estimated future price, providing a framework for uncertainty.
- These limits are calculated by adjusting the ATR using:
- A user-defined **multiplier** (`factor_desviacion`).
- **Bayesian probabilities** calculated earlier.
- The **square root of the projected period** (`proyeccion_dias`), incorporating the principle that uncertainty grows over time.
🔍 **Interpreting the Model**
This can be seen as a **dynamic probabilistic model** that:
- Combines **technical analysis** (trends and ATR).
- Refines probabilities using **Bayesian theory**.
- Provides a **visual projection range** to help you understand potential future price movements and associated uncertainties.
⚡ Whether you're analyzing **volatile markets** or confirming **bullish/bearish scenarios**, this tool equips you with a robust, data-driven approach! 🚀
Español :
📊 Algoritmo de Proyección de Precio Dinámico 📈
Este algoritmo combina **cálculos estadísticos**, **análisis técnico** y **la teoría de Bayes** para proyectar un precio futuro, junto con rangos de **incertidumbre** que representan los límites superior e inferior. Los cálculos están diseñados para ajustar las proyecciones considerando la **tendencia del mercado**, **volatilidad** y las probabilidades históricas de alcanzar nuevos máximos o mínimos.
Aquí se explica su funcionamiento:
🚀 **Proyección de Precio Futuro**
Se realiza un cálculo dinámico del precio futuro estimado basado en tres elementos clave:
1. **Tendencia**: Define si el mercado tiene predisposición a subir o bajar.
2. **Volatilidad**: Determina la magnitud del cambio esperado en función de las fluctuaciones históricas.
3. **Factor de Tiempo**: Usa el logaritmo del período proyectado (`proyeccion_dias`) para ajustar cómo el tiempo afecta la estimación.
🧠 **Ajuste Probabilístico con la Teoría de Bayes**
- Se calculan probabilidades condicionales mediante la fórmula de **Bayes**:
\
Esto permite modelar eventos futuros considerando información condicional:
- **Probabilidad de alcanzar un nuevo máximo histórico** si el precio sube.
- **Probabilidad de alcanzar un nuevo mínimo histórico** si el precio baja.
- Estas probabilidades ajustan la estimación del precio futuro considerando:
- **Mayor volatilidad** aumenta la probabilidad de alcanzar niveles extremos (máximos/mínimos).
- **La tendencia del mercado** afecta la dirección esperada del movimiento del precio.
🌟 **Cálculo de Volatilidad**
- La volatilidad se mide usando el indicador **ATR (Average True Range)** con un período de 14 velas. Este indicador refleja la amplitud promedio de las fluctuaciones del precio.
- Para obtener un valor porcentual, el ATR se normaliza dividiéndolo por el precio de cierre y multiplicándolo por 200.
- Además, se clasifica esta volatilidad en categorías descriptivas (e.g., **Muy Baja**, **Baja**, **Moderada**, etc.) para facilitar su interpretación.
🎯 **Límites de Desviación (Superior e Inferior)**
- Los límites superior e inferior representan un **rango proyectado** en torno al precio futuro estimado, proporcionando un marco para la incertidumbre.
- Estos límites se calculan ajustando el ATR según:
- Un **multiplicador** definido por el usuario (`factor_desviacion`).
- Las **probabilidades condicionales** calculadas previamente.
- La **raíz cuadrada del período proyectado** (`proyeccion_dias`), lo que incorpora el principio de que la incertidumbre aumenta con el tiempo.
---
🔍 **Interpretación del Modelo**
Este modelo se puede interpretar como un **modelo probabilístico dinámico** que:
- Integra **análisis técnico** (tendencias y ATR).
- Ajusta probabilidades utilizando **la teoría de Bayes**.
- Proporciona un **rango de proyección visual** para ayudarte a entender los posibles movimientos futuros del precio y su incertidumbre.
⚡ Ya sea que estés analizando **mercados volátiles** o confirmando **escenarios alcistas/bajistas**, ¡esta herramienta te ofrece un enfoque robusto y basado en datos! 🚀
波动率
MFI Top/Bottom [sinyalbak.com]MFI Top/Bottom with Bollinger Bands Indicator
Overview
This indicator combines the Money Flow Index (MFI) with Bollinger Bands to identify potential overbought and oversold conditions in the market. It offers a unique approach by applying Bollinger Bands to the MFI itself, providing additional context for divergence and extreme readings.
Features
Combined MFI and Bollinger Bands analysis
Optional RSI display
Customizable overbought/oversold zones
Visual highlighting of extreme conditions
Signal detection for potential reversals
Flexible visualization options
Indicator Components
1. Main Indicators
Money Flow Index (MFI): A momentum indicator that incorporates both price and volume
Relative Strength Index (RSI): Optional, can be displayed instead of or alongside MFI
Bollinger Bands: Applied to either MFI or RSI values
2. Visual Elements
Green line: MFI
Maroon line: RSI (when enabled)
Blue bands: Bollinger Bands
Yellow circles: Signals when MFI crosses Bollinger Bands
Colored zones: Highlighted overbought/oversold areas
3. Signal Zones
Overbought zone: 70-75
Oversold zone: 25-30
Middle line: 50
How to Use
1. Basic Setup
Set your preferred lookback period (default: 14)
Adjust the Bollinger Bands multiplier (default: 2.0)
Choose whether to display MFI, RSI, or both
2. Signal Interpretation
Overbought Signals: When MFI enters the 70-75 zone
Oversold Signals: When MFI enters the 25-30 zone
Strong Signals: When MFI crosses outside Bollinger Bands
Divergence: Watch for price/indicator divergence at extremes
3. Best Practices
Use in conjunction with other indicators for confirmation
Pay attention to overall trend direction
Look for divergences at extreme levels
Consider volume patterns alongside indicator signals
Customization Options
Input Parameters
Length: Adjusts the calculation period
Multiplier: Controls Bollinger Bands width
Display options for MFI/RSI
Zone highlighting toggles
Visual Settings
Adjustable line colors and styles
Customizable zone highlighting
Optional signal visualization
Tips for Trading
Entry Signals
Look for oversold conditions with bullish price action
Watch for overbought conditions with bearish price action
Confirm with Bollinger Band crosses
Exit Signals
Monitor extreme readings for potential reversals
Use middle line (50) crosses for trend changes
Watch for divergence between price and indicator
Risk Management
Don't rely solely on indicator signals
Consider using multiple timeframes
Set appropriate stop-loss levels
Technical Notes
Calculation based on HLC3 price
Volume-weighted momentum measurement
Adaptive bands based on standard deviation
Signal generation uses both static levels and dynamic bands
Disclaimer
This indicator is for educational and informational purposes only. Always conduct your own analysis and use proper risk management techniques when trading.
Power Of 3 ICT 01 [TradingFinder] AMD ICT & SMC Accumulations🔵 Introduction
The ICT Power of 3 (PO3) strategy, developed by Michael J. Huddleston, known as the Inner Circle Trader, is a structured approach to analyzing daily market activity. This strategy divides the trading day into three distinct phases: Accumulation, Manipulation, and Distribution.
Each phase represents a unique market behavior influenced by institutional traders, offering a clear framework for retail traders to align their strategies with market movements.
Accumulation (19:00 - 01:00 EST) takes place during low-volatility hours, as institutional traders accumulate orders. Manipulation (01:00 - 07:00 EST) involves false breakouts and liquidity traps designed to mislead retail traders. Finally, Distribution (07:00 - 13:00 EST) represents the active phase where significant market movements occur as institutions distribute their positions in line with the broader trend.
This indicator is built upon the Power of 3 principles to provide traders with a practical and visual tool for identifying these key phases. By using clear color coding and precise time zones, the indicator highlights critical price levels, such as highs and lows, helping traders to better understand market dynamics and make more informed trading decisions.
Incorporating the ICT AMD setup into daily analysis enables traders to anticipate market behavior, spot high-probability trade setups, and gain deeper insights into institutional trading strategies. With its focus on time-based price action, this indicator simplifies complex market structures, offering an effective tool for traders of all levels.
🔵 How to Use
The ICT Power of 3 (PO3) indicator is designed to help traders analyze daily market movements by visually identifying the three key phases: Accumulation, Manipulation, and Distribution.
Here's how traders can effectively use the indicator :
🟣 Accumulation Phase (19:00 - 01:00 EST)
Purpose : Identify the range-bound activity where institutional players accumulate orders.
Trading Insight : Avoid placing trades during this phase, as price movements are typically limited. Instead, use this time to prepare for the potential direction of the market in the next phases.
🟣 Manipulation Phase (01:00 - 07:00 EST)
Purpose : Spot false breakouts and liquidity traps that mislead retail traders.
Trading Insight : Observe the market for price spikes beyond key support or resistance levels. These moves often reverse quickly, offering high-probability entry points in the opposite direction of the initial breakout.
🟣 Distribution Phase (07:00 - 13:00 EST)
Purpose : Detect the main price movement of the day, driven by institutional distribution.
Trading Insight : Enter trades in the direction of the trend established during this phase. Look for confirmations such as breakouts or strong directional moves that align with broader market sentiment
🔵 Settings
Show or Hide Phases :mDecide whether to display Accumulation, Manipulation, or Distribution.
Adjust the session times for each phase :
Accumulation: 1900-0100 EST
Manipulation: 0100-0700 EST
Distribution: 0700-1300 EST
Modify Visualization : Customize how the indicator looks by changing settings like colors and transparency.
🔵 Conclusion
The ICT Power of 3 (PO3) indicator is a powerful tool for traders seeking to understand and leverage market structure based on time and price dynamics. By visually highlighting the three key phases—Accumulation, Manipulation, and Distribution—this indicator simplifies the complex movements of institutional trading strategies.
With its customizable settings and clear representation of market behavior, the indicator is suitable for traders at all levels, helping them anticipate market trends and make more informed decisions.
Whether you're identifying entry points in the Accumulation phase, navigating false moves during Manipulation, or capitalizing on trends in the Distribution phase, this tool provides valuable insights to enhance your trading performance.
By integrating this indicator into your analysis, you can better align your strategies with institutional movements and improve your overall trading outcomes.
BUY AND SELL Brahmastra IndicatorThe BUY AND SELL Brahmastra Indicator is a versatile and comprehensive trading tool tailored for intraday and swing traders. It integrates advanced technical analysis features such as CPR levels, support/resistance zones, trend detection, volume analysis, and custom pivot points. This indicator is ideal for traders aiming to understand market movements and make data-driven decisions efficiently.
Key Features
CPR Levels:
Automatically calculates and plots Central Pivot Range (CPR) for today, tomorrow, and weekly levels.
Includes support (S1, S2, S3) and resistance (R1, R2, R3) levels.
Highlights historical CPR for reference.
Market Structure Analysis:
Detects Break of Structure (BOS) and Change of Character (CHoCH).
Highlights bullish and bearish market zones dynamically.
Volume Analysis:
Integrates volume-weighted signals using VWAP (Volume Weighted Average Price).
Tracks high-volume areas to identify key liquidity zones.
Supertrend Integration:
Identifies buy/sell signals using ATR-based Supertrend.
Includes customizable settings for sensitivity and alerts.
Order Blocks Detection:
Identifies bullish and bearish order blocks.
Alerts for price mitigation of order blocks.
ADX Dashboard:
Displays the ADX (Average Directional Index) for multiple timeframes (3m, 5m, 15m).
Helps assess the strength of the trend across different timeframes.
RSI Divergence:
Detects bullish and bearish divergences on RSI for trend reversals.
Includes customizable pivot levels for better accuracy.
Multi-Layer Customization:
Allows users to adjust colors, line styles, and visibility for various components.
Fully customizable for different trading styles.
How It Works
CPR and Pivot Levels:
CPR, support, and resistance levels are calculated based on the previous day’s high, low, and close.
Weekly CPR uses aggregated weekly data for broader market context.
Market Structure:
Analyzes price movements to detect significant structure breaks and changes.
Plots dynamic support/resistance zones for real-time market updates.
Volume and Trend Indicators:
VWAP tracks intraday volume trends for price direction.
Supertrend provides clear buy/sell signals with alerts for trend reversals.
Order Blocks:
Uses momentum to detect zones of interest where price action is likely to react.
Differentiates between bullish and bearish zones for precise entry/exit points.
RSI and ADX:
RSI identifies overbought/oversold conditions with divergence signals.
ADX measures trend strength and helps confirm the trend.
Key Inputs
CPR Settings:
Enable/disable tomorrow’s CPR, historical CPR, and weekly CPR.
Supertrend Settings:
ATR Period and multiplier for sensitivity adjustment.
Order Block Settings:
Custom sensitivity for order block detection.
RSI Settings:
Length and overbought/oversold levels for divergence detection.
Benefits
Real-Time Alerts:
Receive notifications for buy/sell signals, structure breaks, and order block mitigations.
Enhanced Visualization:
Clear and intuitive plotting of pivot levels, trends, and divergences.
Customizable to User Preferences:
Tailored settings for line colors, transparency, and indicator lengths.
Use Cases
Intraday Trading:
Analyze intraday trends using CPR, VWAP, and Supertrend.
Identify entry and exit points based on order blocks and RSI divergences.
Swing Trading:
Use weekly CPR and ADX to confirm larger trends and set targets.
Spot potential reversals with RSI divergences and market structure analysis.
Bull Bear Candles with Volume ProfileUser Guide for Bull Bear Candles Indicator with Keltner Channels
Author: NellyN
Introduction
This indicator helps identify potential bullish and bearish trends in the market by analyzing buying and selling volume over two configurable timeframes. It calculates the percentage of buying and selling volume and displays the current market condition based on two moving averages for 2 periods.
Key Features
• Volume Analysis : Calculates Buy and Sell Volume for two configurable timeframes (e.g., 5 min, 15 min, 15 min. and 1 hour, etc.) and displays them as percentages.
• Moving Averages : Uses one Moving Average (MA) for two different time periods to identify trends (uptrend when shorter-term MA is above longer-term MA). You can also choose other Moving Average types like SMA, EMA, WMA, RMA, VWMA, or HMA.
• Colored Candles : Candles are colored green for bullish conditions, red for bearish conditions, and gray for neutral conditions.
• Market Condition Labels : Displays labels in table-view indicating the current market condition based on Buy and Sell Volume (Very Bullish, Very Bearish, Bullish/Bearish Retracement, Chop).
• Alerts: Generates alerts for potential buy and sell signals based on indicator conditions (Note: Enable alerts in the indicator settings).
• Visual Signals: Provides visual signals through colored candles and market condition labels in addition to alerts.
Input Parameters
• Source: Close price (default) or Heikin Ashi
• Timeframe: Select the timeframe for price and volume data used in the indicator (e.g., Daily, Hourly).
• Colored Candles On: Enable (True) or disable (False) coloring candles based on market conditions.
• Enable Alerts: Enable (True) or disable (False) alerts for buy/sell signals.
• Length of MA: Sets the length for the MAs used in trend identification (minimum 1).
• Lookback Period Vol. 1 & 2: Define the timeframes used to calculate buying and selling volume and the MA calculation (e.g., 5 min, 15 min).
Understanding the Outputs
• Cloud Fill: The area between two MAs is filled with a color that reflects the trend (green for uptrend, red for downtrend).
• Table: Shows Buy Volume, Sell Volume, Buy Percentage, Sell Percentage, and the current Market Condition Labels. (If you decide to see them uncomment them from the code simply removing the // in front of the code)
• Colored Candles and Market Condition Labels: Look for green candles and bullish labels for potential buying opportunities, and vice versa for red candles and bearish labels.
Bullish green label appears when short-term MA is above long-term MA AND Buy Volume percentage is greater than 50%.
Red cross for exiting long entry appears when we have bearish volume OR bearish crossover of the MA for the 2 periods.
Bearish red label appears when short-term MA is below long-term MA AND Buy Volume percentage is less than 50%.
Green cross for exiting short entry appears when we have bullish volume OR bullish crossover of the MA for the 2 periods.
• Bullish/Bearish Retracement: The moving averages indicate a potential trend reversal, while the Buy Volume percentage suggests a continuation of the prior trend. The candle color may be green, red, or gray depending on the current price position relative to the moving averages.
• Chop (Gray Candle): The moving averages are flat and the Buy Volume percentage is not significantly above or below 50%.
• Buy/Sell Alerts: The indicator generates alerts based on specific conditions, but these should be used in conjunction with other trading strategies and careful risk management.
Important Notes
• This indicator is for informational purposes only and should not be considered financial advice. Back-test the indicator with historical data to understand its performance before using it for live trading.
• Combine this indicator with other technical analysis tools.
ADR%>5, MA10>MA20This indicator is designed to help studying historical charts. It is inspired by the breakout method that Qullamaggie teaches. His message is to study 1000's of charts to define a setup that will allow you to trade with conviction. The idea came to me after seeing chilllaxtrader's indicator for indices that indicates a good market environment for long breakouts in individual stocks.
This indicator gives a green background whenever ADR% is higher than 5 and the Simple Moving Average 10 is above the Simple Moving Average 20, which is a good time to start looking for long breakout patterns.
Good luck studying charts and defining your setup!
ORB Screener with Trailing SLThis is an extension to our already published script ORB with ATR Trailing SL indicator
Many people requested to add screener to the existing indicator but since it's slowing down the performance heavily, we decided to add this as a separate screener.
Note: This screener does NOT plot the chart and so you want to have both plotting and screener, use both scripts together.
Overview:
The ORB Screener is a TradingView indicator designed to assist traders in identifying breakout opportunities based on the Opening Range Breakout (ORB) strategy. It features multi-symbol screening, customizable session timeframes, and a detailed table for quick visual reference and stock scanning.
The ORB Screener utilizes the ORB strategy to calculate breakout levels for multiple symbols. It identifies the high and low during a specified session (e.g., first 5 minutes after market open) and provides insights on whether the price is above the high (bullish), below the low (bearish), or between the range (neutral).
Additionally, the script calculates and displays the RSI values for each symbol, aiding traders in assessing momentum alongside breakout status.
Note: One can add up to 40 symbols for screening the stocks.
Key Features and Inputs:
ORB Session Time: Define a specific timeframe (e.g., "0915-0920") during which the ORB high and low are calculated. This serves as the foundation for identifying breakouts.
Multi-Symbol Screening: Screen up to 40 symbols at once, enabling you to monitor multiple opportunities without switching charts.
Breakout Validation:
Select from two methods for confirming a breakout: Close (based on closing prices) or Touch (based on intraday highs/lows).
Breakout Status Indicators:
Above High: Indicates a current bullish breakout when the price exceeds the ORB high.
Below Low: Indicates a current bearish breakout when the price falls below the ORB low.
Between Range: Indicates no breakout (price remains within the range).
RSI Integration : Calculates the RSI for each symbol to help traders evaluate momentum alongside breakout signals.
Customizable Table Display:
Position: Place the data table at the top, middle, or bottom of the chart and align it left, center, or right.
Size: Choose from multiple table size options for optimal visibility (Auto, Huge, Large, Normal, Small, Tiny).
Visual Feedback:
Green Background: Indicates a breakout happened at least once above the ORB high.
Red Background: Indicates a breakout happened at least once below the ORB low.
Gray Background: Indicates price is within the ORB range.
Fisher Squeeze Maho by index_yunusThe strategy is built around the philosophy of aligning trades with momentum and market trends while managing risk dynamically. It combines Fisher Transform, which identifies directional momentum shifts, with the TDI Squeeze, which captures periods of volatility contraction followed by potential breakout opportunities. The inclusion of a trend filter (e.g., 200 SMA) ensures trades are executed in the direction of the dominant market trend, avoiding counterproductive entries in sideways or adverse conditions. Risk management is central to the approach, utilizing ATR-based stop-loss, take-profit, and trailing stop levels to adapt dynamically to changing market volatility. This balance between trend alignment, momentum confirmation, and adaptive risk management aims to maximize profitable opportunities while minimizing drawdowns.
Squeeze Momentum indicatorThe Squeeze Mometum indicator plots the change in price momentum on a histogram. Its formula is given by:
Squeeze = ta.linreg(source - ((ta.highest(high, lenght) + ta.lowest(low, lenght) + ta.sma(close, lenght)) / 3), lenght, 0)
Squeeze can indicate trend reversals when crossing the zero line
Squeeze can indicate bull/bear rallys wheter if it is increasing or decreasing
Naji's Price Change DetectorThis indicator detects when the price goes up or down by a customizable % and time. This allows the user to detect large changes in the market in order to try to catch the reversal.
This does not detect the reversal, you need to decide when to enter the trade yourself.
Key Features:
Customizable Settings:
Percent Change Threshold: You can change this in the settings panel (default = 4%).
Number of Bars to Check: Adjustable between 1 and any desired number of bars (default = 5).
Dynamic Calculation:
The script calculates the price change for every bar within the specified range.
Alerts:
Alerts are customized to reflect the chosen settings and will trigger only once per bar close.
Background Highlights:
Green: A price increase exceeding the threshold was detected.
Red: A price decrease exceeding the threshold was detected.
HPDR BandsThis script plots High Probability Density Region (HPDR) Bands, a set of price levels dynamically calculated based on the visible high, low, and midline. Key Fibonacci and percentage levels (100%, 95%, 88%, etc.) are explicitly plotted as support and resistance zones, with semi-transparent shading for better visual clarity. Labels on each line show the exact percentage for quick reference.
The Probability Density Plot (purple line) tracks the price’s position relative to the range, helping you visualize where the current price lies in the dynamic range. This tool is ideal for identifying high-probability price zones, potential reversals, or continuation points, making it a versatile addition to your trading strategy.
Magic Trend lineThe Magic Trend line is derived using the Commodity Channel Index (CCI), along with adjustments based on the Average True Range (ATR) to create a dynamic trend-following indicator. The key idea behind this is to provide a smoothed trend line that responds to both market volatility (using ATR) and the underlying price action (via CCI).
Here’s a step-by-step breakdown of how the Magic Trend line is calculated:
1. CCI Calculation
The Commodity Channel Index (CCI) is a momentum-based indicator that measures the deviation of the current price from its average over a specified period. In this script:
The CCI period is set to 20 bars by default, controlled by the lengthCCI input.
The CCI formula is:
𝐶
𝐶
𝐼
=
Close
−
SMA(Close, lengthCCI)
0.015
×
Mean Deviation
CCI=
0.015×Mean Deviation
Close−SMA(Close, lengthCCI)
where the Mean Deviation is the average of the absolute differences between the close price and the SMA of the close.
2. ATR-Based Trend Bands
The Average True Range (ATR) is a measure of volatility, and it's used here to define dynamic upper and lower trend bands. These bands adjust based on the volatility of the market, providing a flexible trend filter.
The ATR period is set to 5 bars by default, controlled by the AP input.
The ATR multiplier (coeff) is set to 1.0 by default.
Using the ATR, two trend bands are calculated:
Upper Trend Band (upT): low - ATR * coeff
Lower Trend Band (downT): high + ATR * coeff
These bands help to determine whether the market is in an uptrend or a downtrend, and they dynamically adjust to market conditions.
3. Magic Trend Line Adjustment
Once the CCI is calculated and the ATR-based bands are defined, the Magic Trend line (MagicTrend) is determined as follows:
If the CCI is greater than or equal to 0 (indicating a bullish market condition), the Magic Trend is pushed upwards towards the upper trend band, ensuring the trend does not dip below the upward ATR-based boundary. The line is adjusted to be the maximum of the previous Magic Trend value and the upper trend boundary.
MagicTrend
=
max
(
upT
,
MagicTrend
)
MagicTrend=max(upT,MagicTrend )
If the CCI is less than 0 (indicating a bearish market condition), the Magic Trend is pushed downwards towards the lower trend band, ensuring the trend does not rise above the downward ATR-based boundary. The line is adjusted to be the minimum of the previous Magic Trend value and the lower trend boundary.
MagicTrend
=
min
(
downT
,
MagicTrend
)
MagicTrend=min(downT,MagicTrend )
This approach smooths the CCI values while constraining them within dynamically adjusted trend bands based on market volatility.
4. Trend Coloring
The Magic Trend line is colored blue when the trend is bullish (CCI ≥ 0).
It is colored red when the trend is bearish (CCI < 0).
In Summary:
The Magic Trend is essentially a dynamic trend line that adapts to both price momentum (via CCI) and market volatility (via ATR). It is designed to smooth out the market's fluctuations and provide a clear visual indication of the trend direction. The line itself is adjusted to never exceed certain volatility boundaries defined by the ATR, ensuring it remains in sync with the market's natural fluctuations. The trend direction is color-coded for easy interpretation: blue for bullish trends and red for bearish trends.
Accumulation Distribution Moving Average Indexthis is the moving average of the accumulation/distribution indicator, to capture both price and volume changes
HPSAHNI TR/ATR/DATRHi,
This Is Tr/Atr/Dart formula. Basically For KTP Students .
you can find True Value , Average True Value, and Daily Average True Value
this is a beneficially tool .
Enjoy Trading
thanks
HPSAHNI
Triple EMA IndicatorThis is an indicator with 3 EMAs with changeable period duration. The color of each EMA alternates between green and red depending on whether it is increasing or decreasing (respectively)
Advanced Pivot Manipulation SuperTrend - Consolidation ZoneHere’s the description translated into English for your TradingView publication:
---
Advanced Pivot Manipulation SuperTrend - Consolidation Zone
Description :
This advanced indicator combines multiple technical tools to provide a comprehensive analysis of trends, key levels, and consolidation zones. Ideal for traders seeking to spot opportunities while avoiding the traps of flat markets, it helps you better understand market dynamics and improve your trading decisions.
Key Features:
1.
Dynamic SuperTrend with Pivot Points:
- An enhanced SuperTrend algorithm based on pivot points for more precise trend tracking.
- Thresholds (Up/Dn) are dynamically adjusted using ATR (Average True Range) for improved volatility adaptation.
2. Consolidation Zones:
- Automatically identifies periods when the market moves within a narrow range (1% by default).
- Consolidation zones are visually highlighted to help avoid risky trades.
3. Dynamic Support and Resistance:
- Automatically calculates support and resistance levels based on a rolling period (configurable).
- These levels serve as key references for potential breakouts or trend reversals.
4. Advanced Detection Tools:
- Includes a volume multiplier and shadow-to-body ratio to signal unusual or potentially manipulated moves (e.g., spoofing).
5. Intuitive Visuals:
- SuperTrend lines are color-coded to indicate bullish (green) or bearish (red) trends.
- Semi-transparent lines mark support and resistance levels, and red backgrounds indicate consolidation zones.
Customizable Parameters:
- Pivot Point Period: Adjust the period for detecting pivot highs and lows.
- ATR Factor and Period: Control the sensitivity of the SuperTrend indicator.
- Lookback Period for S/R: Define the duration for calculating support and resistance levels.
- Volume Multiplier and Shadow/Body Ratio: Configure thresholds for detecting high volumes or anomalies in candlestick patterns.
How to Use:
- Easily identify dominant trends using the SuperTrend.
- Spot consolidation zones to avoid inefficient trades or prepare breakout strategies.
- Use support and resistance levels as reference points for placing orders or adjusting risk management.
Target Audience:
- Intraday and swing traders.
- Anyone looking for a comprehensive and customizable indicator to effectively analyze volatile markets.
---
Notes:
The indicator is fully customizable to suit your needs and strategies. Feel free to experiment with the parameters to maximize its effectiveness according to your trading style.
Keywords: SuperTrend, Support and Resistance, Consolidation, Pivot Points, Trends, ATR, Advanced Trading.
---
This description highlights the indicator’s strengths and is designed to appeal to the TradingView community.
Volatility % (Standard Deviation of Returns)This script takes closing prices of candles to measure the Standard Deviation (σ) which is then used to calculate the volatility by taking the stdev of the last 30 candles and multiplying it by the root of the trading days in a year, month and week. It then multiplies that number by 100 to show a percentage.
Default settings are annual volatility (252 candles, red), monthly volatility (30 candles, blue) and weekly volatility (5 candles, green) if you use daily candles. It is open source so you can increase the number of candles with which the stdev is calculated, and change the number of the root that multiplies the stdev.
ATR and Volume AnalysisHi!
I would like to present an indicator that's meant to measure ratio of Volatility to Volume.
Basically it measures 2 moving averages (14 and 100 period) of ATR and Volume and then compares them. The output is ATR14 / Vol14
Color scheme
Red: Volume and ATR is both below 14 period
Green: Both are above
Yellow: Volume up, volatility down
Purple: Volume down, volatility up
Then there are two lines - 1 and 1.5
That is, in my opinion, the most optimal state to trade, because 1 means that there is some volatility and it's confirmed by volume. Above 1,5 you could see it as overbought (or oversold) zone. If it's above this line, we could expect a retracement since the volatility is not backed by volume. Above 2 it's quite critical and I would suggest closing trades.
(You can use it across all timeframes. In fact it's better if you do so. Longer timeframes are good for spotting tradeable markets while shorter timeframes show overbought / oversold zones)
I have also added option to choose between 4 different moving averages, but in my opinion RMA works the best.
Feel free to share some feedback, I would really appreciate it.
Sincerely,
Beefmaster
Conditional Value at Risk (CVaR)This Pine Script implements the Conditional Value at Risk (CVaR), a risk metric that evaluates the potential losses in a financial portfolio beyond a certain confidence level, incorporating both the Value at Risk (VaR) and the expected loss given that the VaR threshold has been breached.
Key Features:
Input Parameters:
length: Defines the observation period in days (default is 252, typically used to represent the number of trading days in a year).
confidence: Specifies the confidence interval for calculating VaR and CVaR, with values between 0.5 and 0.99 (default is 0.95, indicating a 95% confidence level).
Logarithmic Returns Calculation: The script computes the logarithmic returns based on the daily closing prices, a common method to measure financial asset returns, given by:
Log Return=ln(PtPt−1)
Log Return=ln(Pt−1Pt)
where PtPt is the price at time tt, and Pt−1Pt−1 is the price at the previous time point.
VaR Calculation: Value at Risk (VaR) is estimated as the percentile of the returns array corresponding to the given confidence interval. This represents the maximum loss expected over a given time horizon under normal market conditions at the specified confidence level.
CVaR Calculation: The Conditional VaR (CVaR) is calculated as the average of the returns that fall below the VaR threshold. This represents the expected loss given that the loss has exceeded the VaR threshold.
Visualization: The script plots two key risk measures:
VaR: The maximum potential loss at the specified confidence level.
CVaR: The average of the losses beyond the VaR threshold.
The script also includes a neutral line at zero to help visualize the losses and their magnitude.
Source and Scientific Background:
The concept of Value at Risk (VaR) was popularized by J.P. Morgan in the 1990s, and it has since become a widely-used tool for risk management (Jorion, 2007). Conditional Value at Risk (CVaR), also known as Expected Shortfall, addresses the limitation of VaR by considering the severity of losses beyond the VaR threshold (Rockafellar & Uryasev, 2002). CVaR provides a more comprehensive risk measure, especially in extreme tail risk scenarios.
References:
Jorion, P. (2007). Value at Risk: The New Benchmark for Managing Financial Risk. McGraw-Hill Education.
Rockafellar, R.T., & Uryasev, S. (2002). Conditional Value-at-Risk for General Loss Distributions. Journal of Banking & Finance, 26(7), 1443–1471.
Candle Spread
Candle Spread is an indicator that helps traders measure the range of price movement within each candle over a specified time period. It calculates the range of the candle between the High and Low (High - Low) and displays it in a separate window below the chart as columns.
Key Features:
Colored Bars: The bars are colored based on the candle's direction:
Bullish Candle: Bars are Green.
Bearish Candle: Bars are Red.
Moving Average: The indicator includes a 30-period Simple Moving Average (SMA), which represents the overall average range of the candles.
Helps Identify Market Volatility: This indicator helps traders identify wide-range candles (signaling high volatility in the market), which could indicate a surge in momentum or potential trend reversals.
followerFollower Indicator
This custom Follower Indicator is designed to track market trends and generate buy/sell signals based on price movements and adaptive moving averages. The indicator adjusts dynamically to market conditions using an Exponential Moving Average (EMA) and a smoothed average of the high-low range over the last 20 bars.
Key Features:
Adaptive Trend Following: The indicator uses an EMA of the close price along with a dynamically adjusted range (high-low) to create an adaptive trend-following line.
Buy and Sell Signals: Buy signals are generated when the EMA crosses above the follower line, while sell signals occur when the follower line crosses above the EMA.
Dynamic Color Coding: The indicator line changes color based on the relationship between the price and the follower line. It turns blue when the price is above the follower line and red when the price is below.
Customizable Parameters: Users can adjust the range multiplier (oran) and the EMA period (uzunluk) to fine-tune the indicator to different market conditions.
How to Use:
Buy Signal: A buy signal is triggered when the EMA crosses above the follower line.
Sell Signal: A sell signal is triggered when the follower line crosses above the EMA.
Notes:
This indicator is intended to help identify market trends and potential entry/exit points based on price behavior and momentum.
It is recommended to use this indicator in conjunction with other technical analysis tools and risk management strategies.
Feel free to adjust the parameters based on your trading style and preferences. Happy trading!
Honest Volatility Grid [Honestcowboy]The Honest Volatility Grid is an attempt at creating a robust grid trading strategy but without standard levels.
Normal grid systems use price levels like 1.01;1.02;1.03;1.04... and place an order at each of these levels. In this program instead we create a grid using keltner channels using a long term moving average.
🟦 IS THIS EVEN USEFUL?
The idea is to have a more fluid style of trading where levels expand and follow price and do not stick to precreated levels. This however also makes each closed trade different instead of using fixed take profit levels. In this strategy a take profit level can even be a loss. It is useful as a strategy because it works in a different way than most strategies, making it a good tool to diversify a portfolio of trading strategies.
🟦 STRATEGY
There are 10 levels below the moving average and 10 above the moving average. For each side of the moving average the strategy uses 1 to 3 orders maximum (3 shorts at top, 3 longs at bottom). For instance you buy at level 2 below moving average and you increase position size when level 6 is reached (a cheaper price) in order to spread risks.
By default the strategy exits all trades when the moving average is reached, this makes it a mean reversion strategy. It is specifically designed for the forex market as these in my experience exhibit a lot of ranging behaviour on all the timeframes below daily.
There is also a stop loss at the outer band by default, in case price moves too far from the mean.
What are the risks?
In case price decides to stay below the moving average and never reaches the outer band one trade can create a very substantial loss, as the bands will keep following price and are not at a fixed level.
Explanation of default parameters
By default the strategy uses a starting capital of 25000$, this is realistic for retail traders.
Lot sizes at each level are set to minimum lot size 0.01, there is no reason for the default to be risky, if you want to risk more or increase equity curve increase the number at your own risk.
Slippage set to 20 points: that's a normal 2 pip slippage you will find on brokers.
Fill limit assumtion 20 points: so it takes 2 pips to confirm a fill, normal forex spread.
Commission is set to 0.00005 per contract: this means that for each contract traded there is a 5$ or whatever base currency pair has as commission. The number is set to 0.00005 because pinescript does not know that 1 contract is 100000 units. So we divide the number by 100000 to get a realistic commission.
The script will also multiply lot size by 100000 because pinescript does not know that lots are 100000 units in forex.
Extra safety limit
Normally the script uses strategy.exit() to exit trades at TP or SL. But because these are created 1 bar after a limit or stop order is filled in pinescript. There are strategy.orders set at the outer boundaries of the script to hedge against that risk. These get deleted bar after the first order is filled. Purely to counteract news bars or huge spikes in price messing up backtest.
🟦 VISUAL GOODIES
I've added a market profile feature to the edge of the grid. This so you can see in which grid zone market has been the most over X bars in the past. Some traders may wish to only turn on the strategy whenever the market profile displays specific characteristics (ranging market for instance).
These simply count how many times a high, low, or close price has been in each zone for X bars in the past. it's these purple boxes at the right side of the chart.
🟦 Script can be fully automated to MT5
There are risk settings in lot sizes or % for alerts and symbol settings provided at the bottom of the indicator. The script will send alert to MT5 broker trying to mimic the execution that happens on tradingview. There are always delays when using a bridge to MT5 broker and there could be errors so be mindful of that. This script sends alerts in format so they can be read by tradingview.to which is a bridge between the platforms.
Use the all alert function calls feature when setting up alerts and make sure you provide the right webhook if you want to use this approach.
Almost every setting in this indicator has a tooltip added to it. So if any setting is not clear hover over the (?) icon on the right of the setting.