Multiple Swing High/Low with SLExplanation:
Swing Highs and Lows:
The script detects swing highs and swing lows using ta.pivothigh() and ta.pivotlow() on a 3-minute basis.
Each swing high is drawn with a green line, and each swing low is drawn with a red line.
Stop-Loss (SL) Lines:
For each swing high, a stop-loss line is drawn 15 points below the swing high.
For each swing low, a stop-loss line is drawn 15 points above the swing low.
The SL line for swing highs is drawn in red, and the SL line for swing lows is drawn in blue.
Labels for Swing High/Low and SL:
Labels with text like "Swing High" or "Swing Low" are added at the swing points, and SL labels are added at the stop-loss levels.
These labels can be toggled on/off using the showSwingTags input.
Line Extension:
The line.set_x2() function ensures that the swing lines and SL lines are extended to the current bar as price moves.
Key Changes:
Removed Arrays: Instead of using arrays to store lines and labels, we now handle each line and label individually. This avoids the issue where complex types (line and label) were being stored in arrays, which Pine Script doesn't support directly.
Dynamic Creation: New lines and labels are dynamically created as new swings occur, and they stay on the chart until the script is removed or the chart is reloaded.
Bill Williams-Indikatoren
Multiple Swing High/Low with SLExplanation:
Swing Highs and Lows:
The script detects swing highs and swing lows using ta.pivothigh() and ta.pivotlow() on a 3-minute basis.
Each swing high is drawn with a green line, and each swing low is drawn with a red line.
Stop-Loss (SL) Lines:
For each swing high, a stop-loss line is drawn 15 points below the swing high.
For each swing low, a stop-loss line is drawn 15 points above the swing low.
The SL line for swing highs is drawn in red, and the SL line for swing lows is drawn in blue.
Labels for Swing High/Low and SL:
Labels with text like "Swing High" or "Swing Low" are added at the swing points, and SL labels are added at the stop-loss levels.
These labels can be toggled on/off using the showSwingTags input.
Line Extension:
The line.set_x2() function ensures that the swing lines and SL lines are extended to the current bar as price moves.
Key Changes:
Removed Arrays: Instead of using arrays to store lines and labels, we now handle each line and label individually. This avoids the issue where complex types (line and label) were being stored in arrays, which Pine Script doesn't support directly.
Dynamic Creation: New lines and labels are dynamically created as new swings occur, and they stay on the chart until the script is removed or the chart is reloaded.
Altcoin Season Indicator//@version=5
indicator("Altcoin Season Indicator", overlay=false)
// Input for Bitcoin Dominance (BTC.D)
btcDominance = request.security("CRYPTOCAP:BTC.D", "D", close)
altcoinMarketCap = request.security("CRYPTOCAP:TOTAL2", "D", close)
// Moving Averages for Trend Analysis
btcMA = ta.sma(btcDominance, 50)
altMA = ta.sma(altcoinMarketCap, 50)
// RSI for Momentum
btcRSI = ta.rsi(btcDominance, 14)
altRSI = ta.rsi(altcoinMarketCap, 14)
// Altcoin Season Conditions
btcBearish = btcDominance < btcMA and btcRSI < 50
altBullish = altcoinMarketCap > altMA and altRSI > 50
// Signal for Altcoin Season
altcoinSeason = btcBearish and altBullish
// Plotting
bgcolor(altcoinSeason ? color.new(color.green, 90) : na)
plot(btcDominance, color=color.red, title="BTC Dominance")
plot(altcoinMarketCap / 1e12, color=color.blue, title="Altcoin Market Cap (T)")
alertcondition(altcoinSeason, title="Altcoin Season Signal", message="Altcoin Season may be starting!")
AuriumFlowAURIUM (GOLD-Weighted Average with Fractal Dynamics)
Aurium is a cutting-edge indicator that blends volume-weighted moving averages (VWMA), fractal geometry, and Fibonacci-inspired calculations to deliver a precise and holistic view of market trends. By dynamically adjusting to price and volume, Aurium uncovers key levels of confluence for trend reversals and continuations, making it a powerful tool for traders.
Key Features:
Dynamic Trendline (GOLD):
The central trendline is a weighted moving average based on price and volume, tuned using Fibonacci-based fast (34) and slow (144) exponential moving average lengths. This ensures the trendline adapts seamlessly to the flow of market dynamics.
Formula:
GOLD = VWMA(34) * Volume Factor + VWMA(144) * (1 - Volume Factor)
Fractal Highs and Lows:
Detects pivotal market points using a fractal lookback period (default 5, odd-numbered). Fractals identify local highs and lows over a defined window, capturing the structure of market cycles.
Trend Background Highlighting:
Bullish Zone: Price above the GOLD line with a green background.
Bearish Zone: Price below the GOLD line with a red background.
Buy and Sell Alerts:
Generates actionable signals when fractals align with GOLD. Bullish fractals confirm continuation or reversal in an uptrend, while bearish fractals validate a downtrend.
The Math Behind Aurium:
Volume-Weighted Adjustments:
By integrating volume into the calculation, Aurium dynamically emphasizes price levels with greater participation, giving traders insight into zones of institutional interest.
Formula:
VWMA = EMA(Close * Volume) / EMA(Volume)
Fractal Calculations:
Fractals are identified as local maxima (highs) or minima (lows) based on the surrounding bars, leveraging the natural symmetry in price behavior.
Fibonacci Relationships:
The 34 and 144 EMA lengths are Fibonacci numbers, offering a natural alignment with price cycles and market rhythms.
Ideal For:
Traders seeking a precise and intuitive indicator for aligning with trends and detecting reversals.
Strategies inspired by Bill Williams, with added volume and fractal-based insights.
Short-term scalpers and long-term trend-followers alike.
Unlock deeper market insights and trade with precision using Aurium!
Strength of Divergence Across Multiple Indicators (+CMF&VWMACD)Modified Version of Strength of Divergence Across Multiple Indicators by reees
Purpose:
This Pine Script indicator is designed to identify and evaluate the strength of bullish and bearish divergences across multiple technical indicators. Divergences occur when the price of an asset is moving in one direction while a technical indicator is moving in the opposite direction, potentially signaling a trend reversal.
Key Features:
1. Multiple Indicator Support: The script now analyzes divergences for the following indicators:
* RSI (Relative Strength Index)
* OBV (On-Balance Volume)
* MACD (Moving Average Convergence/Divergence)
* STOCH (Stochastic Oscillator)
* CCI (Commodity Channel Index)
* MFI (Money Flow Index)
* AO (Awesome Oscillator)
* CMF (Chaikin Money Flow) - Newly added
* VWMACD (Volume-Weighted MACD) - Newly added
2. Customizable Divergence Parameters:
* Bullish/Bearish: Enable or disable the detection of bullish and bearish divergences independently.
* Regular/Hidden: Detect both regular and hidden divergences (hidden divergences can indicate trend continuation).
* Broken Trendline Exclusion: Optionally ignore divergences where the trendline connecting price pivots is broken by an intermediate pivot.
* Pivot Lookback Periods: Adjust the number of bars used to identify valid pivot highs and lows for divergence calculations.
* Weighting: Assign different weights to regular vs. hidden divergences and to the relative change in price vs. the indicator.
3. Indicator-Specific Settings:
* Weight: Each indicator can be assigned a weight, influencing its contribution to the overall divergence strength calculation.
* Extreme Value: Define a threshold above which an indicator's divergence is considered "extreme," giving it a higher strength rating.
4. Divergence Strength Calculation:
* For each indicator, the script calculates a divergence "degree" based on the magnitude of the divergence and the user-defined weightings.
* The total divergence strength is the sum of the individual indicator divergence degrees.
* Strength is categorized as "Extreme," "Very strong," "Strong," "Moderate," "Weak," or "Very weak."
5. Visualization:
* Divergence Lines: The script draws lines on the chart connecting the price and indicator pivots that form a divergence (optional, with customizable transparency).
* Labels: Labels display the total divergence strength and a breakdown of each indicator's contribution. The size and visibility of labels are based on the strength.
6. Alerts:
* The script can generate alerts when the total divergence strength exceeds a user-defined threshold.
New Indicators (CMF and VWMACD):
* Chaikin Money Flow (CMF):
* Purpose: Measures the buying and selling pressure by analyzing the relationship between price, volume, and the accumulation/distribution line.
* Divergence: A bullish CMF divergence occurs when the price makes a lower low, but the CMF makes a higher low (suggesting increasing buying pressure). A bearish divergence is the opposite.
* Volume-Weighted MACD (VWMACD):
* Purpose: Similar to the standard MACD but uses volume-weighted moving averages instead of simple moving averages, giving more weight to periods with higher volume.
* Divergence: Divergences are interpreted similarly to the standard MACD, but the VWMACD can be more sensitive to volume changes.
How It Works (Simplified):
1. Pivot Detection: The script identifies pivot highs and lows in both price and the selected indicators using the specified lookback periods.
2. Divergence Check: For each indicator:
* It checks if a series of pivots in price and the indicator are diverging (e.g., price makes a lower low, but the indicator makes a higher low for a bullish divergence).
* It calculates the divergence degree based on the difference in price and indicator values, weightings, and whether it's a regular or hidden divergence.
3. Strength Aggregation: The script sums up the divergence degrees of all enabled indicators to get the total divergence strength.
4. Visualization and Alerts: It draws lines and labels on the chart to visualize the divergences and generates alerts if the total strength exceeds the set threshold.
Benefits:
* Comprehensive Divergence Analysis: By considering multiple indicators, the script provides a more robust assessment of potential trend reversals.
* Customization: The many adjustable parameters allow traders to fine-tune the script to their specific trading style and preferences.
* Objective Strength Evaluation: The divergence strength calculation and categorization offer a more objective way to evaluate the significance of divergences.
* Early Warning System: Divergences can often precede significant price movements, making this script a valuable tool for anticipating potential trend changes.
* Volume Confirmation: The inclusion of CMF and VWMACD add volume-based confirmation to the divergence signals, potentially increasing their reliability.
Limitations:
* Lagging Indicators: Most of the indicators used are lagging, meaning they are based on past price data. Divergences may sometimes occur after a significant price move has already begun.
* False Signals: No indicator is perfect, and divergences can sometimes produce false signals, especially in choppy or ranging markets.
* Subjectivity: While the script aims for objectivity, some settings (like weightings and extreme values) still involve a degree of subjective judgment.
Hilega-Milega-RSI-EMA-WMA indicator designed by NKThis indicator is works on RSI, Price and volume to give leading Indicator to Buy or Sell.
This indicator works on all financial markets
Hilega-Milega-RSI-EMA-WMA indicator designed by Nitish Sir
For intraday trade, enter with 15 mins chart.
For positional trade, enter with 1-hour chart.
For Investment this system can be used with daily/weekly/monthly chart.
• RED line is for Volume.
• Green line is for the Price.
• Black line is for the RSI (9).
SELL Trade
1. When Volume (RED line) is above/crossed above Price (Green line) and Strength (Black line), then stock price will go down. This means we will SELL.
2. When there is a GAP in the RED line and the Green line till the time price will go down.
Exit criteria
Whenever Red line exit the shaded area of Oversold zone OR Red line cross over the Green and black line then we will exit.
In case of the SELL trade, after the entry we will monitor the trade in 5 min chart, if the candle is closed above the VWAP then exit.
If the price is crossed the 50 SMA then we will exit trade.
BUY Trade
1. When Volume (RED line) is below/crossed below Price (Green line) and Strength (Black line), then stock price will go up. This means we will BUY.
2. When there is a GAP in the RED line and the Green line till the time price will go down.
Exit criteria
Whenever Red line exit the shaded area of Overbought zone OR Red line cross over the Green and black line then we will exit.
In case of the Buy trade, after the entry we will monitor the trade candle is closed below the VWAP then exit.
If the price is crossed the 50 SMA then we will exit trade.
Max/Min LevelsHighlights highs and lows that match the search criteria. A high is considered to be broken if the candlestick breaks through its shadow
A three-candlestick pattern will match the parameters:
Candle before - 1
Candle after - 1
A five-candlestick pattern will match the parameters:
Candle before - 2
Candle after - 2
CVD OscillatorCVD Delta Oscillator
A momentum oscillator that measures buying and selling pressure through volume analysis, based on the principle that volume precedes price (cause and effect).
How It Works
Volume Analysis
Measures the force of buying and selling by analyzing how volume interacts with price movement within each bar
When price closes higher in a bar's range with strong volume, this indicates stronger buying pressure
When price closes lower in a bar's range with strong volume, this indicates stronger selling pressure
Momentum Measurement
Uses two EMAs (fast and slow) to smooth the volume delta
The difference between these EMAs creates an oscillator that shows:
Rising values = Buying pressure increasing
Falling values = Selling pressure increasing
Zero line crossovers = Potential shift in control between buyers and sellers
Signal Generation
Divergences
Bullish: Price falls to new lows while buying pressure increases (potential reversal up)
Bearish: Price rises to new highs while selling pressure increases (potential reversal down)
Zero-Line Crossovers
Bullish: Buying pressure overtakes selling pressure
Bearish: Selling pressure overtakes buying pressure
Practical Application
Reading the Indicator
Green columns above zero = Net buying pressure
Red columns below zero = Net selling pressure
Larger columns = Stronger pressure
Divergences and crossovers = Potential turning points
Trading Context
Helps identify when price movement has strong or weak volume support
Shows potential exhaustion points through divergences
Confirms trend changes through zero-line crossovers
Customization
Adjustable EMA periods for different trading styles
Toggle-able visual signals
Automatic alerts for all signals
WVAD (Optimized Log Scaled)The WVAD (Optimized Log Scaled) indicator is a refined version of the classic Williams' Volume Accumulation/Distribution (WVAD). This version introduces logarithmic scaling for better visualization and usability, especially when dealing with large value ranges. It also includes EMA smoothing to highlight trends and reduce noise, providing traders with a more precise and clear representation of market dynamics.
Key Features:
1.Logarithmic Scaling:
Applies a log-based transformation to the WVAD values, ensuring extreme values are compressed while maintaining the overall structure of the data.
The log scaling allows better readability and interpretation, particularly for volatile or high-volume markets.
2.EMA Smoothing:
Uses an exponential moving average (EMA) to smooth the logarithmic WVAD values.
Helps reduce noise while preserving short-term trends, making it suitable for both trend-following and reversal strategies.
3.Customizable Parameters:
N (Lookback Period): Defines the accumulation period for calculating WVAD.
EMA Smoothing Period: Controls the sensitivity of the EMA applied to the logarithmic WVAD.
Decimal Places: Adjusts the precision of the displayed values for clearer visualization.
Line Colors: Fully customizable colors for both the raw WVAD line and the smoothed EMA.
4.Directional Preservation:
Keeps the positive and negative signs of WVAD to reflect accumulation (buying pressure) or distribution (selling pressure) in the market.
5.Zero Line Reference:
A horizontal zero line is plotted to help traders easily identify bullish (above 0) or bearish (below 0) market conditions.
How to Use:
Identify Trends: The smoothed WVAD line (EMA) can help detect trends or shifts in buying/selling pressure.
Crossovers: Use crossovers of the WVAD with the zero line as potential buy or sell signals.
Divergence: Spot divergences between price and the WVAD for early indications of reversals.
Applications:
Suitable for intraday, swing, or longer-term trading strategies.
Works across various asset classes, including stocks, commodities, and cryptocurrencies.
Support, Resistance, MA, and ADXSummary
This comprehensive script provides traders with a tool that highlights critical levels of support and resistance, detects significant price breakouts with volume confirmation, identifies potential reversals with wick analysis, and plots a moving average that changes color based on trend strength as indicated by the ADX. It is useful for spotting entry and exit points, confirming breakouts, and identifying trend direction and strength.
Fractal Trail [UAlgo]The Fractal Trail is designed to identify and utilize Williams fractals as dynamic trailing stops. This tool serves traders by marking key fractal points on the chart and leveraging them to create adaptive stop-loss trails, enhancing risk management and trade decision-making.
Williams fractals are pivotal in identifying potential reversals and critical support/resistance levels. By plotting fractals dynamically and providing configurable options, this indicator allows for personalized adjustments based on the trader's strategy.
This script integrates both visual fractal markers and adjustable trailing stops, offering insights into market trends while catering to a wide variety of trading styles and timeframes.
🔶 Key Features
Williams Fractals Identification: The indicator marks Williams Fractals on the chart, which are significant highs and lows within a specified range. These fractals are crucial for identifying potential reversal points in the market.
Dynamic Trailing Stops: The indicator generates dynamic trailing stops based on the identified fractals. These stops adjust automatically as new fractals are formed, providing a responsive and adaptive approach to risk management.
Fractal Range: Users can specify the number of bars to the left and right for analyzing fractals, allowing for flexibility in identifying significant price points.
Trail Buffer Percentage: A percentage-based safety margin can be added between the fractal price and the trailing stop, providing additional control over risk management.
Trail Invalidation Source: Users can choose whether the trailing stop flips based on candle closing prices or the extreme points (high/low) of the candles.
Alerts and Notifications: The indicator provides alerts for when the price crosses the trailing stops, as well as when new Williams Fractals are confirmed. These alerts can be customized to fit the trader's notification preferences.
🔶 Interpreting the Indicator
Fractal Markers: The triangles above and below the bars indicate Williams Fractals. These markers help traders identify potential reversal points in the market.
Trailing Stops: The dynamic trailing stops are plotted as lines on the chart. These lines adjust based on the latest identified fractals, providing a visual representation of potential support and resistance levels.
Fill Colors: The optional fill colors between the trailing stops and the price action help traders quickly identify the current trend and potential pullback zones.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Awesome_Accelerator_Zone OscillatorExplanation and Usage Guide for AO_AC_ZONE Oscillator
Indicator Overview
The **AO_AC_ZONE** oscillator is based on the concepts introduced by **Bill Williams** in his book *New Trading Dimensions*. This indicator combines the **Awesome Oscillator (AO)**, **Accelerator Oscillator (AC)**, and a custom **Zone Oscillator**, visualizing them together in a clear, color-coded format.
The Zone Oscillator is derived from the relationship between AO and AC, indicating the market's dominant momentum state (bullish, bearish, or neutral). It also integrates real-time candle coloring to visually align price bars with the Zone's momentum.
---
**Components**
1. **Awesome Oscillator (AO)**:
- AO measures the difference between a 5-period and 34-period Simple Moving Average (SMA) applied to the midpoints of candles.
- It reflects market momentum, where:
- Green bars = increasing momentum
- Red bars = decreasing momentum
2. **Accelerator Oscillator (AC)**:
- AC is calculated as the difference between AO and its 5-period SMA.
- It indicates the acceleration or deceleration of market momentum.
- Fuchsia bars = increasing momentum
- Purple bars = decreasing momentum
3. **Zone Oscillator**:
- The Zone combines AO and AC states:
- **Green Zone**: Both AO and AC are positive (bullish momentum).
- **Red Zone**: Both AO and AC are negative (bearish momentum).
- **Gray Zone**: AO and AC have differing signs (neutral/uncertain momentum).
- Candle colors dynamically match the Zone’s state for enhanced visual clarity.
---
**How to Use the Indicator**
**1. Interpreting the Oscillators**
- **AO**: Use it to detect momentum direction and changes. Pay attention to shifts in bar color:
- **Increasing AO (Aqua)**: Bullish momentum gaining strength.
- **Decreasing AO (Navy)**: Bullish momentum weakening or bearish momentum strengthening.
- **AC**: Provides early signals of momentum shifts.
- If AC changes color ahead of AO, it signals potential trend reversals or accelerations.
**2. Using the Zone Oscillator**
- **Green Zone**:
- Both AO and AC are positive.
- Indicates a strong bullish trend. Look for buying opportunities in line with the trend.
- **Red Zone**:
- Both AO and AC are negative.
- Signals strong bearish momentum. Look for shorting opportunities.
- **Gray Zone**:
- AO and AC are in conflict.
- Represents uncertainty; avoid trading or wait for a clear signal.
---
**Real-Time Application**
**Candle Coloring**
- The indicator modifies candle colors to match the Zone Oscillator's state:
- **Green Candles**: Strong bullish momentum.
- **Red Candles**: Strong bearish momentum.
- **Gray Candles**: Neutral momentum.
**Recommended Strategy (Based on New Trading Dimensions)**:
1. **Identify the Zone**:
- Focus on Green Zones for long entries and Red Zones for short entries.
2. **Look for AO/AC Confirmation**:
- Enter trades in the direction of both AO and AC when they align with the Zone.
- For exits, monitor when AO and AC conflict (Gray Zone).
3. **Use in Combination**:
- Combine this oscillator with fractals or trend indicators to confirm signals.
---
**Benefits**
- Visualizes momentum strength, acceleration, and alignment in one chart.
- Simplifies decision-making by integrating price action with oscillator dynamics.
- Supports faster trade identification and execution by highlighting bullish, bearish, and neutral zones.
---
**Disclaimer**
This indicator is a tool to assist in market analysis. Always incorporate proper risk management and avoid trading during uncertain conditions (Gray Zones). For optimal results, use this oscillator in conjunction with other analysis methods like support/resistance, volume analysis, and trend-following systems.
EMA with Supply and Demand Zones
The EMA with Supply and Demand Strategy is a trend-following trading approach that integrates Exponential Moving Averages (EMA) with supply and demand zones to identify potential entry and exit points. Below is a detailed description of its components and logic:
Key Components of the Strategy
1. EMA (Exponential Moving Average)
The EMA is used as a trend filter:
Bullish Trend: Price is above the EMA.
Bearish Trend: Price is below the EMA.
The EMA ensures that trades align with the overall market trend, reducing counter-trend risks.
2. Supply and Demand Zones
Demand Zone:
Represents areas where the price historically found support (buyers dominated).
Calculated using the lowest low over a specified lookback period.
Used for identifying potential long entry points.
Supply Zone:
Represents areas where the price historically faced resistance (sellers dominated).
Calculated using the highest high over a specified lookback period.
Used for identifying potential short entry points.
3. Trade Conditions
Long Trade:
Triggered when:
The price is above the EMA (bullish trend).
The low of the current candle touches or penetrates the most recent demand zone.
Short Trade:
Triggered when:
The price is below the EMA (bearish trend).
The high of the current candle touches or penetrates the most recent supply zone.
4. Exit Conditions
Long Exit:
Exit the trade when the price closes below the EMA, indicating a potential trend reversal.
Short Exit:
Exit the trade when the price closes above the EMA, signaling a potential upward reversal.
Visual Representation
EMA: A blue line plotted on the chart to show the trend.
Supply Zones: Red horizontal lines representing potential resistance levels.
Demand Zones: Green horizontal lines representing potential support levels.
These zones dynamically adjust to reflect the most recent 3 levels.
How the Strategy Works
Trend Identification:
The EMA determines the direction of the trade:
Look for long trades only in a bullish trend (price above EMA).
Look for short trades only in a bearish trend (price below EMA).
Entry Points:
Wait for price interaction with a supply or demand zone:
If the price touches a demand zone during a bullish trend, initiate a long trade.
If the price touches a supply zone during a bearish trend, initiate a short trade.
Risk Management:
The strategy exits trades if the price moves against the trend (crosses the EMA).
This ensures minimal exposure during adverse market movements.
Benefits of the Strategy
Trend Alignment:
Reduces counter-trend trades, improving the win rate.
Clear Entry and Exit Rules:
Combines price action (zones) with a reliable trend filter (EMA).
Dynamic Levels:
The supply and demand zones adapt to changing market conditions.
Customization Options
EMA Length:
Adjust to suit different timeframes or market conditions (e.g., 20 for faster trends, 50 for slower trends).
Lookback Period:
Fine-tune to capture broader or narrower supply and demand zones.
Risk/Reward Preferences:
Pair the strategy with stop-loss and take-profit levels for enhanced control.
This strategy is ideal for traders looking for a structured approach to identify high-probability trades while aligning with the prevailing trend. Backtest and optimize parameters based on your trading style and the specific asset you're tradin
Z-ScoreThe z-score (also known as the standard score) measures how many standard deviations a data point is from the mean of a dataset. It helps determine whether a data point is typical or unusual compared to the dataset.
The formula for the z-score is:
z = \frac{x - \mu}{\sigma}
Where:
• x = the value being evaluated
• \mu = the mean of the dataset
• \sigma = the standard deviation of the dataset
Interpretation:
• A positive z-score indicates the data point is above the mean.
• A negative z-score indicates the data point is below the mean.
• A z-score of 0 means the data point is exactly at the mean.
2 bars BarsInputs:
The script allows you to specify the values for each state (HH, HL, LL, LH) for two bars.
Labels as Bars:
Instead of line.new, this script uses label.new to simulate a pseudo-bar chart.
Bars are visually represented as labels, with distinct positions and colors.
Offset Logic:
The offset ensures that each category has its labels (bars) placed at the correct horizontal distance.
Custom Categories:
The categories array ("HH", "HL", "LL", "LH") links to their respective values.
Dynamic TestingInput Parameters
`lookbackPeriod` : Number of candles to check for determining the highest high (resistance) and lowest low (support) levels.
`atrPeriod` : The period for calculating the Average True Range (ATR), a measure of market volatility.
`atrMultiplierSL` : Multiplier to calculate the stop-loss distance relative to the ATR.
`atrMultiplierTP1` and `atrMultiplierTP2` : Multipliers to calculate two take-profit levels relative to ATR.
`rewardToRisk` : The ratio between reward (profit) and risk (stop loss) for trade management.
---
Core Calculations
ATR (Average True Range)
atr = ta.atr(atrPeriod)
ATR is computed using the specified period to gauge price volatility.
Volume SMA
volumeSMA = ta.sma(volume, atrPeriod)
The script calculates the simple moving average of volume over the same period as ATR. This is used as a threshold for validating high-volume scenarios.
---
Support and Resistance Levels
`support` : Lowest price over the last `lookbackPeriod` candles.
`resistance` : Highest price over the same period.
`supportBuffer` and `resistanceBuffer` : These are "buffered" zones around support and resistance, calculated using half of the ATR to prevent false breakouts.
---
Entry Scenarios
Bullish Entry (`isBullishEntry`)
The close is above the buffered support level.
The low of the current candle touches or breaks below the support level.
The trading volume is greater than the `volumeSMA`.
Bearish Entry (`isBearishEntry`)
The close is below the buffered resistance level.
The high of the current candle touches or exceeds the resistance level.
The trading volume is greater than the `volumeSMA`.
---
Box Visualization
Bullish and Bearish Boxes
Bullish Box (`bullishBox`):
- A green, semi-transparent rectangle around the support level to highlight the bullish entry zone.
- Dynamically updates based on recent price action.
Bearish Box (`bearishBox`):
- A red, semi-transparent rectangle around the resistance level to highlight the bearish entry zone.
- Adjusts similarly as price evolves.
---
Stop Loss and Take Profit Calculations
Bullish Trades
Stop Loss (`bullishSL`): Calculated as support - atrMultiplierSL * ATR .
Take Profit 1 (`bullishTP1`): support + rewardToRisk * atrMultiplierTP1 * ATR .
Take Profit 2 (`bullishTP2`): support + rewardToRisk * atrMultiplierTP2 * ATR .
Bearish Trades
Stop Loss (`bearishSL`): resistance + atrMultiplierSL * ATR .
Take Profit 1 (`bearishTP1`): resistance - rewardToRisk * atrMultiplierTP1 * ATR .
Take Profit 2 (`bearishTP2`): resistance - rewardToRisk * atrMultiplierTP2 * ATR .
---
Visualization for Key Levels
Bullish Scenario
Green lines represent `bullishTP1` and `bullishTP2` for profit targets.
A red line indicates the `bullishSL` .
Labels like "TP1," "TP2," and "SL" dynamically appear at respective levels to make the targets and risk visually clear.
Bearish Scenario
Red lines represent `bearishTP1` and `bearishTP2` .
A green line marks the `bearishSL` .
Similar dynamic labeling for `TP1` , `TP2` , and `SL` at corresponding bearish levels.
---
Dynamic Updates
Both the entry boxes and key level visualizations (lines and labels) adjust dynamically based on real-time price and volume data.
---
Purpose
Identify high-probability bullish and bearish trade setups.
Define clear entry zones (using boxes) and exit levels (TP1, TP2, SL).
Incorporate volatility (via ATR) and volume into decision-making.
---
Technical Summary
Dynamically visualize support/resistance levels.
Set risk-managed trades using ATR-based stop-loss and profit levels.
Automate visual trade zones for enhanced chart clarity.
---
Awesome Oscillator with DivergenceSimple Awesome Oscillator with Divergences
This TradingView script combines the classic Awesome Oscillator (AO) with divergence detection. It plots AO as a histogram, highlighting changes in momentum. Divergences are identified based on pivot highs and lows, signaling potential trend reversals:
- Bullish Divergence: Price makes lower lows, AO makes higher lows.
- Bearish Divergence: Price makes higher highs, AO makes lower highs.
Visual signals (arrows) and alerts ensure clear identification, making it ideal for traders focusing on momentum and trend reversals.
Williams Fractals for ExtremesThis script, written in Pine Script (version 5), implements an indicator for the automatic detection and visualization of fractal extremes on the price chart. The core algorithm is based on Bill Williams' fractal theory and identifies local highs and lows, which are often used to determine potential reversal points and support/resistance levels in the market.
### Key Features:
#### Fractal Detection:
- The indicator identifies a fractal high if the middle candle in a sequence of five candles (two on the left and two on the right) has the highest value.
- A fractal low is identified if the middle candle in the same type of five-candle sequence has the lowest value.
#### Extreme Visualization:
- Fractal highs are displayed as red dots on the chart, signaling potential local peaks.
- Fractal lows are shown as green dots, indicating local troughs.
### Usage:
- The indicator is designed for use across all timeframes and can be applied to both cryptocurrency and traditional financial markets.
- Highlighted points allow traders to quickly spot key levels, aiding in identifying potential zones for trade entry or exit.
### Application in Trading:
#### Identifying Key Levels:
- Fractal highs and lows can serve as resistance and support levels. A breakout beyond a fractal in either direction may signal a continuation of movement in that direction.
#### Finding Reversal Points:
- Fractal extremes indicate potential market reversals, making them useful in counter-trend trading strategies.
#### Adaptability to Market Conditions:
- The indicator updates dynamically with the appearance of new candles, providing traders with real-time fractal extreme levels.
### Settings and Parameters:
- In its current version, the script does not include customizable settings as it implements the standard concept of Williams' fractals.
CAO BA NHAN//@version=5
indicator("Potential Buy/Sell Limit Zones", overlay=true)
// Tham số đầu vào
volume_threshold = input.float(1.5, title="Volume Spike Threshold", step=0.1)
support_resistance_length = input.int(20, title="Support/Resistance Lookback Length")
// Tính toán SMA của volume và kiểm tra volume spike
volume_sma = ta.sma(volume, support_resistance_length)
volume_spike = volume > volume_sma * volume_threshold
// Xác định hỗ trợ và kháng cự
support = ta.lowest(close, support_resistance_length)
resistance = ta.highest(close, support_resistance_length)
// Hiển thị các vùng giới hạn có khả năng
plot(volume_spike ? support : na, title="Potential Buy Limit Zone", color=color.green, linewidth=2, style=plot.style_stepline)
plot(volume_spike ? resistance : na, title="Potential Sell Limit Zone", color=color.red, linewidth=2, style=plot.style_stepline)
// Đánh dấu trên biểu đồ khi có volume spike tại các vùng hỗ trợ/kháng cự
bgcolor(volume_spike and close == support ? color.new(color.green, 80) : na, title="Buy Zone")
bgcolor(volume_spike and close == resistance ? color.new(color.red, 80) : na, title="Sell Zone")
Fractal Trend Detector [Skyrexio]Introduction
Fractal Trend Detector leverages the combination of Williams fractals and Alligator Indicator to help traders to understand with the high probability what is the current trend: bullish or bearish. It visualizes the potential uptrend with the coloring bars in green, downtrend - in red color. Indicator also contains two additional visualizations, the strong uptrend and downtrend as the green and red zones and the white line - trend invalidation level (more information in "Methodology and it's justification" paragraph)
Features
Optional strong up and downtrends visualization: with the specified parameter in settings user can add/hide the green and red zones of the strong up and downtrends.
Optional trend invalidation level visualization: with the specified parameter in settings user can add/hide the white line which shows the current trend invalidation price.
Alerts: user can set up the alert and have notifications when uptrend/downtrend has been started, strong uptrend/downtrend started.
Methodology and it's justification
In this script we apply the concept of trend given by Bill Williams in his book "Trading Chaos". This approach leverages the Alligator and Fractals in conjunction. Let's briefly explain these two components.
The Williams Alligator, created by Bill Williams, is a technical analysis tool used to identify trends and potential market reversals. It consists of three moving averages, called the jaw, teeth, and lips, which represent different time periods:
Jaw (Blue Line): The slowest line, showing a 13-period smoothed moving average shifted 8 bars forward.
Teeth (Red Line): The medium-speed line, an 8-period smoothed moving average shifted 5 bars forward.
Lips (Green Line): The fastest line, a 5-period smoothed moving average shifted 3 bars forward.
When the lines are spread apart and aligned, the "alligator" is "awake," indicating a strong trend. When the lines intertwine, the "alligator" is "sleeping," signaling a non-trending or range-bound market. This indicator helps traders identify when to enter or avoid trades.
Williams Fractals, introduced by Bill Williams, are a technical analysis tool used to identify potential reversal points on a price chart. A fractal is a series of at least five consecutive bars where the middle bar has the highest high (for a up fractal) or the lowest low (for a down fractal), compared to the two bars on either side.
Key Points:
Up fractal: Formed when the middle bar shows a higher high than the two preceding and two following bars, signaling a potential turning point downward.
Down fractal: Formed when the middle bar has a lower low than the two surrounding bars, indicating a potential upward reversal.
Fractals are often used with other indicators to confirm trend direction or reversal, helping traders make more informed trading decisions.
How we can use its combination? Let's explain the uptrend example. The up fractal breakout to the upside can be interpret as bullish sign, there is a high probability that uptrend has just been started. It can be explained as following: the up fractal created is the potential change in market's behavior. A lot of traders made a decision to sell and it created the pullback with the fractal at the top. But if price is able to reach the fractal's top and break it, this is a high probability sign that market "changed his opinion" and bullish trend has been started. The moment of breaking is the potential changing to the uptrend. Here is another one important point, this breakout shall happen above the Alligator's teeth line. If not, this crossover doesn't count and the downtrend potentially remaining. The inverted logic is true for the down fractals and downtrend.
According to this methodology we received the high probability up and downtrend changes, but we can even add it. If current trend established by the indicator as the uptrend and alligator's lines have the following order: lips is higher than teeth, teeth is higher than jaw, script count it as a strong uptrend and start print the green zone - zone between lips and jaw. It can be used as a high probability support of the current bull market. The inverted logic can be used for bearish trend and red zones: if lips is lower than teeth and teeth is lower than jaw it's interpreted by the indicator as a strong down trend.
Indicator also has the trend invalidation line (white line). If current bar is green and market condition is interpreted by the script as an uptrend you will see the invalidation line below current price. This is the price level which shall be crossed by the price to change up trend to down trend according to algorithm. This level is recalculated on every candle. The inverted logic is valid for downtrend.
How to use indicator
Apply it to desired chart and time frame. It works on every time frame.
Setup the settings with enabling/disabling visualization of strong up/downtrend zones and trend invalidation line. "Show Strong Bullish/Bearish Trends" and "Show Trend Invalidation Price" checkboxes in the settings. By default they are turned on.
Analyze the price action. Indicator colored candle in green if it's more likely that current state is uptrend, in red if downtrend has the high probability to be now. Green zones between two lines showing if current uptrend is likely to be strong. This zone can be used as a high probability support on the uptrend. The red zone show high probability of strong downtrend and can be used as a resistance. White line is showing the level where uptrend or downtrend is going be invalidated according to indicator's algorithm. If current bar is green invalidation line will be below the current price, if red - above the current price.
Set up the alerts if it's needed. Indicator has four custom alerts called "Uptrend has been started" when current bar closed as green and the previous was not green, "Downtrend has been started" when current bar closed red and the previous was not red, "Uptrend became strong" if script started printing the green zone "Downtrend became strong" if script started printing the red zone.
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test indicators before live implementation.
Trend Trader-RemasteredThe script was originally coded in 2018 with Pine Script version 3, and it was in invite only status. It has been updated and optimised for Pine Script v5 and made completely open source.
Overview
The Trend Trader-Remastered is a refined and highly sophisticated implementation of the Parabolic SAR designed to create strategic buy and sell entry signals, alongside precision take profit and re-entry signals based on marked Bill Williams (BW) fractals. Built with a deep emphasis on clarity and accuracy, this indicator ensures that only relevant and meaningful signals are generated, eliminating any unnecessary entries or exits.
Key Features
1) Parabolic SAR-Based Entry Signals:
This indicator leverages an advanced implementation of the Parabolic SAR to create clear buy and sell position entry signals.
The Parabolic SAR detects potential trend shifts, helping traders make timely entries in trending markets.
These entries are strategically aligned to maximise trend-following opportunities and minimise whipsaw trades, providing an effective approach for trend traders.
2) Take Profit and Re-Entry Signals with BW Fractals:
The indicator goes beyond simple entry and exit signals by integrating BW Fractal-based take profit and re-entry signals.
Relevant Signal Generation: The indicator maintains strict criteria for signal relevance, ensuring that a re-entry signal is only generated if there has been a preceding take profit signal in the respective position. This prevents any misleading or premature re-entry signals.
Progressive Take Profit Signals: The script generates multiple take profit signals sequentially in alignment with prior take profit levels. For instance, in a buy position initiated at a price of 100, the first take profit might occur at 110. Any subsequent take profit signals will then occur at prices greater than 110, ensuring they are "in favour" of the original position's trajectory and previous take profits.
3) Consistent Trend-Following Structure:
This design allows the Trend Trader-Remastered to continue signaling take profit opportunities as the trend advances. The indicator only generates take profit signals in alignment with previous ones, supporting a systematic and profit-maximising strategy.
This structure helps traders maintain positions effectively, securing incremental profits as the trend progresses.
4) Customisability and Usability:
Adjustable Parameters: Users can configure key settings, including sensitivity to the Parabolic SAR and fractal identification. This allows flexibility to fine-tune the indicator according to different market conditions or trading styles.
User-Friendly Alerts: The indicator provides clear visual signals on the chart, along with optional alerts to notify traders of new buy, sell, take profit, or re-entry opportunities in real-time.
Bullish/Bearish Reversal Bars Indicator [Skyrexio]Introduction
Bullish/Bearish Reversal Bars Indicator leverages the combination of candlestick reversal bar pattern and the Williams Alligator indicator to help traders in understanding where there is a high probability of market reversal or correction. Indicator works for both bearish and bullish cases. It visualizes the bearish and bullish reversal bars with red and green dots and also plots the Alligator's lips to make it more convenient for traders to understand if price is above or below lips line (more information in "Methodology and it's justification" paragraph).
Features
Market Facilitation Index(MFI) filter: with the specified parameter in settings user can choose to filter bullish and bearish reversal bars which passed the MFI condition.
Awesome Oscillator(AO) filter: with the specified parameter in settings user can choose to filter bullish and bearish reversal bars which passed the AO condition.
Alerts: user can set up the alert and have notifications when bullish/bearish reversal bar has been printed.
Methodology and it's justification
In the script’s methodology, we apply the concepts of bullish and bearish reversal bars introduced by Bill Williams in his book Trading Chaos. So, what exactly is a bullish or bearish reversal bar? At its core, it’s a candlestick pattern. A bullish reversal bar is a bar that closes in its upper half, while a bearish reversal bar closes in its lower half.
Why is this type of bar significant? Let’s look at the bullish reversal bar as an example. When the price is trending upward, forming higher highs with each candle, and we suddenly see a bullish bar that makes a new high but ultimately closes in its lower half, it signals a shift in control. Bears have taken control toward the end of that candle's period, pushing the price back down. This can be interpreted as a sign of trend weakness and a potential reversal (or at least a correction).
An additional key point is that a reversal bar often indicates a possible end to the trend. Therefore, for a reversal bar to be valid, several preceding candles should show lower highs (for bullish bars) or higher lows (for bearish bars), reinforcing the likelihood of a trend change.
The second step on methodology is the location of the bar related to Williams Alligator. The Williams Alligator Indicator, developed by Bill Williams, is a technical analysis tool that helps traders identify trends and potential turning points in the market. It consists of three lines, often called the jaw, teeth, and lips of the alligator, each representing different moving averages:
Jaw (Blue Line): A slower moving average, typically a 13-period smoothed moving average shifted 8 bars into the future.
Teeth (Red Line): A medium moving average, typically an 8-period smoothed moving average shifted 5 bars into the future.
Lips (Green Line): A faster moving average, usually a 5-period smoothed moving average shifted 3 bars into the future.
When the three lines are spread out and moving in the same direction, it suggests a strong trend (the "alligator" is "awake and feeding"). When they intertwine, the indicator suggests that the market is moving sideways, or in a range, signaling a lack of clear trend (the "alligator" is "sleeping"). Traders use the Alligator Indicator to enter trades in trending markets and avoid trades in choppy, non-trending markets.
If bullish reversal bar's high is not below and bearish reversal bar's low is not above all three Alligator's lines (jaw, lips, teeth) they cannot be interpreted as these types of bars. It can be explained as following: if we are waiting for the bullish reversal bar it shall be reversal from downtrend. If price is not below all three lines it can't be interpret as the downtrend according to this method. The opposite is true for the bearish reversal bar.
All described above are obligatory conditions for reversal bar, now let's discuss two not obligatory conditions. The first one is Market Facilitation Index (MFI) restriction. Let's briefly look what is MFI. The Market Facilitation Index (MFI) is a technical indicator that measures the price movement per unit of volume, helping traders gauge the efficiency of price movement in relation to trading volume. Here's how you can calculate it:
MFI = (High−Low)/Volume
MFI can be used in combination with volume, so we can divide 4 states. Bill Williams introduced these to help traders interpret the interaction between volume and price movement. Here’s a quick summary:
Green Window (Increased MFI & Increased Volume): Indicates strong momentum with both price and volume increasing. Often a sign of trend continuation, as both buying and selling interest are rising.
Fake Window (Increased MFI & Decreased Volume): Shows that price is moving but with lower volume, suggesting weak support for the trend. This can signal a potential end of the current trend.
Squat Window (Decreased MFI & Increased Volume): Shows high volume but little price movement, indicating a tug-of-war between buyers and sellers. This often precedes a breakout as the pressure builds.
Fade Window (Decreased MFI & Decreased Volume): Indicates a lack of interest from both buyers and sellers, leading to lower momentum. This typically happens in range-bound markets and may signal consolidation before a new move.
For our purposes we are interested in squat bars. This is the sign that volume cannot move the price easily. This type of bar increases the probability of trend reversal. In this indicator we added to enable the MFI filter of reversal bars. If potential reversal bar or two preceding bars have squat state this bar can be interpret as a reversal one.
The second additional filter is Awesome Oscillator. The Awesome Oscillator (AO), developed by Bill Williams, is a momentum indicator that measures market momentum by comparing recent price action to a longer historical context. It helps traders identify potential trend reversals and the strength of trends. Formula:
AO = SMA5(Median Price) − SMA34(Median Price)
where:
Median Price = (High + Low) / 2
SMA5 = 5-period Simple Moving Average of the Median Price
SMA 34 = 34-period Simple Moving Average of the Median Price
If AO is decreasing momentum is bearish, if increasing - bullish. According to Bill Williams approach reversal bars are the potential trades against the trend. As a result we added second filter for bullish reversal bars AO shall be decreasing, for bearish increasing.
How to use indicator
Apply it to desired chart and time frame. It works on every time frame.
Setup the filters with the "Enable MFI" and "Enable AO" checkboxes in the settings. By default they are turned on.
Analyze the price action. Indicator plotted the white line, this is the lips of an Alligator. It will help you to understand how price is moving in comparison to lips line. Indicator will print the green dot and text "BULL" below it current bar is bullish reversal. It will print the red dot and text "BEAR" above it if current bar is interpreted by algorithm as a bearish reversal.
Set up the alerts if it's needed. Indicator has two custom alerts called "Bullish reversal bar has been printed" and "Bearish reversal bar has been printed"
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test indicators before live implementation.
HBK Price Action Strategy HBKPrice Action Strategy for XAUUSD with a Favorable Risk-Reward Ratio
Understanding the Strategy:
This strategy leverages price action principles to identify potential entry and exit points for XAUUSD on a 5-minute timeframe. The core idea is to identify price action patterns that suggest a high probability of a particular direction, and then to set stop-loss and take-profit levels to manage risk and reward.
Key Price Action Patterns to Watch:
Pin Bar: A pin bar is a candlestick with a long wick in one direction and a small body in the opposite direction. It often signals a reversal in the current trend.
Inside Bar: An inside bar forms when the current candle's high is lower than the previous candle's high, and the current candle's low is higher than the previous candle's low. It often indicates indecision or a potential breakout.
Engulfing Pattern: An engulfing pattern occurs when the current candle completely engulfs the previous candle. A bullish engulfing pattern signals a potential uptrend, while a bearish engulfing pattern signals a potential downtrend.
Risk-Reward Ratio:
A favorable risk-reward ratio is crucial for long-term trading success. Aim for a minimum risk-reward ratio of 1:2, meaning you risk $1 to potentially gain $2.
Entry and Exit Signals:
Long Entry:
Identify a bullish pin bar or engulfing pattern.
Wait for a confirmation candle to close above the pin bar's high or the engulfing pattern's high.
Place a stop-loss below the recent swing low.
Set a take-profit target at a key resistance level or a multiple of the stop-loss distance.
Short Entry:
Identify a bearish pin bar or engulfing pattern.
Wait for a confirmation candle to close below the pin bar's low or the engulfing pattern's low.
Place a stop-loss above the recent swing high.
Set a take-profit target at a key support level or a multiple of the stop-loss distance.
Additional Tips:
Use Support and Resistance Levels: Identify key support and resistance levels to set your stop-loss and take-profit targets.
Consider Market Sentiment: Pay attention to market sentiment and news events that may impact gold prices.
Manage Risk: Always use stop-loss orders to limit potential losses.
Be Patient: Don't force trades. Wait for high-probability setups.
Practice Discipline: Stick to your trading plan and avoid impulsive decisions.
Remember:
Price action trading requires practice and patience.
Backtest your strategy on historical data to refine your approach.
Always adapt to changing market conditions.
By following these guidelines and practicing disciplined risk management, you can increase your chances of success in trading XAUUSD on a 5-minute timeframe.