SASDv2rSensitive Altcoin Season Detector V2
This Pine Script™ code, titled "SASDv2r" (Sensitive Altcoin Season Detector version 2 revised), is designed for cryptocurrency trading analysis on the TradingView platform and tailored for those interested in tracking when altcoins might be outperforming Bitcoin, potentially indicating a market shift towards altcoins.
Feel free to use and modify. If you made it better, please let me know. Intention was to help the community with a tool for retail traders have no access to advanced, MV indicators. Solution uses classic TA only.
Use it witl TOTAL3/BTC indicator.
Please check: it gave signal just before last alt season % rose more than 250%.
Market Cap Data Fetching: The script fetches market capitalization data for Bitcoin, Ethereum, and all other altcoins (excluding Bitcoin and Ethereum) using request.security function.
Altcoin to Bitcoin Ratio: It calculates the ratio of total market cap of altcoins to Bitcoin's market cap (altToBtcRatio), which is central to identifying an "altcoin season."
Moving Averages: Several moving averages are computed for different time frames (50-day SMA, 200-day SMA, 20-day SMA, and 10-day EMA) to analyze trends in the altcoin to Bitcoin ratio.
Momentum Indicators: The script uses RSI (Relative Strength Index) and MACD (Moving Average Convergence Divergence) to gauge momentum and potential reversal points in the market.
Custom Indicators: It includes Volume Weighted Moving Average (VWMA) and a custom momentum indicator (altMomentum and altMomentumAvg) to provide additional insights into market movements.
Volatility Measurement: Bollinger Bands are calculated to assess volatility in the altcoin to Bitcoin ratio, which helps identify periods of high or low market activity.
Visual Analysis: Various plots are added to the chart for visual interpretation, including the altcoin to Bitcoin ratio, different moving averages, and Bollinger Bands.
Alt Season Detection: The script defines conditions for detecting when an "altcoin season" might be starting, based on crossovers of moving averages, RSI levels, MACD signals, and other custom criteria.
Performance Tracking: After signaling an alt season, the script evaluates the performance over the next 30 days by checking if there's been an increase in the altcoin to Bitcoin ratio, adding labels for positive or negative trends.(this one is in progress). Logic still gives false signals and aim is to identify failed signals.
Visual Signals: Labels are placed on the chart to visually indicate the beginning of a potential alt season or the performance outcome after a signal, aiding traders in making informed decisions.
Indicators and strategies
Aggregated Volume (Multi-Exchange)Indicator: Aggregated Volume (Multi-Exchange)
Overview:
The Aggregated Volume (Multi-Exchange) indicator is designed to aggregate trading volume data from multiple exchanges for a specific cryptocurrency pair. The goal is to provide a consolidated view of the total trading volume across different platforms, helping traders and analysts gauge the overall market activity for a given asset.
Features:
Multi-Exchange Support: The indicator allows you to aggregate trading volume data from various exchanges. Users can enable or disable volume data from specific exchanges (e.g., Binance, Bybit, Kucoin, etc.).
Spot and Futures Volumes: The indicator can sum the volume for spot trading and futures trading separately if desired. However, in the current version, it only sums the volume for specific pairs across multiple exchanges, without distinguishing between spot and futures volumes (though this feature can be added if necessary).
Customizable Exchange Selection: Users can select which exchanges' volume data to include in the aggregation.
Real-Time Updates: The volume data is updated in real-time as new bars are formed on the chart, providing an up-to-date picture of the trading volume.
Purpose:
The primary purpose of this indicator is to consolidate trading volume information from multiple exchanges for the same trading pair (e.g., BTC/USD). Traders can use this aggregated volume to gain a better understanding of market activity across various platforms, as well as assess the level of liquidity and interest in a particular asset.
By viewing the total aggregated volume, traders can:
Track market trends: Higher aggregated volume can signal increased market interest, making it easier to spot trends or potential breakouts.
Analyze liquidity: This indicator can help traders assess liquidity in the market, especially when using multiple exchanges.
Identify potential market manipulation: If there is a sudden spike in volume on multiple exchanges, it could signal market manipulation or an event-driven surge.
How it Works:
Volume Aggregation: The indicator collects and sums the volume data for a given symbol (e.g., BTC/USD) from different exchanges like Binance, Bybit, Kucoin, and others.
Multiple Exchanges: The volume data is aggregated from each selected exchange and plotted as a single volume value on the chart.
Real-Time Volume Plotting: The total aggregated volume is then plotted as a histogram on the chart, with the color of the bars changing depending on whether the price is rising or falling (typically green for rising prices and red for falling prices).
Inputs/Settings:
Exchange Selection: A list of checkboxes where users can choose which exchanges' volume data to include (e.g., Binance, Bybit, Kucoin, etc.).
Color Settings: Users can set the color for the histogram bars based on price direction (e.g., green for rising and red for falling).
Volume Calculation: The indicator calculates the volume for a specific cryptocurrency pair across selected exchanges in real-time.
Enhanced Volume Profile█ OVERVIEW
The Enhanced Volume Profile (EVP) is an indicator designed to plot a volume profile on the chart based on either the visible chart range or a fixed lookback period. The script helps analyze the distribution of volume at different price levels over time, providing insights into areas of high trading activity and potential support/resistance zones.
█ KEY FEATURES
1. Visible Chart Range vs. Fixed Lookback Depth
Visible Chart Range
- Default analysis mode
- Calculates profile based on visible portion of the chart
- Dynamically updates with chart view changes
Fixed Lookback Depth
- Optional alternative to visible range
- Uses specified number of bars (10-3000)
- Provides consistent analysis depth
- Independent of chart view
2. Custom Resolution
Auto-Resolution Mode
Automatically selects timeframes based on chart's current timeframe:
≤ 1 minute: Uses 1-minute resolution
≤ 5 minutes: Uses 1-minute resolution
≤ 15 minutes: Uses 5-minute resolution
≤ 1 hour: Uses 5-minute resolution
≤ 4 hours: Uses 15-minute resolution
≤ 12 hours: Uses 15-minute resolution
≤ 1 day: Uses 1-hour resolution
≤ 3 days: Uses 2-hours resolution
≤ 1 week: Uses 4-hours resolution
Custom Resolution Override
Optional override of auto-resolution system
Provides control over data granularity
Must be lower than or equal to chart's timeframe
Falls back to auto-resolution if validation fails
3. Volume Profile Resolution
Adjustable number of points (10-400)
Controls profile granularity
Higher resolution provides more detail
Balance between precision and performance
4. Point of Control (PoC)
Identifies price level with highest traded volume
Optional display with customizable appearance
Adjustable line thickness (1-30)
Configurable color
5. Value Area (VA)
Shows price range of majority trading volume
Adjustable coverage (5-95%), default is 68%
Customizable boundary lines
Configurable lines color and thickness (1-20)
█ INPUT PARAMETERS
Lookback Settings
Use Visible Chart Range
- Default: true
- Calculates profile based on visible bars
- Ideal for focused analysis
Fixed Lookback Bars
- Range: 10-3000
- Default: 200
- Used when visible range is disabled
Resolution Settings
Enable Custom Resolution
- Default: false
- Overrides auto-resolution
Custom Resolution
- Default: 1-minute
- Changes automatically when "Enable Custom Resolution" is disabled
Volume Profile Appearance
Profile Resolution
- Range: 10-400
- Default: 200
- Controls detail level
Profile Width Scale
- Range: 1-50
- Default: 15
- Adjusts profile width
Right Offset
- Range: 0-500
- Default: 20
- Controls spacing from price bars
Profile Fill Color
- Default: #5D606B (70% transparency)
Point of Control Settings
Show Point of Control
- Default: true
- Toggles PoC visibility
PoC Line Thickness
- Range: 1-30
- Default: 1
PoC Line Color
- Default: Red
Value Area Settings
Show Value Area
- Default: true
- Toggles VA lines
Value Area Coverage
- Range: 5-95%
- Default: 68%
Value Area Line Color
- Default: Blue
Value Area Line Thickness
- Range: 1-20
- Default: 1
█ TECHNICAL IMPLEMENTATION DETAILS
Exceeding Bars Management
The script dynamically adjusts the number of bars used in the volume profile calculation based on the selected timeframe and the maximum allowed bars (max_bars_back).
If the total number of bars exceeds the predefined threshold (6000 bars), the script reduces the lookback period (lookback_bars) by trimming some of the historical data, ensuring the chart does not become overloaded with data.
The adjustment is made based on the ratio of bars per candle (bars_per_candle), ensuring that the volume profile remains computationally efficient while maintaining its relevance.
█ EXAMPLE USE CASES
1. Visible Range Mode
For analyzing a recent trend and focusing on only the visible part of the chart, enabling the "Use Visible Chart Range" option calculates the profile based on the current view, without considering historical data outside the visible area.
2. Fixed Lookback Depth
For analyzing a specific period in the past (e.g., the last 200 bars), disabling the visible range and setting a fixed lookback depth of 200 bars ensures the profile always considers the last 200 bars, regardless of the visible range.
3. Custom Resolution
If there’s a need for greater control over the timeframe used for volume profile calculations (e.g., using a 5-minute resolution on a 15-minute chart), enabling custom resolution and setting the desired timeframe provides this control.
HAPPY TRADING ✌️
Multi-indicator Signal Builder [Skyrexio]Overview
Multi-Indicator Signal Builder is a versatile, all-in-one script designed to streamline your trading workflow by combining multiple popular technical indicators under a single roof. It features a single-entry, single-exit logic, intrabar stop-loss/take-profit handling, an optional time filter, a visually accessible condition table, and a built-in statistics label. Traders can choose any combination of 12+ indicators (RSI, Ultimate Oscillator, Bollinger %B, Moving Averages, ADX, Stochastic, MACD, PSAR, MFI, CCI, Heikin Ashi, and a “TV Screener” placeholder) to form entry or exit conditions. This script aims to simplify strategy creation and analysis, making it a powerful toolkit for technical traders.
Indicators Overview
1. RSI (Relative Strength Index)
Measures recent price changes to evaluate overbought or oversold conditions on a 0–100 scale.
2. Ultimate Oscillator (UO)
Uses weighted averages of three different timeframes, aiming to confirm price momentum while avoiding false divergences.
3. Bollinger %B
Expresses price relative to Bollinger Bands, indicating whether price is near the upper band (overbought) or lower band (oversold).
4. Moving Average (MA)
Smooths price data over a specified period. The script supports both SMA and EMA to help identify trend direction and potential crossovers.
5. ADX (Average Directional Index)
Gauges the strength of a trend (0–100). Higher ADX signals stronger momentum, while lower ADX indicates a weaker trend.
6. Stochastic
Compares a closing price to a price range over a given period to identify momentum shifts and potential reversals.
7. MACD (Moving Average Convergence/Divergence)
Tracks the difference between two EMAs plus a signal line, commonly used to spot momentum flips through crossovers.
8. PSAR (Parabolic SAR)
Plots a trailing stop-and-reverse dot that moves with the trend. Often used to signal potential reversals when price crosses PSAR.
9. MFI (Money Flow Index)
Similar to RSI but incorporates volume data. A reading above 80 can suggest overbought conditions, while below 20 may indicate oversold.
10. CCI (Commodity Channel Index)
Identifies cyclical trends or overbought/oversold levels by comparing current price to an average price over a set timeframe.
11. Heikin Ashi
A type of candlestick charting that filters out market noise. The script uses a streak-based approach (multiple consecutive bullish or bearish bars) to gauge mini-trends.
12. TV Screener
A placeholder condition designed to integrate external buy/sell logic (like a TradingView “Buy” or “Sell” rating). Users can override or reference external signals if desired.
Unique Features
1. Multi-Indicator Entry and Exit
You can selectively enable any subset of 12+ classic indicators, each with customizable parameters and conditions. A position opens only if all enabled entry conditions are met, and it closes only when all enabled exit conditions are satisfied, helping reduce false triggers.
2. Single-Entry / Single-Exit with Intrabar SL/TP
The script supports a single position at a time. Once a position is open, it monitors intrabar to see if the price hits your stop-loss or take-profit levels before the bar closes, making results more realistic for fast-moving markets.
3. Time Window Filter
Users may specify a start/end date range during which trades are allowed, making it convenient to focus on specific market cycles for backtesting or live trading.
4. Condition Table and Statistics
A table at the bottom of the chart lists all active entry/exit indicators. Upon each closed trade, an integrated statistics label displays net profit, total trades, win/loss count, average and median PnL, etc.
5. Seamless Alerts and Automation
Configure alerts in TradingView using “Any alert() function call.”
The script sends JSON alert messages you can route to your own webhook.
The indicator can be integrated with Skyrexio alert bots to automate execution on major cryptocurrency exchanges
6. Optional MA/PSAR Plots
For added visual clarity, optionally plot the chosen moving averages or PSAR on the chart to confirm signals without stacking multiple indicators.
Methodology
1. Multi-Indicator Entry Logic
When multiple entry indicators are enabled (e.g., RSI + Stochastic + MACD), the script requires all signals to align before generating an entry. Each indicator can be set for crossovers, crossunders, thresholds (above/below), etc. This “AND” logic aims to filter out low-confidence triggers.
2. Single-Entry Intrabar SL/TP
One Position At a Time: Once an entry signal triggers, a trade opens at the bar’s close.
Intrabar Checks: Stop-loss and take-profit levels (if enabled) are monitored on every tick. If either is reached, the position closes immediately, without waiting for the bar to end.
3. Exit Logic
All Conditions Must Agree: If the trade is still open (SL/TP not triggered), then all enabled exit indicators must confirm a closure before the script exits on the bar’s close.
4. Time Filter
Optional Trading Window: You can activate a date/time range to constrain entries and exits strictly to that interval.
Justification of Methodology
Indicator Confluence: Combining multiple tools (RSI, MACD, etc.) can reduce noise and false signals.
Intrabar SL/TP: Capturing real-time spikes or dips provides a more precise reflection of typical live trading scenarios.
Single-Entry Model: Straightforward for both manual and automated tracking (especially important in bridging to bots).
Custom Date Range: Helps refine backtesting for specific market conditions or to avoid known irregular data periods.
How to Use
1. Add the Script to Your Chart
In TradingView, open Indicators , search for “Multi-indicator Signal Builder”.
Click to add it to your chart.
2. Configure Inputs
Time Filter: Set a start and end date for trades.
Alerts Messages: Input any JSON or text payload needed by your external service or bot.
Entry Conditions: Enable and configure any indicators (e.g., RSI, MACD) for a confluence-based entry.
Close Conditions: Enable exit indicators, along with optional SL (negative %) and TP (positive %) levels.
3. Set Up Alerts
In TradingView, select “Create Alert” → Condition = “Any alert() function call” → choose this script.
Entry Alert: Triggers on the script’s entry signal.
Close Alert: Triggers on the script’s close signal (or if SL/TP is hit).
Skyrexio Alert Bots: You can route these alerts via webhook to Skyrexio alert bots to automate order execution on major crypto exchanges (or any other supported broker).
4. Visual Reference
A condition table at the bottom summarizes active signals.
Statistics Label updates automatically as trades are closed, showing PnL stats and distribution metrics.
Backtesting Guidelines
Symbol/Timeframe: Works on multiple assets and timeframes; always do thorough testing.
Realistic Costs: Adjust commissions and potential slippage to match typical exchange conditions.
Risk Management: If using the built-in stop-loss/take-profit, set percentages that reflect your personal risk tolerance.
Longer Test Horizons: Verify performance across diverse market cycles to gauge reliability.
Example of statistic calculation
Test Period: 2023-01-01 to 2025-12-31
Initial Capital: $1,000
Commission: 0.1%, Slippage ~5 ticks
Trade Count: 468 (varies by strategy conditions)
Win rate: 76% (varies by strategy conditions)
Net Profit: +96.17% (varies by strategy conditions)
Disclaimer
This indicator is provided strictly for informational and educational purposes .
It does not constitute financial or trading advice.
Past performance never guarantees future results.
Always test thoroughly in demo environments before using real capital.
Enjoy exploring the Multi-Indicator Signal Builder! Experiment with different indicator combinations and adjust parameters to align with your trading preferences, whether you trade manually or link your alerts to external automation services. Happy trading and stay safe!
Statistical Arbitrage Pairs Trading - Long-Side OnlyThis strategy implements a simplified statistical arbitrage (" stat arb ") approach focused on mean reversion between two correlated instruments. It identifies opportunities where the spread between their normalized price series (Z-scores) deviates significantly from historical norms, then executes long-only trades anticipating reversion to the mean.
Key Mechanics:
1. Spread Calculation: The strategy computes Z-scores for both instruments to normalize price movements, then tracks the spread between these Z-scores.
2. Modified Z-Score: Uses a robust measure combining the median and Median Absolute Deviation (MAD) to reduce outlier sensitivity.
3. Entry Signal: A long position is triggered when the spread’s modified Z-score falls below a user-defined threshold (e.g., -1.0), indicating extreme undervaluation of the main instrument relative to its pair.
4. Exit Signal: The position closes automatically when the spread reverts to its historical mean (Z-score ≥ 0).
Risk management:
Trades are sized as a percentage of equity (default: 10%).
Includes commissions and slippage for realistic backtesting.
Aj's DikFat Adjusted ADXRAj's DikFat Adjusted ADXR
This indicator is designed to plot the Average Directional Index (ADX) and Average Directional Movement Rating (ADXR) on the chart. The ADX and ADXR are both used to measure the strength of a trend in the market. The script allows you to customize several parameters, including the ADX Length and the Moving Average Method used for smoothing the directional movement indicators.
Key Features:
- ADX Length : Defines the number of periods over which the ADX is calculated. This value can be adjusted by the user to suit different trading styles and timeframes.
- Moving Average Method : Choose between several smoothing methods, including Simple Moving Average (SMA), Exponential Moving Average (EMA), Wilder's Moving Average, Weighted Moving Average (WMA), Hull Moving Average (HMA), or a Super Smooth Moving Average.
- Directional Indicators : The script calculates the +DI and -DI, which represent the positive and negative directional indicators respectively. These are then used to calculate the ADX.
- ADXR : The ADXR is calculated as the average of the current ADX value and the ADX value from 14 periods ago, providing a more smoothed representation of the trend strength.
How Traders Use ADX and ADXR:
- ADX : A rising ADX indicates an increasing trend strength, while a falling ADX suggests a weakening trend. A value above 25 is often considered an indication of a strong trend.
- ADXR : This indicator smooths the ADX over time, helping traders identify persistent trends. The ADXR can help filter out noise and provide a clearer picture of the trend's health.
Please note that this script and its indicators are designed to be used as tools for analysis, not as guarantees of market outcomes. Adjustments to the moving average method or ADX length can change the behavior of the indicators based on market conditions.
Onky's DikFat Supreme Supply and Demand
Onky's DikFat Supreme Supply and Demand (DFAT S&D)
This indicator identifies and marks potential Demand and Supply zones based on sharp price movements and volume spikes. It is designed to assist traders in recognizing areas where price could potentially reverse or move impulsively, based on the concept of supply and demand.
Key Features:
- Dynamic Demand and Supply Zones : The indicator uses historical price data and sharp price movements to detect areas where demand or supply may be concentrated. The zones are drawn as boxes on the chart for visual reference.
- Volume Spike Detection : The zones are only marked when a volume spike occurs, indicating increased market activity and potentially stronger support or resistance at those levels.
- Adjustable Parameters : Traders can adjust the Zone Size to control the lookback period for detecting supply and demand zones, and can fine-tune the Volume Multiplier to control the sensitivity of volume spikes.
- Alerts : Alerts are available for both Demand and Supply zones when they are detected, allowing traders to be notified when price enters or reacts to these areas.
How Traders Use Supply and Demand Zones:
Supply and Demand Theory suggests that prices often move in response to the balance between the amount of supply (selling pressure) and demand (buying pressure) at specific price levels. When demand exceeds supply, prices tend to rise, and when supply exceeds demand, prices tend to fall.
1. Demand Zones : These are areas where price has previously fallen to a low point and buyers have stepped in, pushing prices higher. Traders may view these zones as potential areas for price to reverse upward again.
2. Supply Zones : These are areas where price has risen to a high point and sellers have stepped in, pushing prices lower. Traders may see these zones as potential areas for price to reverse downward again.
Traders use these zones to identify potential entry points (for buying in demand zones or selling in supply zones) and exit points (if price reaches these zones in the future). The volume spike further validates the strength of these zones, as it indicates heightened market interest at those levels.
This indicator offers a flexible, visual way to identify and act upon these market dynamics. It is neutral and does not guarantee any specific outcomes, but it may assist traders in recognizing important price levels where price action could change.
Disclaimer:
This indicator is provided for informational purposes only. It is not intended to be trading advice or a recommendation to buy or sell any financial instruments. Trading involves risk, and the use of this tool does not guarantee any specific results or profits. Past performance is not indicative of future results. Users are responsible for their own decisions and should seek independent financial advice before making any investment decisions.
Gap Symbolized on ChartIndicator Description: Gap Analysis with Text Symbols
This indicator analyzes the relationship between the current candle's open price, the previous candle's close price, and the current candle's close price to provide visual insights into price gaps and momentum. It displays text symbols (▼, ▲, ━) above each candle, color-coded to reflect the strength and direction of the gap.
Key Features:
Gap Analysis:
Compares the current candle's open price with the previous candle's close price.
Evaluates the current candle's close price relative to its open price.
Text Symbols:
▼ (Down Arrow): Indicates a bearish movement.
▲ (Up Arrow): Indicates a bullish movement.
━ (Dash): Indicates a neutral or sideways movement.
Color Coding:
Red: Bearish conditions (e.g., price opening lower than the previous close and closing lower than the open).
Orange: Mild bearish or bullish conditions.
Blue: Bullish conditions (e.g., price opening higher than the previous close and closing higher than the open).
Navy: Strong bullish conditions.
Transparent Background:
The text symbols are displayed without any background shape, ensuring they do not obstruct the chart.
Use Cases:
Identify Gaps: Quickly spot gaps between the previous close and the current open.
Momentum Analysis: Assess the strength and direction of price movements.
Visual Clarity: The minimalist design (text symbols only) keeps the chart clean and easy to interpret.
How to Use:
Add the indicator to your chart.
Observe the text symbols above each candle:
Red ▼: Strong bearish momentum.
Blue ▲: Strong bullish momentum.
━: Neutral or consolidation phase.
Use the insights to confirm trends, spot reversals, or identify potential entry/exit points.
Multi Stochastic AlertHello Everyone,
I have created a Multi Stochastic Alert based on Scalping Strategy
The Strategy uses below 4 Stochastic indicator:
1. Stochastic (9,3)
2. Stochastic (14,3)
3. Stochastic (40,4)
4. Stochastic (60,10)
Trade entry become active when all of these goes below 20 or above 80, In this indicator you don't need to use all 4, this will show red and green background whenever all of them goes below 20 or above 80.
As shown in picture below, it works better when script is making a channel, Our indicator shows green or red signal, we wait for RSI Divergence and we enter. We book when blue line (9,3) goes above 80, as shown by arrow, and trail rest at breakeven or your own trailing method
Same Situation shown for Short side. We book 50% when Blue line (9,3) Goes below 20 and trail rest at breakeven or your own trailing method
Happy trading, Let me know if any improvements required.
Donchian Reversal Scanner by Hitesh2603How It Works:
Bearish Side Logic:
If the price is falling with bearish candles and touching the lower Donchian Channel, the bearishCondition flag is set to true.
When a bullish candle appears afterward, the flag is reset, and the bullishReversalSquare condition becomes true.
Bullish Side Logic:
If the price is rising with bullish candles and touching the upper Donchian Channel, the bullishCondition flag is set to true.
When a bearish candle appears afterward, the flag is reset, and the bearishReversalSquare condition becomes true.
Plotting Squares:
A green square is plotted below the candle when bullishReversalSquare is true.
A red square is plotted above the candle when bearishReversalSquare is true.
Scanner Output:
The scanCondition variable is true when either bullishReversalSquare or bearishReversalSquare is true.
How to Use the Script:
On the Chart:
Add the script to your chart.
You will see squares plotted on the chart when the conditions are met:
Green squares below the candle for bullish reversals.
Red squares above the candle for bearish reversals.
In the Scanner:
Open the Scanner tab in TradingView.
Click on "Create New Scanner".
In the "Condition" field, select the script you just created.
Choose the market or watchlist you want to scan (e.g., "NYSE", "NASDAQ", or a custom watchlist).
Run the scan. The Scanner will return a list of instruments where the scanCondition is true.
Why This Works:
The scanCondition variable is now properly declared and used.
The plotchar function explicitly outputs the scanCondition variable as a plot, which the Scanner can recognize.
Price Imbalance as Consecutive Levels of AveragesOverview
The Price Imbalance as Consecutive Levels of Averages indicator is an advanced technical analysis tool designed to identify and visualize price imbalances in financial markets. Unlike traditional moving average (MA) indicators that update continuously with each new price bar, this indicator employs moving averages calculated over consecutive, non-overlapping historical windows. This unique approach leverages comparative historical data to provide deeper insights into trend strength and potential reversals, offering traders a more nuanced understanding of market dynamics and reducing the likelihood of false signals or fakeouts.
Key Features
Consecutive Rolling Moving Averages: Utilizes three distinct simple moving averages (SMAs) calculated over consecutive, non-overlapping windows to capture different historical segments of price data.
Dynamic Color-Coded Visualization: SMA lines change color and style based on the relationship between the averages, highlighting both extreme and normal market conditions.
Median and Secondary Median Lines: Provides additional layers of price distribution insight during normal trend conditions through the plotting of primary and secondary median lines.
Fakeout Prevention: Filters out short-term volatility and sharp price movements by requiring consistent historical alignment of multiple moving averages.
Customizable Parameters: Offers flexibility to adjust SMA window lengths and line extensions to align with various trading strategies and timeframes.
Real-Time Updates with Historical Context: Continuously recalculates and updates SMA lines based on comparative historical windows, ensuring that the indicator reflects both current and past market conditions.
Inputs & Settings
Rolling Window Lengths:
Window 1 Length (Most Recent) Bars: Number of bars used to calculate the most recent SMA. (Default: 5, Range: 2–300)
Window 2 Length (Preceding) Bars: Number of bars for the second SMA, shifted by Window 1. (Default: 8, Range: 2–300)
Window 3 Length (Third Rolling) Bars: Number of bars for the third SMA, shifted by the combined lengths of Window 1 and Window 2. (Default: 13, Range: 2–300)
Horizontal Line Extension:
Horizontal Line Extension (Bars): Determines how far each SMA line extends horizontally on the chart. (Default: 10 bars, Range: 1–100)
Functionality and Theory
1. Calculating Consecutive Simple Moving Averages (SMAs):
The indicator calculates three SMAs, each based on distinct and consecutive historical windows of price data. This approach contrasts with traditional MAs that continuously update with each new price bar, offering a static view of past trends rather than an ongoing one.
Mean1 (SMA1): Calculated over the most recent Window 1 Length bars. Represents the short-term trend.
Mean1=∑i=1N1CloseiN1
Mean1=N1∑i=1N1Closei
Where N1N1 is the length of Window 1.
Mean2 (SMA2): Calculated over the preceding Window 2 Length bars, shifted back by Window 1 Length bars. Represents the medium-term trend.
\text{Mean2} = \frac{\sum_{i=1}^{N_2} \text{Close}_{i + N_1}}}{N_2}
Where N2N2 is the length of Window 2.
Mean3 (SMA3): Calculated over the third rolling Window 3 Length bars, shifted back by the combined lengths of Window 1 and Window 2 bars. Represents the long-term trend.
\text{Mean3} = \frac{\sum_{i=1}^{N_3} \text{Close}_{i + N_1 + N_2}}}{N_3}
Where N3N3 is the length of Window 3.
2. Determining Market Conditions:
The relationship between the three SMAs categorizes the market condition into either extreme or normal states, enabling traders to quickly assess trend strength and potential reversals.
Extreme Bullish:
Mean3Mean2>Mean1
Mean3>Mean2>Mean1
Indicates a strong and sustained downward trend. SMA lines are colored purple and styled as dashed lines.
Normal Bullish:
Mean1>Mean2andnot in extreme bullish condition
Mean1>Mean2andnot in extreme bullish condition
Indicates a standard upward trend. SMA lines are colored green and styled as solid lines.
Normal Bearish:
Mean1Mean2>Mean1
Mean3>Mean2>Mean1
Normal Bullish:
Mean1>Mean2andnot in Extreme Bullish
Mean1>Mean2andnot in Extreme Bullish
Normal Bearish:
Mean1 Mean2 > Mean3
Visualization: All three SMAs are displayed as gold dashed lines.
Median Lines: Not displayed to maintain chart clarity.
Interpretation: Indicates a strong and sustained upward trend. Traders may consider entering long positions, confident in the trend's strength without the distraction of additional lines.
2. Normal Bullish Condition:
SMAs Alignment: Mean1 > Mean2 (not in extreme condition)
Visualization: Mean1 and Mean2 are green solid lines; Mean3 is gray.
Median Lines: A thin blue dotted median line is plotted between Mean1 and Mean2, with two additional thin blue dashed lines as secondary medians.
Interpretation: Confirms an upward trend while providing deeper insights into price distribution. Traders can use the median and secondary median lines to identify optimal entry points and manage risk more effectively.
3. Extreme Bearish Condition:
SMAs Alignment: Mean3 > Mean2 > Mean1
Visualization: All three SMAs are displayed as purple dashed lines.
Median Lines: Not displayed to maintain chart clarity.
Interpretation: Indicates a strong and sustained downward trend. Traders may consider entering short positions, confident in the trend's strength without the distraction of additional lines.
4. Normal Bearish Condition:
SMAs Alignment: Mean1 < Mean2 (not in extreme condition)
Visualization: Mean1 and Mean2 are red solid lines; Mean3 is gray.
Median Lines: A thin blue dotted median line is plotted between Mean1 and Mean2, with two additional thin blue dashed lines as secondary medians.
Interpretation: Confirms a downward trend while providing deeper insights into price distribution. Traders can use the median and secondary median lines to identify optimal entry points and manage risk more effectively.
Customization and Flexibility
The Price Imbalance as Consecutive Levels of Averages indicator is highly adaptable, allowing traders to tailor it to their specific trading styles and market conditions through adjustable parameters:
SMA Window Lengths: Modify the lengths of Window 1, Window 2, and Window 3 to capture different historical trend segments, whether focusing on short-term fluctuations or long-term movements.
Line Extension: Adjust the horizontal extension of SMA and median lines to align with different trading horizons and chart preferences.
Color and Style Preferences: While default colors and styles are optimized for clarity, traders can customize these elements to match their personal chart aesthetics and enhance visual differentiation.
This flexibility ensures that the indicator remains versatile and applicable across various markets, asset classes, and trading strategies, providing valuable insights tailored to individual trading needs.
Conclusion
The Price Imbalance as Consecutive Levels of Averages indicator offers a comprehensive and innovative approach to analyzing price trends and imbalances within financial markets. By utilizing three consecutive, non-overlapping SMAs and incorporating median lines during normal trend conditions, the indicator provides clear and actionable insights into trend strength and price distribution. Its unique design leverages comparative historical data, distinguishing it from traditional moving averages and enhancing its utility in identifying genuine market movements while minimizing false signals. This dynamic and customizable tool empowers traders to refine their technical analysis, optimize their trading strategies, and navigate the markets with greater confidence and precision.
Failed 2D & Failed 2U BarsI created this indicator to plot a triangle when a candle is either 1) a failed 2 down--the candle breaks the low of the prior candle but closes green (or higher than its opening price) and doesn't break the high of the previous candle; and 2) a failed 2 up--high of the prior candle is broken but the bar is red and does not break the low of the prior candle.
It has alerts which you can set up in the alert system.
I think that this candle is one of the most telling and powerful when it comes to candle analysis.
R.I.P. Rob Smith, Creator of The Strat.
IBOX For the indicator to appear correctly on the DE40's 5-minute char t, set it to overlay mode.
Variables: Variables are declared to store the high and low points of the first trading hour.
Draw box:
The box representing the range of the first trading hour is drawn in gray.
First trading hour range:
The code checks if it is the first trading hour (9-10 am). If so, the high and low points are stored.
Fibonacci calculation: Based on the range of the first trading hour, the Fibonacci levels 1,61, 2, 2,61, 4,61 above and below the box are calculated.
Multi-Timeframe Stoch RSIThe Multi-Timeframe Stoch RSI Indicator analyzes Stochastic RSI values across multiple timeframes (5m, 15m, 30m, 1h, 3h, and 1D) to help identify overbought and oversold conditions. It displays a visual table where each timeframe is color-coded—red for overbought (🐻) and green for oversold (✅)—allowing traders to quickly assess market momentum at different intervals. This helps in making informed trading decisions based on multi-timeframe confluence.
Auto Last Earnings AVWAP
This script provides an automated approach to tracking critical post-earnings price levels. You can add it to a chart and then flip through your watchlist to see the anchored AVWAPs without the need to do it manually one by one.
Core Features:
Automatically detects earnings dates and anchors VWAP calculations without manual input
Calculates volume-weighted average price specifically from the last earnings release
Identifies and visualizes significant earnings gaps between reporting periods
Volume-Based Signal Detection:
Monitors VWAP crosses with volume confirmation (requires 1.5x normal volume)
Labels high-volume breakouts with clear directional signals
Uses a 6-bar adaptive volume baseline to filter out noise
Practical Applications:
AVWAP anchored at earnings offers a great price support level that should be considered when deciding to buy/sell the stock. This script eliminates manual VWAP anchoring and reduces chart management time
Key Differentiators:
First note: coding VWAP anchoring in pine is more challenging that one would think. The source code is open to help other users and hopefully inspire different applications.
No need to manually anchor the VWAP
Draws earnings gap from earnings to earnings (if auto mode)
Detects breakouts through the AVWAP line
Power Trend [MacAlgo]Description:
The Power Trend Indicator is a sophisticated technical analysis tool that overlays on your trading charts to identify prevailing market trends. It utilizes a combination of ATR-based trend calculations, moving averages, volume analysis, and momentum indicators to generate reliable buy and sell signals. Additionally, it offers customizable settings to adapt to various trading styles and timeframes.
Key Features:
Adaptive ATR Calculation: Automatically adjusts the ATR (Average True Range) period and multiplier based on the selected timeframe for more accurate trend detection.
Dynamic Trend Lines: Plots continuous trend lines with color-coded bars to visually represent bullish and bearish trends.
Buy/Sell Signals: Generates standard and power buy/sell signals to help you make informed trading decisions.
Volume Analysis: Incorporates average buy and sell volumes to identify strong market movements.
Multiple Timeframe Support: Automatically adjusts the indicator's timeframe or allows for manual selection to suit your trading preferences.
Highlighting: Highlights trending bars for easy visualization of market conditions.
Alerts: Customizable alert conditions to notify you of potential trading opportunities in real-time.
How it Works:
1. ATR-Based Trend Calculation:
ATR Period & Multiplier: Calculates ATR based on user-defined periods and multipliers, dynamically adjusting according to the chart's timeframe.
Trend Determination: Identifies trends as bullish (1) or bearish (-1) based on price movements relative to ATR-based upper (up) and lower (dn) trend lines.
2. Moving Averages:
EMA & SMA: Calculates exponential and simple moving averages to smooth price data and identify underlying trends.
AlphaTrend Line: Combines a 50-period EMA and a 30-period SMA on a 4-hour timeframe to create the AlphaTrend line, providing a robust trend reference.
3. Volume Analysis:
Buy/Sell Volume: Differentiates between buy and sell volumes to gauge market strength.
Average Volume: Compares current volume against average buy/sell volumes to detect significant market movements.
4. Momentum Indicators:
RSI, MACD, OBV: Incorporates Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), and On-Balance Volume (OBV) to assess momentum and confirm trend strength.
5. Signal Generation:
Standard Signals: Basic buy and sell signals based on trend crossovers.
Power Signals: Enhanced signals requiring multiple conditions (e.g., increased volume, momentum confirmation) for higher confidence trades.
Customization Options:
Tailor the Power Trend Indicator to your specific trading needs with the following settings:
ATR Period: Set the period for ATR calculation (default: 8).
ATR Multiplier: Adjust the ATR multiplier to fine-tune trend sensitivity (default: 3.0).
Source: Choose the price source (e.g., HL2, Close) for calculations.
Change ATR Calculation Method: Toggle between different ATR calculation methods.
Show Buy/Sell Signals: Enable or disable the display of buy and sell signals on the chart.
Highlighting: Turn on or off the bar highlighting feature.
Timeframe Adjustment: Choose between automatic timeframe adjustment or manually set
the indicator's timeframe.
Manual Indicator Timeframe: If manual adjustment is selected, specify the desired timeframe (default: 60 minutes).
Visual Components:
Trend Lines: Continuous lines representing the current trend, color-coded for easy identification (green for bullish, red for bearish, orange for neutral).
Bar Coloring: Bars are colored based on the current trend and its relationship to the AlphaTrend line.
Buy/Sell Triangles: Triangular markers appear on the chart to indicate buy and sell signals.
Power Signals: Larger triangles highlight strong buy and sell opportunities based on multiple confirming factors.
Highlighting: Transparent overlays highlight trending areas to enhance visual clarity.
Alerts:
Stay informed with customizable alerts that notify you of important market movements:
SuperTrend Buy/Sell: Alerts when standard buy or sell signals are generated.
Power Buy/Sell Alerts: Notifications for strong buy or sell signals based on comprehensive conditions.
Trend Direction Change: Alerts when the trend changes from bullish to bearish or vice versa.
How to Use:
Add to Chart: Apply the Power Trend Indicator to your preferred trading chart on TradingView.
Configure Settings: Adjust the input parameters to match your trading style and the timeframe you are analyzing.
Analyze Trends: Observe the trend lines, bar colors, and AlphaTrend line to understand the current market trend.
Follow Signals: Look for buy and sell signals or power signals to identify potential entry and exit points.
Set Alerts: Enable alerts to receive real-time notifications of significant trading opportunities.
Adjust as Needed: Fine-tune the settings based on market conditions and your trading experience.
Important Notes:
Backtesting: While the Power Trend Indicator is built using robust technical analysis principles, it's essential to backtest and validate its performance within your trading strategy.
Market Conditions: The indicator performs best in trending markets. In sideways or highly volatile markets, signal reliability may vary.
Risk Management: Always employ proper risk management techniques when trading based on indicator signals to protect your capital.
Disclaimer:
This indicator is intended for educational purposes only and does not provide financial advice or guarantee future performance. Trading involves risk, and past results are not indicative of future outcomes. Always conduct your own analysis and risk management.
Parabolic Detector (10min, 75°)Объяснение :
Таймфрейм 10 минут:
Используется функция request.security для получения цены закрытия за последние 10 минут.
Таймфрейм задается через input.timeframe("10", ...).
Расчет угла наклона:
Изменение цены (price_change) рассчитывается как разница между текущей ценой закрытия и ценой закрытия 10 минут назад.
Угол наклона (angle) рассчитывается с использованием функции math.atan (арктангенс). Учитывается, что 10 минут = 600 секунд.
Пороговое значение 75 градусов:
Если абсолютное значение угла (math.abs(angle)) больше или равно 75 градусам, то движение считается параболическим.
Визуализация:
На графике отображается метка "PARABOLIC", если движение параболическое.
Monthly Options Expiration 2025Monthly Options Expiration 2025
Plots the monthly options expiration dates in advance for the year 2025.
Happy trading and all the best.
Autocorrelation Price Forecasting Backtesting [ScrimpleAI]This script presents an innovative trading backtesting strategy designed to leverage autocorrelation models and linear regression on historical price returns . The goal is to forecast future price movements, identify recurring market cycles, and optimize trading decisions.
Main Functionality
This backtesting script is built to simulate trades by integrating historical autocorrelation with dynamic price forecasting . It incorporates risk management, stop-loss features, and an advanced backtesting date range, providing traders with maximum flexibility for evaluating strategies.
Key Features
1. Customizable Date Range for Backtesting
Allows users to define the exact date period for backtesting their strategies, ensuring they can fine-tune results for specific historical scenarios.
- Inputs: Start and End dates (day, month, year).
2. Autocorrelation Price Forecasting
- Detects cycles in market movements using the `ta.correlation` function.
- Highlights significant cycles when the autocorrelation exceeds a threshold value (default: 0.50).
- Stores projected values based on autocorrelation and linear regression of percentage returns for enhanced forecasting accuracy.
3. Forecast Threshold and Profit Assessment
- Evaluates hypothetical gains by comparing forecasted future prices to the current price.
- Customizable threshold gains to determine minimum profitability requirements for opening trades.
4. Strategy Side
- Long or Short Mode: Users can choose to test either long or short strategies to align with their trading approach.
5. Risk and Trade Management
- Order Sizing: Adjust position size as a percentage of the portfolio.
- Stop-Loss Integration: Dynamically calculates stop-loss based on user-defined percentages.
- Take Profit Target: Automatically sets take-profit levels based on forecasted gains.
6. Visual Alerts
- Provides clear visual signals of long and short entries on the chart, including labels and dynamic coloring.
- Forecasted prices are displayed directly on the chart as a continuous line, enhancing decision-making clarity.
Practical Applications
1. Cycle Detection: Utilize autocorrelation to identify repetitive market behaviors and cycles.
2. Forecasting for Backtesting: Simulate trades and assess the profitability of various strategies based on future price predictions.
3. Risk Management: Test different stop-loss and take-profit configurations.
4. Custom Period Analysis: Evaluate strategy performance in specific historical market conditions using the date range filter.
Core Logic Walkthrough
1. Autocorrelation for Cycle Detection:
- Historical prices are analyzed for recurring patterns using the `ta.correlation` function.
- If a significant cycle is detected (above the `signal_threshold`), the `linreg_values` (linear regression of returns) are stored for price projection.
2. Future Price Estimation: Forecasted price is calculated based on linear regression values and current price movements.
3. Trade Entry Logic
Long Trades
- Triggered if the hypothetical gain exceeds the threshold gain.
- Sets a take-profit level based on the projected future price.
- Includes an optional stop-loss based on user-defined percentages.
Short Trades
- Triggered if the hypothetical gain is less than the negative of the threshold gain.
- Configures take-profit and stop-loss levels for bearish trades.
4. Risk Management
- Position Sizing: Automatically calculates the order size as a percentage of the portfolio.
- Stop-Loss: Dynamically adjusts stop-loss levels to minimize risk.
5. Date Range Filtering: Ensures trades are executed only within the defined backtesting period.
Example Use Case: Backtesting with Autocorrelation
- A trader analyzes a 6-month period using 50 historical bars for autocorrelation.
- Sets a threshold gain of 10% and enables a stop-loss at 5%.
- Evaluates the effectiveness of a long-only strategy in this period to assess its profitability and risk-adjusted performance.
If you find this strategy useful or have ideas for improvements, leave a comment! What new features would you like to see in this strategy?
Donchian Reversal Signals with LabelsOverview:
This indicator is designed to identify potential reversal signals based on price action relative to two Donchian Channels. It plots **"BUY"** and **"SELL"** labels on the chart when specific conditions are met, helping traders spot potential trend reversals.
---
Key Features:
1. Dual Donchian Channels:
- The indicator uses two Donchian Channels with user-defined lengths (`length1` and `length2`).
- The upper band of each channel is the highest high over the specified period.
- The lower band of each channel is the lowest low over the specified period.
2. Reversal Signals:
- A yellow "BUY" label appears below a green (bullish) candle if:
- The previous candle is red (bearish).
- The previous red candle touches or breaches either of the lower Donchian Channels.
- A green "SELL" label appears above a red (bearish) candle if:
- The previous candle is green (bullish).
- The previous green candle touches or breaches either of the upper Donchian Channels.
3. Visual Clarity:
- The labels are placed above or below the candles for easy visibility.
- The use of colors (yellow for buy, green for sell) makes it intuitive to interpret the signals.
---
How It Works:
1. Donchian Channel Calculation:
- The upper and lower bands of the two Donchian Channels are calculated using the highest high and lowest low over the specified periods (`length1` and `length2`).
2. Candle Color Detection:
- The script identifies whether the current and previous candles are bullish (green) or bearish (red) based on their open and close prices.
3. Signal Conditions:
- For a **"BUY" signal**:
- The current candle must be green.
- The previous candle must be red and touch or breach either of the lower Donchian Channels.
- For a **"SELL" signal**:
- The current candle must be red.
- The previous candle must be green and touch or breach either of the upper Donchian Channels.
4. Label Placement:
- The labels are plotted using `shape.labelup` and `shape.labeldown` for clear visibility.
---
Input Parameters:
- **Donchian Channel Length 1 (`length1`)**: The period for the first Donchian Channel (default: 20).
- **Donchian Channel Length 2 (`length2`)**: The period for the second Donchian Channel (default: 34).
---
How to Use:
1. Add the indicator to your chart.
2. Adjust the lengths of the Donchian Channels if needed.
3. Look for **"BUY"** and **"SELL"** labels on the chart:
- A **yellow "BUY" label** below a green candle suggests a potential bullish reversal.
- A **green "SELL" label** above a red candle suggests a potential bearish reversal.
4. Use these signals in conjunction with other technical analysis tools for confirmation.
---
Example Use Case:
- If the price touches the lower Donchian Channel and forms a red candle, followed by a green candle, a **"BUY" label** will appear, indicating a potential upward reversal.
- If the price touches the upper Donchian Channel and forms a green candle, followed by a red candle, a **"SELL" label** will appear, indicating a potential downward reversal.
---
Customization:
- You can modify the lengths of the Donchian Channels to suit your trading style.
- The colors and text of the labels can also be adjusted in the script if desired.
---
Disclaimer:
This indicator is designed to assist traders in identifying potential reversal signals. However, it should not be used in isolation. Always confirm signals with additional analysis and risk management strategies.
Percent Change HistogramThis indicator shows you percent changes in a super visual way using a color-coded histogram.
Here's how the colors work:
🟩 Dark green = percent change is growing stronger
🟢 Light green = still positive but losing steam
🟥 Dark red = getting more negative
🔴 Light red = negative but improving
The cool part? You can set any lookback period you want. For example:
24 periods on 1H chart = last 24 hours
30 periods on daily = last month
7 periods on daily = last week
Pro tip: You're not locked to your chart's timeframe! Want to see monthly changes while trading on 5min?
No problem.
You can even stack multiple indicators to watch different intervals simultaneously (daily, weekly, monthly) - super helpful for multi-timeframe analysis.
Perfect for spotting momentum shifts across different timeframes without switching between charts.
PlanDeFi: Adaptive Trend Ribbons [ATR+RSI]#### **Overview**
The **Crypto Half-Trend Pro ** is a trend-following indicator designed to identify bullish and bearish market conditions using a combination of **moving averages, volatility adjustments, and dynamic ATR bands**. This enhanced version improves on the traditional Half-Trend system by incorporating **EMA smoothing, volatility-based adjustments, and additional fakeout/reversal detection mechanisms**.
#### **Key Features**
✅ **Trend Detection:**
- Uses a combination of fast and slow moving averages (EMA/SMA) to determine trend direction.
- Implements **Hull Moving Average (HMA)** smoothing for better trend visualization.
✅ **Dynamic ATR Bands:**
- Adjusts bands based on market volatility using **RSI-based ATR multipliers**.
- Helps identify potential **breakouts and trend reversals**.
✅ **Fakeout & Reversal Detection:**
- Detects potential **fake breakouts** by analyzing price action against extended ATR bands.
- Identifies **early reversal signals** using price crossovers and volume confirmation.
✅ **Customizable Alerts & Visuals:**
- Built-in **buy & sell signals** for trend confirmation.
- Color-coded bullish/bearish trend lines and **fakeout warnings**.
- **TradingView alerts** for trend shifts and reversals.
#### **How It Works**
🔹 The indicator calculates a **smoothed trend line** using a Hull Moving Average on dynamic price levels.
🔹 ATR bands expand/contract dynamically based on **market volatility** to improve signal accuracy.
🔹 Trend direction is confirmed when price crosses the trend line **with volume confirmation**.
🔹 **Fakeouts** are detected when price temporarily exceeds extended bands but fails to hold momentum.
🔹 **Reversal signals** are generated when price breaks back into the ATR zone with volume spikes.
#### **How to Use It**
- 📈 **Buy Signal:** When price breaks above the trend line, confirmed by volume and crossover signals.
- 📉 **Sell Signal:** When price breaks below the trend line with confirmed bearish conditions.
- 🚨 **Reversal Warning:** If price sharply re-enters the ATR zone with volume confirmation, expect a potential trend shift.
- 🛑 **Fakeout Alert:** If price temporarily breaks resistance but closes back inside, it may be a false move.
#### **Ideal For**
✔️ Crypto & Forex traders looking for **dynamic trend signals**
✔️ Swing traders wanting to **avoid fakeouts & catch reversals**
✔️ Traders seeking a **customizable, volatility-adjusted trend system**
🚀 **Try PlanDeFi: Adaptive Trend Ribbons today and improve your trend analysis!**
VIX Differential(Melon)Simple indy that measures the difference between VIX9D and VIX to try assessing short-term market sentiment. I've liked this recently as a big clue for market bottom reversals.