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 Indicators
Supply and Demand - Order Block Strategy BY ALGERNON STONEBreakout Logic:
topBreakCheckSource and bottomBreakCheckSource are used to define the break-out check based on user input.
If the price crosses over the topValue (the high of the last fractal) and topBreakBlock is not set, then a long entry is generated after creating a demandBox, based on the last red candle's low and high.
If the price crosses under the bottomValue and bottomBreakBlock is not set, then a short entry is generated after creating a supplyBox, based on the last green candle's low and high.
If a long or short is active, and a breakout of the price happens, the script will draw a new line object to indicate the breakout, where x2 of the line is set to the current bar index
Fractal Detection:
If a new up fractal is detected, the topValue and topLine variables are updated, and the old line object is deleted
If a new down fractal is detected, the bottomValue and bottomLine variables are updated, and the old line object is deleted
Box Color Update:
The script loops through all the active boxes and changes their color if the current candle close price is outside the range of the box.
Plots: Plots the up and down fractals for visualization.
Checklist Table: A table displays the status of different conditions of the script on the bottom right.
Shows status of Up Fractal, Down Fractal, Top Break, Bottom Break, Last Red Candle, Last Green Candle, Box Color Change Active using check and cross mark symbols.
How the Strategy Works:
Fractal Identification: The strategy continuously looks for fractal highs and lows.
Order Block Identification: When a new fractal is formed, the script stores the high and low of the last opposing candle.
Breakout Confirmation: When price breaks the range of a fractal, it indicates an order block breakout.
Trade Execution: When there is a valid breakout, it triggers a long or short trade, depending on whether a demand or supply zone is broken.
Box Visualization: The script visually represents the order blocks using boxes that are colored green for demand zones and red for supply zones. These boxes can be optionally re-colored if the price breaks beyond them.
Checklist Display: A checklist table at the bottom right of the chart helps the user to quickly understand the script status.
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.
cá nhân//@version=5
strategy("Demo GPT - Supertrend", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, slippage=3)
// Inputs
Periods = input.int(10, title="ATR Period")
src = input.source(hl2, title="Source")
Multiplier = input.float(3.0, title="ATR Multiplier", step=0.1)
changeATR = input.bool(true, title="Change ATR Calculation Method ?")
showSignals = input.bool(true, title="Show Signals ?")
highlighting = input.bool(true, title="Highlighter On/Off ?")
emaPeriod = input.int(50, title="EMA Period")
bbLength = input.int(20, title="Bollinger Bands Length")
bbMultiplier = input.float(2.0, title="Bollinger Bands Multiplier")
// ATR Calculation
atr2 = ta.sma(ta.tr, Periods)
atr = changeATR ? ta.atr(Periods) : atr2
// Supertrend Calculation
up = src - (Multiplier * atr)
up1 = nz(up , up)
up := close > up1 ? math.max(up, up1) : up
dn = src + (Multiplier * atr)
dn1 = nz(dn , dn)
dn := close < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend , trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
// Bollinger Bands Calculation
basis = ta.sma(close, bbLength)
deviation = ta.stdev(close, bbLength)
upperBand = basis + (bbMultiplier * deviation)
lowerBand = basis - (bbMultiplier * deviation)
// Plot Supertrend and Bollinger Bands
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_line, linewidth=2, color=color.green)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_line, linewidth=2, color=color.red)
plot(upperBand, title="Upper Band", color=color.blue, linewidth=1)
plot(lowerBand, title="Lower Band", color=color.blue, linewidth=1)
plot(basis, title="BB Basis", color=color.gray, linewidth=1)
// Buy and Sell Signals
buySignal = close > upperBand
sellSignal = close < lowerBand
if (buySignal and showSignals)
strategy.entry("Buy", strategy.long)
if (sellSignal and showSignals)
strategy.close("Buy")
// Highlighting
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = highlighting ? (trend == 1 ? color.new(color.green, 90) : na) : na
shortFillColor = highlighting ? (trend == -1 ? color.new(color.red, 90) : na) : na
fill(mPlot, upPlot, title="UpTrend Highlighter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highlighter", color=shortFillColor)
// Date Range Filter
startDate = input.time(timestamp("2018-01-01 00:00"), title="Start Date")
endDate = input.time(timestamp("2069-12-31 23:59"), title="End Date")
inDateRange = (time >= startDate and time <= endDate)
if not inDateRange
strategy.close_all()
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!")
My script rsa vaibhavMy script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav My script rsa vaibhav
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.
MultiLayer Acceleration/Deceleration Strategy [Skyrexio]Overview
MultiLayer Acceleration/Deceleration Strategy leverages the combination of Acceleration/Deceleration Indicator(AC), Williams Alligator, Williams Fractals and Exponential Moving Average (EMA) to obtain the high probability long setups. Moreover, strategy uses multi trades system, adding funds to long position if it considered that current trend has likely became stronger. Acceleration/Deceleration Indicator is used for creating signals, while Alligator and Fractal are used in conjunction as an approximation of short-term trend to filter them. At the same time EMA (default EMA's period = 100) is used as high probability long-term trend filter to open long trades only if it considers current price action as an uptrend. More information in "Methodology" and "Justification of Methodology" paragraphs. The strategy opens only long trades.
Unique Features
No fixed stop-loss and take profit: Instead of fixed stop-loss level strategy utilizes technical condition obtained by Fractals and Alligator to identify when current uptrend is likely to be over (more information in "Methodology" and "Justification of Methodology" paragraphs)
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Multilayer trades opening system: strategy uses only 10% of capital in every trade and open up to 5 trades at the same time if script consider current trend as strong one.
Short and long term trend trade filters: strategy uses EMA as high probability long-term trend filter and Alligator and Fractal combination as a short-term one.
Methodology
The strategy opens long trade when the following price met the conditions:
1. Price closed above EMA (by default, period = 100). Crossover is not obligatory.
2. Combination of Alligator and Williams Fractals shall consider current trend as an upward (all details in "Justification of Methodology" paragraph)
3. Acceleration/Deceleration shall create one of two types of long signals (all details in "Justification of Methodology" paragraph). Buy stop order is placed one tick above the candle's high of last created long signal.
4. If price reaches the order price, long position is opened with 10% of capital.
5. If currently we have opened position and price creates and hit the order price of another one long signal, another one long position will be added to the previous with another one 10% of capital. Strategy allows to open up to 5 long trades simultaneously.
6. If combination of Alligator and Williams Fractals shall consider current trend has been changed from up to downtrend, all long trades will be closed, no matter how many trades has been opened.
Script also has additional visuals. If second long trade has been opened simultaneously the Alligator's teeth line is plotted with the green color. Also for every trade in a row from 2 to 5 the label "Buy More" is also plotted just below the teeth line. With every next simultaneously opened trade the green color of the space between teeth and price became less transparent.
Strategy settings
In the inputs window user can setup strategy setting: EMA Length (by default = 100, period of EMA, used for long-term trend filtering EMA calculation). User can choose the optimal parameters during backtesting on certain price chart.
Justification of Methodology
Let's explore the key concepts of this strategy and understand how they work together. We'll begin with the simplest: the EMA.
The Exponential Moving Average (EMA) is a type of moving average that assigns greater weight to recent price data, making it more responsive to current market changes compared to the Simple Moving Average (SMA). This tool is widely used in technical analysis to identify trends and generate buy or sell signals. The EMA is calculated as follows:
1.Calculate the Smoothing Multiplier:
Multiplier = 2 / (n + 1), Where n is the number of periods.
2. EMA Calculation
EMA = (Current Price) × Multiplier + (Previous EMA) × (1 − Multiplier)
In this strategy, the EMA acts as a long-term trend filter. For instance, long trades are considered only when the price closes above the EMA (default: 100-period). This increases the likelihood of entering trades aligned with the prevailing trend.
Next, let’s discuss the short-term trend filter, which combines the Williams Alligator and Williams Fractals. Williams Alligator
Developed by Bill Williams, the Alligator is a technical indicator that identifies trends and potential market reversals. It consists of three smoothed moving averages:
Jaw (Blue Line): The slowest of the three, based on a 13-period smoothed moving average shifted 8 bars ahead.
Teeth (Red Line): The medium-speed line, derived from an 8-period smoothed moving average shifted 5 bars forward.
Lips (Green Line): The fastest line, calculated using a 5-period smoothed moving average shifted 3 bars forward.
When the lines diverge and align in order, the "Alligator" is "awake," signaling a strong trend. When the lines overlap or intertwine, the "Alligator" is "asleep," indicating a range-bound or sideways market. This indicator helps traders determine when to enter or avoid trades.
Fractals, another tool by Bill Williams, help identify potential reversal points on a price chart. A fractal forms over at least five consecutive bars, with the middle bar showing either:
Up Fractal: Occurs when the middle bar has a higher high than the two preceding and two following bars, suggesting a potential downward reversal.
Down Fractal: Happens when the middle bar shows a lower low than the surrounding two bars, hinting at a possible upward reversal.
Traders often use fractals alongside other indicators to confirm trends or reversals, enhancing decision-making accuracy.
How do these tools work together in this strategy? Let’s consider an example of an uptrend.
When the price breaks above an up fractal, it signals a potential bullish trend. This occurs because the up fractal represents a shift in market behavior, where a temporary high was formed due to selling pressure. If the price revisits this level and breaks through, it suggests the market sentiment has turned bullish.
The breakout must occur above the Alligator’s teeth line to confirm the trend. A breakout below the teeth is considered invalid, and the downtrend might still persist. Conversely, in a downtrend, the same logic applies with down fractals.
In this strategy if the most recent up fractal breakout occurs above the Alligator's teeth and follows the last down fractal breakout below the teeth, the algorithm identifies an uptrend. Long trades can be opened during this phase if a signal aligns. If the price breaks a down fractal below the teeth line during an uptrend, the strategy assumes the uptrend has ended and closes all open long trades.
By combining the EMA as a long-term trend filter with the Alligator and fractals as short-term filters, this approach increases the likelihood of opening profitable trades while staying aligned with market dynamics.
Now let's talk about Acceleration/Deceleration signals. AC indicator is calculated using the Awesome Oscillator, so let's first of all briefly explain what is Awesome Oscillator and how it can be calculated. The Awesome Oscillator (AO), developed by Bill Williams, is a momentum indicator designed to measure market momentum by contrasting recent price movements with a longer-term historical perspective. It helps traders detect potential trend reversals and assess the strength of ongoing trends.
The formula for AO is as follows:
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
The Acceleration/Deceleration (AC) Indicator, introduced by Bill Williams, measures the rate of change in market momentum. It highlights shifts in the driving force of price movements and helps traders spot early signs of trend changes. The AC Indicator is particularly useful for identifying whether the current momentum is accelerating or decelerating, which can indicate potential reversals or continuations. For AC calculation we shall use the AO calculated above is the following formula:
AC = AO − SMA5(AO), where SMA5(AO)is the 5-period Simple Moving Average of the Awesome Oscillator
When the AC is above the zero line and rising, it suggests accelerating upward momentum.
When the AC is below the zero line and falling, it indicates accelerating downward momentum.
When the AC is below zero line and rising it suggests the decelerating the downtrend momentum. When AC is above the zero line and falling, it suggests the decelerating the uptrend momentum.
Now we can explain which AC signal types are used in this strategy. The first type of long signal is when AC value is below zero line. In this cases we need to see three rising bars on the histogram in a row after the falling one. The second type of signals occurs above the zero line. There we need only two rising AC bars in a row after the falling one to create the signal. The signal bar is the last green bar in this sequence. The strategy places the buy stop order one tick above the candle's high, which corresponds to the signal bar on AC indicator.
After that we can have the following scenarios:
Price hit the order on the next candle in this case strategy opened long with this price.
Price doesn't hit the order price, the next candle set lower high. If current AC bar is increasing buy stop order changes by the script to the high of this new bar plus one tick. This procedure repeats until price finally hit buy order or current AC bar become decreasing. In the second case buy order cancelled and strategy wait for the next AC signal.
If long trades are initiated, the strategy continues utilizing subsequent signals until the total number of trades reaches a maximum of 5. All open trades are closed when the trend shifts to a downtrend, as determined by the combination of the Alligator and Fractals described earlier.
Why we use AC signals? If currently strategy algorithm considers the high probability of the short-term uptrend with the Alligator and Fractals combination pointed out above and the long-term trend is also suggested by the EMA filter as bullish. Rising AC bars after period of falling AC bars indicates the high probability of local pull back end and there is a high chance to open long trade in the direction of the most likely main uptrend. The numbers of rising bars are different for the different AC values (below or above zero line). This is needed because if AC below zero line the local downtrend is likely to be stronger and needs more rising bars to confirm that it has been changed than if AC is above zero.
Why strategy use only 10% per signal? Sometimes we can see the false signals which appears on sideways. Not risking that much script use only 10% per signal. If the first long trade has been open and price continue going up and our trend approximation by Alligator and Fractals is uptrend, strategy add another one 10% of capital to every next AC signal while number of active trades no more than 5. This capital allocation allows to take part in long trades when current uptrend is likely to be strong and use only 10% of capital when there is a high probability of sideways.
Backtest Results
Operating window: Date range of backtests is 2023.01.01 - 2024.11.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 10%
Maximum Single Position Loss: -5.15%
Maximum Single Profit: +24.57%
Net Profit: +2108.85 USDT (+21.09%)
Total Trades: 111 (36.94% win rate)
Profit Factor: 2.391
Maximum Accumulated Loss: 367.61 USDT (-2.97%)
Average Profit per Trade: 19.00 USDT (+1.78%)
Average Trade Duration: 75 hours
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 3h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
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.
MultiLayer Awesome Oscillator Saucer Strategy [Skyrexio]Overview
MultiLayer Awesome Oscillator Saucer Strategy leverages the combination of Awesome Oscillator (AO), Williams Alligator, Williams Fractals and Exponential Moving Average (EMA) to obtain the high probability long setups. Moreover, strategy uses multi trades system, adding funds to long position if it considered that current trend has likely became stronger. Awesome Oscillator is used for creating signals, while Alligator and Fractal are used in conjunction as an approximation of short-term trend to filter them. At the same time EMA (default EMA's period = 100) is used as high probability long-term trend filter to open long trades only if it considers current price action as an uptrend. More information in "Methodology" and "Justification of Methodology" paragraphs. The strategy opens only long trades.
Unique Features
No fixed stop-loss and take profit: Instead of fixed stop-loss level strategy utilizes technical condition obtained by Fractals and Alligator to identify when current uptrend is likely to be over (more information in "Methodology" and "Justification of Methodology" paragraphs)
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Multilayer trades opening system: strategy uses only 10% of capital in every trade and open up to 5 trades at the same time if script consider current trend as strong one.
Short and long term trend trade filters: strategy uses EMA as high probability long-term trend filter and Alligator and Fractal combination as a short-term one.
Methodology
The strategy opens long trade when the following price met the conditions:
1. Price closed above EMA (by default, period = 100). Crossover is not obligatory.
2. Combination of Alligator and Williams Fractals shall consider current trend as an upward (all details in "Justification of Methodology" paragraph)
3. Awesome Oscillator shall create the "Saucer" long signal (all details in "Justification of Methodology" paragraph). Buy stop order is placed one tick above the candle's high of last created "Saucer signal".
4. If price reaches the order price, long position is opened with 10% of capital.
5. If currently we have opened position and price creates and hit the order price of another one "Saucer" signal another one long position will be added to the previous with another one 10% of capital. Strategy allows to open up to 5 long trades simultaneously.
6. If combination of Alligator and Williams Fractals shall consider current trend has been changed from up to downtrend, all long trades will be closed, no matter how many trades has been opened.
Script also has additional visuals. If second long trade has been opened simultaneously the Alligator's teeth line is plotted with the green color. Also for every trade in a row from 2 to 5 the label "Buy More" is also plotted just below the teeth line. With every next simultaneously opened trade the green color of the space between teeth and price became less transparent.
Strategy settings
In the inputs window user can setup strategy setting: EMA Length (by default = 100, period of EMA, used for long-term trend filtering EMA calculation). User can choose the optimal parameters during backtesting on certain price chart.
Justification of Methodology
Let's go through all concepts used in this strategy to understand how they works together. Let's start from the easies one, the EMA. Let's briefly explain what is EMA. The Exponential Moving Average (EMA) is a type of moving average that gives more weight to recent prices, making it more responsive to current price changes compared to the Simple Moving Average (SMA). It is commonly used in technical analysis to identify trends and generate buy or sell signals. It can be calculated with the following steps:
1.Calculate the Smoothing Multiplier:
Multiplier = 2 / (n + 1), Where n is the number of periods.
2. EMA Calculation
EMA = (Current Price) × Multiplier + (Previous EMA) × (1 − Multiplier)
In this strategy uses EMA an initial long term trend filter. It allows to open long trades only if price close above EMA (by default 50 period). It increases the probability of taking long trades only in the direction of the trend.
Let's go to the next, short-term trend filter which consists of Alligator and Fractals. Let's briefly explain what do these indicators means. The Williams Alligator, developed by Bill Williams, is a technical indicator designed to spot trends and potential market reversals. It uses three smoothed moving averages, referred to as the jaw, teeth, and lips:
Jaw (Blue Line): The slowest of the three, based on a 13-period smoothed moving average shifted 8 bars ahead.
Teeth (Red Line): The medium-speed line, derived from an 8-period smoothed moving average shifted 5 bars forward.
Lips (Green Line): The fastest line, calculated using a 5-period smoothed moving average shifted 3 bars forward.
When these lines diverge and are properly aligned, the "alligator" is considered "awake," signaling a strong trend. Conversely, when the lines overlap or intertwine, the "alligator" is "asleep," indicating a range-bound or sideways market. This indicator assists traders in identifying when to act on or avoid trades.
The Williams Fractals, another tool introduced by Bill Williams, are used to pinpoint potential reversal points on a price chart. A fractal forms when there are at least five consecutive bars, with the middle bar displaying the highest high (for an up fractal) or the lowest low (for a down fractal), relative to the two bars on either side.
Key Points:
Up Fractal: Occurs when the middle bar has a higher high than the two preceding and two following bars, suggesting a potential downward reversal.
Down Fractal: Happens when the middle bar shows a lower low than the surrounding two bars, hinting at a possible upward reversal.
Traders often combine fractals with other indicators to confirm trends or reversals, improving the accuracy of trading decisions.
How we use their combination in this strategy? Let’s consider an uptrend example. A breakout above an up fractal can be interpreted as a bullish signal, indicating a high likelihood that an uptrend is beginning. Here's the reasoning: an up fractal represents a potential shift in market behavior. When the fractal forms, it reflects a pullback caused by traders selling, creating a temporary high. However, if the price manages to return to that fractal’s high and break through it, it suggests the market has "changed its mind" and a bullish trend is likely emerging.
The moment of the breakout marks the potential transition to an uptrend. It’s crucial to note that this breakout must occur above the Alligator's teeth line. If it happens below, the breakout isn’t valid, and the downtrend may still persist. The same logic applies inversely for down fractals in a downtrend scenario.
So, if last up fractal breakout was higher, than Alligator's teeth and it happened after last down fractal breakdown below teeth, algorithm considered current trend as an uptrend. During this uptrend long trades can be opened if signal was flashed. If during the uptrend price breaks down the down fractal below teeth line, strategy considered that uptrend is finished with the high probability and strategy closes all current long trades. This combination is used as a short term trend filter increasing the probability of opening profitable long trades in addition to EMA filter, described above.
Now let's talk about Awesome Oscillator's "Sauser" signals. Briefly explain what is the Awesome Oscillator. The Awesome Oscillator (AO), created by Bill Williams, is a momentum-based indicator that evaluates market momentum by comparing recent price activity to a broader historical context. It assists traders in identifying potential trend reversals and gauging trend strength.
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
Now we know what is AO, but what is the "Saucer" signal? This concept was introduced by Bill Williams, let's briefly explain it and how it's used by this strategy. Initially, this type of signal is a combination of the following AO bars: we need 3 bars in a row, the first one shall be higher than the second, the third bar also shall be higher, than second. All three bars shall be above the zero line of AO. The price bar, which corresponds to third "saucer's" bar is our signal bar. Strategy places buy stop order one tick above the price bar which corresponds to signal bar.
After that we can have the following scenarios.
Price hit the order on the next candle in this case strategy opened long with this price.
Price doesn't hit the order price, the next candle set lower low. If current AO bar is increasing buy stop order changes by the script to the high of this new bar plus one tick. This procedure repeats until price finally hit buy order or current AO bar become decreasing. In the second case buy order cancelled and strategy wait for the next "Saucer" signal.
If long trades has been opened strategy use all the next signals until number of trades doesn't exceed 5. All trades are closed when the trend changes to downtrend according to combination of Alligator and Fractals described above.
Why we use "Saucer" signals? If AO above the zero line there is a high probability that price now is in uptrend if we take into account our two trend filters. When we see the decreasing bars on AO and it's above zero it's likely can be considered as a pullback on the uptrend. When we see the stop of AO decreasing and the first increasing bar has been printed there is a high probability that this local pull back is finished and strategy open long trade in the likely direction of a main trend.
Why strategy use only 10% per signal? Sometimes we can see the false signals which appears on sideways. Not risking that much script use only 10% per signal. If the first long trade has been open and price continue going up and our trend approximation by Alligator and Fractals is uptrend, strategy add another one 10% of capital to every next saucer signal while number of active trades no more than 5. This capital allocation allows to take part in long trades when current uptrend is likely to be strong and use only 10% of capital when there is a high probability of sideways.
Backtest Results
Operating window: Date range of backtests is 2023.01.01 - 2024.11.25. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 10%
Maximum Single Position Loss: -5.10%
Maximum Single Profit: +22.80%
Net Profit: +2838.58 USDT (+28.39%)
Total Trades: 107 (42.99% win rate)
Profit Factor: 3.364
Maximum Accumulated Loss: 373.43 USDT (-2.98%)
Average Profit per Trade: 26.53 USDT (+2.40%)
Average Trade Duration: 78 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 3h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
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.