Multi-SMA Dashboard (10 SMAs)Description:
This script, "Multi-SMA Dashboard (10 SMAs)," creates a dashboard on a TradingView chart to analyze ten Simple Moving Averages (SMAs) of varying lengths. It overlays the chart and displays a table with each SMA’s direction, price position relative to the SMA, and angle of movement, providing a comprehensive trend overview.
How It Works:
1. **Inputs**: Users define lengths for 10 SMAs (default: 5, 10, 20, 50, 100, 150, 200, 250, 300, 350), select a price source (default: close), and customize table appearance and options like angle units (degrees/radians) and debug plots.
2. **SMA Calculation**: Computes 10 SMAs using the `ta.sma()` function with user-specified lengths and price source.
3. **Direction Determination**: The `sma_direction()` function checks each SMA’s trend:
- "Up" if current SMA > previous SMA.
- "Down" if current SMA < previous SMA.
- "Flat" if equal (no strength distinction).
4. **Price Position**: Compares the price source to each SMA, labeling it "Above" or "Below."
5. **Angle Calculation**: Tracks the most recent direction change point for each SMA and calculates its angle (atan of price change over time) in degrees or radians, based on the `showInRadians` toggle.
6. **Table Display**: A 12-column table shows:
- Columns 1-10: SMA name, direction (Up/Down/Flat), Above/Below status, and angle.
- Column 11: Summary of Up, Down, and Flat counts.
- Colors reflect direction (lime for Up/Above, red for Down/Below, white for Flat).
7. **Debug Option**: Optionally plots all SMAs and price for visual verification when `debug_plots_toggle` is enabled.
Indicators Used:
- Simple Moving Averages (SMAs): 10 user-configurable SMAs ranging from short-term (e.g., 5) to long-term (e.g., 350) periods.
The script runs continuously, updating the table on each bar, and overlays the chart to assist traders in assessing multi-timeframe trend direction and momentum without cluttering the view unless debug mode is active.
Analisis Trend
Trend Targets [AlgoAlpha]OVERVIEW
This script combines a smoothed trend-following model with dynamic price rejection logic and ATR-based target projection to give traders a complete visual framework for trading trend continuations. It overlays on price and automatically detects potential trend shifts, confirms rejections near dynamic support/resistance, and displays calculated stop-loss and take-profit levels to support structured risk-reward management. Unlike traditional indicators that only show trend direction or signal entries, this tool brings together a unique mix of signal validation, volatility-aware positioning, and layered profit-taking to guide decision-making with more context.
CONCEPTS
The core trend logic is built on a custom Supertrend that uses an ATR-based band structure with long smoothing chains—first through a WMA, then an EMA—allowing the trend line to respond to major shifts while ignoring noise. A key addition is the use of rejection logic: the script looks for consolidation candles that "hug" the smoothed trend line and counts how many consecutive bars reject from it. This behavior often precedes significant moves. A user-defined threshold filters out weak tests and highlights only meaningful rejections.
FEATURES
Trend Detection : Automatically identifies trend direction using a smoothed Supertrend (WMA + EMA), with shape markers on trend shifts and color-coded bars for clarity.
Rejection Signals : Detects price rejections at the trend line after a user-defined number of consolidation bars; plots ▲/▼ icons to highlight strong continuation setups.
Target Projection : On trend confirmation, plots entry, stop-loss (ATR-based), and three dynamic take-profit levels based on customizable multiples.
Dynamic Updates : All levels (entry, SL, TP1–TP3) auto-adjust based on volatility and are labeled in real time on the chart.
Customization : Users can tweak trend parameters, rejection confirmation count, SL/TP ratios, smoothing lengths, and appearance settings.
Alerts : Built-in alerts for trend changes, rejection events, and when TP1, TP2, or TP3 are reached.
Chart Overlay : Plots directly on price chart with minimal clutter and clearly labeled levels for easy trading.
USAGE
Start by tuning the Supertrend factor and ATR period to fit your asset and timeframe—higher values will catch bigger swings, lower values catch faster moves. The confirmation count should match how tightly you want to filter rejection behavior—higher values make signals rarer but stronger. When the trend shifts, the indicator colors the bars and line accordingly, and if enabled, plots the full entry-TP-SL structure. Rejection markers appear only after enough qualifying bars confirm price pressure at the trend line. This is especially useful for continuation plays where price retests the trend but fails to break it. All calculations are based on volatility (ATR), so targets naturally adjust with market conditions. Add alerts to get notified of important signals even when away from the chart.
Dynamic Support|Resistance SSA & SSBHello, traders. I offer you an indicator to complement the Ichimoku Kinho Hyo trading system. This indicator determines possible dynamic resistance and support levels based on pivots and end points of the Senkou Span A and Senkou Span B lines.
You determine the pivots yourself, choosing how many bars back to look for HIGH and LOW.
Attention! Unlike the classical theory of Goichi Hosoda: the levels are dynamic, that is, they change values with each new bar!
Also added is the MTF function for displaying levels from different time frames.
Goichi Hosoda TheoryGreetings to traders. I offer you an indicator for trading according to the Ichimoku Kinho Hyo trading system. This indicator determines possible time cycles of price reversal and expected asset price values based on the theory of waves and time cycles by Goichi Hosoda.
The indicator contains classic price levels N, V, E and NT, and is supplemented with intermediate levels V+E, V+N, N+NT and x2, x3, x4 for levels V and E, which are used in cases where the wave does not contain corrections and there is no possibility to update the impulse-corrective wave.
A function for counting bars from points A B and C has also been added.
RSI + MA + Divergence + SnR + Price levelOverview
This indicator combines several technical analysis tools to give traders a comprehensive view based on the RSI indicator. Its main features include:
RSI & Moving Averages on RSI:
RSI: Calculates the RSI based on the closing price (or a user-selected source) with a configurable period (default is 14).
EMA and WMA: Computes and plots an Exponential Moving Average (EMA with a period of 9) and a Weighted Moving Average (WMA with a period of 45) on the RSI, helping to smooth out signals and better identify trends.
Price Ladder Based on RSI:
Draws horizontal lines at specified target RSI levels (from targetRSI1 to targetRSI7, default levels ranging from 20 to 80).
Calculates a target price based on the price change relative to the averaged gains and losses, providing an estimated price level when the RSI reaches those critical levels.
Divergence Detection:
Identifies divergence between price and RSI:
Bullish Divergence: Detected when the price forms a lower low but RSI fails to confirm with a corresponding lower low, with the RSI falling under a configurable threshold (d_below).
Bearish Divergence: Detected when the price forms a higher high while the RSI does not, with the RSI exceeding a configurable upper threshold (d_upper).
Optionally displays labels on the chart to alert the trader when divergence signals are detected.
Auto Support & Resistance on RSI:
Automatically calculates and plots support and resistance lines based on the RSI over different lookback periods (e.g., 34, 89, 200 bars).
Helps traders identify key RSI levels where price reversals or breakouts might occur.
Benefits for the Trader
This indicator is designed to assist traders in their decision-making process by integrating multiple technical analysis elements:
Identifying Market Trends:
By combining the RSI with its moving averages (EMA, WMA), traders can better assess market trends and the strength of these trends, thereby improving trade entry accuracy.
Early Reversal Signals via Divergence:
Divergence signals (both bullish and bearish) can help forecast potential reversals in the market, allowing traders to adjust their strategies timely.
Determining RSI-Based Support/Resistance Levels:
Automatic identification of support and resistance levels on the RSI provides key areas where a price reversal or breakout may occur, assisting traders in setting stop-loss and take-profit levels strategically.
Price Target Forecasting with the Price Ladder:
The target price labels calculated at important RSI levels provide insights into potential price objectives, aiding in risk management and profit planning.
Flexible Configuration:
Traders can customize key parameters such as the RSI period, lengths for EMA and WMA, target RSI levels, divergence conditions, and support/resistance settings. This flexibility allows the indicator to adapt to different trading styles and strategies.
How to read data
Some use-cases
Used to estimate price according to the RSI level.
When you trade using RSI, you want to set your stop-loss or take-profit levels based on RSI. By looking at the price ladder, you know the corresponding price level to enter a trade.
Used to determine the entry zone.
RSI often reacts to its own previously established support/resistance levels. Use the Auto SnR feature to identify those zones.
Used to determine the trend.
RSI and its moving averages help identify the price trend:
Uptrend: 3 lines separate and point upward.
Downtrend: 3 lines separate and point downward.
Use WMA45 to determine the trend:
Uptrend: WMA45 is moving upward or trading above the 50 level.
Downtrend: WMA45 is moving downward or trading below the 50 level.
Sideways: WMA45 is trading around the 50 level.
Use EMA9 to confirm the trend: A crossover of EMA9 through WMA45 confirms the formation of a new trend.
Configuration
The script allows users to configure a number of important parameters to suit their analytical preferences:
RSI Settings:
RSI Length (rsiLengthInput): The number of periods used to compute the RSI (default is 14, adjustable as needed).
RSI Source (rsiSourceInput): Select the price source (default is the closing price).
RSI Color (rsiClr): The color used to display the RSI line.
Moving Averages on RSI:
EMA Length (emaLength): The period for calculating the EMA on RSI (default is 9).
WMA Length (wmaLength): The period for calculating the WMA on RSI (default is 45).
EMA Color (emaClr) and WMA Color (wmaClr): Customize the colors of the EMA and WMA lines.
Price Ladder Settings:
Toggle Price Ladder (showPrice): Enable or disable the display of the price ladder.
Target RSI Levels: targetRSI1 through targetRSI7: RSI values at which target prices are calculated (default values range from 20, 30, 40, 50, 60, 70 to 80).
Price Label Color (priceColor): The text color for displaying the target price labels.
Divergence Settings:
Divergence Toggle (calculateDivergence): Option to enable or disable divergence calculation and display.
Divergence Conditions:
d_below: RSI level below which bullish divergence is considered.
d_upper: RSI level above which bearish divergence is considered.
Display Divergence Labels (showDivergenceLabel): Option to display labels on the chart when divergence is detected.
Auto Support & Resistance on RSI:
Toggle Auto S&R (enableAutoSnR): Enable or disable automatic plotting of support and resistance levels.
Lookback Periods for Support/Resistance:
L1_lookback: Lookback period for level 1 (e.g., 34 bars).
L2_lookback: Lookback period for level 2 (e.g., 89 bars).
L3_lookback: Lookback period for level 3 (e.g., 200 bars).
Support and Resistance Colors:
rsiSupportClr: Color for the support line.
rsiResistanceClr: Color for the resistance line.
Alerts:
Divergence Alerts: Alert conditions are set up to notify the trader when bullish or bearish divergence is detected, aiding in timely decision-making.
Fibonacci Levels with SMA SignalsThis strategy leverages Fibonacci retracement levels along with the 100-period and 200-period Simple Moving Averages (SMAs) to generate robust entry and exit signals for long-term swing trades, particularly on the daily timeframe. The combination of Fibonacci levels and SMAs provides a powerful way to capitalize on major trend reversals and market retracements, especially in stocks and major crypto assets.
The core of this strategy involves calculating key Fibonacci retracement levels (23.6%, 38.2%, 61.8%, and 78.6%) based on the highest high and lowest low over a 365-day lookback period. These Fibonacci levels act as potential support and resistance zones, indicating areas where price may retrace before continuing its trend. The 100-period SMA and 200-period SMA are used to define the broader market trend, with the strategy favoring uptrend conditions for buying and downtrend conditions for selling.
This indicator highlights high-probability zones for long or short swing setups based on Fibonacci retracements and the broader trend, using the 100 and 200 SMAs.
In addition, this strategy integrates alert conditions to notify the trader when these key conditions are met, providing real-time notifications for optimal entry and exit points. These alerts ensure that the trader does not miss significant trade opportunities.
Key Features:
Fibonacci Retracement Levels: The Fibonacci levels provide natural price zones that traders often watch for potential reversals, making them highly relevant in the context of swing trading.
100 and 200 SMAs: These moving averages help define the overall market trend, ensuring that the strategy operates in line with broader price action.
Buy and Sell Signals: The strategy generates buy signals when the price is above the 200 SMA and retraces to the 61.8% Fibonacci level. Sell signals are triggered when the price is below the 200 SMA and retraces to the 38.2% Fibonacci level.
Alert Conditions: The alert conditions notify traders when the price is at the key Fibonacci levels in the context of an uptrend or downtrend, allowing for efficient monitoring of trade opportunities.
Application:
This strategy is ideal for long-term swing trades in both stocks and major cryptocurrencies (such as BTC and ETH), particularly on the daily timeframe. The daily timeframe allows for capturing broader, more sustained trends, making it suitable for identifying high-quality entries and exits. By using the 100 and 200 SMAs, the strategy filters out noise and focuses on larger, more meaningful trends, which is especially useful for longer-term positions.
This script is optimized for swing traders looking to capitalize on retracements and trends in markets like stocks and crypto. By combining Fibonacci levels with SMAs, the strategy ensures that traders are not only entering at optimal levels but also trading in the direction of the prevailing trend.
Altseason Index (Top 10)### Altseason Index (Top 10)
#### Overview
The "Altseason Index (Top 10)" indicator identifies whether the market is in an altseason (altcoins outperforming Bitcoin) or a Bitcoin season. It analyzes the performance of 9 top altcoins (ETH, BNB, ADA, XRP, SOL, DOT, AVAX, SHIB, LINK) against Bitcoin over 90 days, inspired by the Blockchain Center Altcoin Season Index.
#### How It Works
- Calculates the 90-day price change for BTC and 9 altcoins.
- Counts how many altcoins outperform BTC.
- Index = (number of outperforming altcoins / 9) * 100.
- >75%: Altseason (green zone).
- <25%: Bitcoin season (red zone).
- 25–75%: Neutral.
#### Visualization
- Blue line: Index value (0–100).
- Green line at 75: Altseason threshold.
- Red line at 25: Bitcoin season threshold.
- Green/red background fill for altseason/BTC season zones.
#### Usage
Add to your chart and interpret:
- Above 75: Consider altcoin investments.
- Below 25: Focus on Bitcoin.
Ensure tickers match your exchange (e.g., "BTCUSD" or "BINANCE:BTCUSDT").
#### Notes
- Limited to 9 altcoins due to TradingView's request.security() limit.
- Best on daily charts but adaptable to other timeframes.
Intraday LevelsWhat it shows:
This indicator is useful for day trading, where it will track and display you important price levels which includes:
Premarket Low (PML)
Premarket High (PMH)
Previous Day Low (PDL)
Previous Day High (PDH)
Previous Day Close (PDC)
After Hours Low (AHL)
After Hours High (AHH)
Day Low (DL)
Day High (DH)
The price level lines and labels will automatically adjust itself as the price moves, eliminating the need of manually having to adjusting these levels.
How to use it:
At these levels it can act as important support resistance points during the day and can often serve as a important pivot point for any ticker. You can expect price rejection or bounce when the price approaches these levels.
Key settings:
For each of the levels, user can adjust in the settings menu:
Line Colour
Line Thickness
Line Style
Label Text
Price Labelling on Label
Label Location (Offset from current bar)
Ability to turn on/off the price level and label
Display levels for either all days or on the day
Market Regime Candle DominanceDescription: This script, "Market Regime Candle Dominance," overlays a TradingView chart to visually identify market regimes—bullish trends, bearish trends, or ranging markets—using adaptive calculations and volatility detection. It dynamically colors candles and highlights the background to indicate current market conditions.
How It Works:
Inputs:
Users define colors for bullish, bearish, and ranging trends, adjust sensitivity thresholds for volatility and trends, and set an adaptive calculation length.
Adaptive Calculation:
A period adjustment factor (calcPeriod) dynamically alters based on the chart's timeframe, ensuring meaningful calculations across different timeframes.
Volatility and Trend Detection:
Using the True Range (ta.tr) and price change (close - close ), the script calculates volatility and trend strength to determine market conditions.
Trend sensitivity is adjustable through thresholds (trendThreshold), enabling finer or broader regime detection.
Market Regime Identification:
Bullish Trend: Detected when trendStrength > trendThreshold.
Bearish Trend: Triggered when trendStrength < -trendThreshold.
Ranging Market: Identified when neither bullish nor bearish trends are present.
Candle Coloring:
Candles are colored according to the market regime:
Green for bullish trends.
Red for bearish trends.
Blue (semi-transparent) for ranging markets.
Background Highlights:
An optional feature (highlightRegime) adds semi-transparent background colors corresponding to the detected regime, enhancing visual clarity of the chart.
Features:
Adaptive Sensitivity: Adjusts the calculation length and thresholds for precision across different chart timeframes.
Customizable Display: Allows users to personalize colors and enable/disable background highlights.
Visual Clarity: Simplifies the identification of market regimes, providing clear direction at a glance.
Buy/Sell EMA Trend Filter v6Buy/Sell EMA Trend Filter v6
This indicator provides a comprehensive trading system based on EMA crossovers with trend filtering for TradingView. It's designed to identify high-probability buy and sell signals by combining short-term crossovers with longer-term trend direction confirmation.
Key Features:
EMA Crossover System: Uses fast and slow EMAs (9 and 21 by default) to generate initial signals
Trend Filtering: Confirms signals with longer-term trend direction (50 and 200 EMAs)
Automatic TP/SL Calculation: Displays clear take profit and stop loss levels based on fixed risk points
Visual Alerts: Clear buy/sell markers at the point of signal with detailed labels
Risk Management: Pre-calculated risk-to-reward setup (default 1:2 ratio)
How It Works:
Buy Signal: When the fast EMA crosses above the slow EMA while the 50 EMA is above the 200 EMA (bullish trend)
Sell Signal: When the fast EMA crosses below the slow EMA while the 50 EMA is below the 200 EMA (bearish trend)
Customizable Parameters:
Fast EMA period (default: 9)
Slow EMA period (default: 21)
Trend EMA periods (default: 50 and 200)
Fixed risk in points (default: 20)
Reward ratio (default: 2.0)
The indicator displays clear entry points with predefined stop loss and take profit levels, making it ideal for traders looking for a systematic approach to the markets. Perfect for both day trading and swing trading timeframes.
This tool combines both trend following and momentum principles to filter out low-probability trades and focus on high-quality setups where the trend and momentum align.
RT-RSI 2.0 + Signal📈 RT-RSI 2.0 + Signal – Enhanced RSI Divergence Detection
RT-RSI 2.0 + Signal is a powerful and flexible RSI-based divergence indicator designed for traders who want smarter market entries using real-time confirmations.
This script identifies bullish and bearish RSI divergences, visualizes them directly on the RSI pane, and provides clear output signals (numeric: 1.0 for bullish, 2.0 for bearish) for use in external strategy scripts like RT-Signal 2.0.1.
🔍 Core Features:
✔️ Detects classic RSI divergences (bullish & bearish)
✔️ Includes automatic pivot detection and flexible lookback settings
✔️ External signal output for use in multi-pattern or strategy systems
✔️ Optimized RSI calculation per market type (BTC, DAX, Gold, Forex, etc.)
✔️ Customizable moving average & Bollinger Band smoothing
✔️ Signal is output via plot() (non-displayed) for remote use
MACD Crossover + AlertMACD Proximity & Crossover Alert Script
This script is designed to help traders stay ahead of MACD crossovers by providing:
Early alerts when the MACD and Signal lines are getting close (within a customizable threshold)
Instant alerts when a bullish or bearish crossover occurs
Whether you're swing trading or scalping, this tool gives you advanced notice to prepare — and a confirmation signal to act on. It works on any timeframe and helps avoid late entries by alerting you when momentum is shifting.
Features:
Customizable MACD settings (fast, slow, signal length)
Adjustable "proximity" threshold
Visual background highlight when lines are close
Built-in alert conditions for:
MACD crossing above Signal (bullish)
MACD crossing below Signal (bearish)
MACD and Signal getting close (early warning)
Perfect for traders who want a heads-up before momentum shifts — not just a reaction afterward.
Buy/Sell Volume ComparisonKey improvements:
Direct volume comparison: Now shows the current day's volume and previous day's volume side by side
Percentage change display: Clear percentage change with up/down arrows
Table position customization: Added a dropdown menu to select where you want the table to appear
To adjust the table position:
Click on the settings (gear icon) for the indicator after adding it to your chart
You'll see a dropdown menu labeled "Table Position"
Select from options like "Top Right", "Bottom Left", etc.
Click "OK" to apply your changes
This version also handles the case where there's no previous volume data (first bar of the chart) by checking for NA values.
Let me know if this meets your requirements, or if you'd like any other adjustments!RetryClaude does not have the ability to run the code it generates yet.Claude can make mistakes. Please double-check responses.Tip: Long chats cause you to reach your usage limits faster.
Dynamic Volume Profile PoC SwiftedgeOverview
The Dynamic Volume Profile PoC is a powerful and visually intuitive indicator designed to help traders identify key support and resistance levels using a unique combination of pivot points, volume analysis, and dynamic Point of Control (PoC) levels. This script overlays directly on your chart, providing clear visual cues for potential breakout and rejection zones, making it easier to spot high-probability trading opportunities.
What It Does
This indicator combines three core components to deliver actionable insights:
Pivot Points: Identifies significant swing highs and lows to establish potential support and resistance levels.
Volume Oscillator: Measures volume momentum to confirm the strength of price movements, ensuring that breakouts or rejections are backed by significant volume.
Dynamic Point of Control (PoC): Calculates the midpoint between consecutive pivot points to create dynamic PoC levels, which act as key areas where price is likely to either break through (breakout) or reverse (rejection).
These components work together to highlight critical price levels where the market is likely to react, giving traders a clear framework for decision-making.
How It Works
Pivot Detection: The script uses pivot highs and lows (based on user-defined Left Bars and Right Bars) to identify significant price levels. These pivots form the foundation for calculating PoC levels.
PoC Calculation: Each time a new pivot is detected, the script calculates the midpoint between the current pivot and the previous pivot, creating a dynamic PoC level. These levels are plotted as horizontal lines on the chart, with a maximum of Max PoC Lines to Show (default: 2) visible at any time.
Volume Confirmation: A volume oscillator (short EMA of volume minus long EMA of volume) is used to filter breakouts and rejections. Breakouts or rejections are only signaled if the volume oscillator exceeds the Volume Threshold (default: 20), ensuring that price movements are supported by strong volume.
Visual Cues:
PoC levels are drawn as cyan lines with optional semi-transparent zones (controlled by Show PoC Zones). These zones are colored green for potential breakouts (price above PoC) and red for potential rejections (price below PoC).
Labels above and below each PoC level indicate trading opportunities: "Long if breakout"/"Long if rejected" (green) and "Short if breakout"/"Short if rejected" (red), depending on the price's direction relative to the PoC.
Break signals ("B") are plotted above or below bars when price crosses a pivot level with sufficient volume, colored red for downward breaks and green for upward breaks.
How to Use
Add the Indicator: Add the "Dynamic Volume Profile PoC " to your chart in TradingView.
Adjust Settings:
Left Bars and Right Bars (default: 15): Control the sensitivity of pivot detection. Lower values make the script more sensitive to smaller price swings.
Volume Threshold (default: 20): Set the minimum volume oscillator value required to confirm breakouts or rejections. Increase this for stricter confirmation.
Max PoC Lines to Show (default: 2): Define how many PoC levels are displayed at once.
Show PoC Zones (default: true): Toggle semi-transparent zones around PoC levels for better visualization.
Label Spacing Factor (default: 0.5): Adjust the vertical spacing between labels and the PoC box. Increase this value (e.g., to 1.0 or 2.0) for more spacing, or decrease it (e.g., to 0.3) for less.
Interpret the Signals:
Look for PoC levels (cyan lines) as key areas of interest.
Use the labels to identify potential trades: "Long if breakout" indicates a buy opportunity if price breaks above the PoC, while "Short if rejected" suggests a sell if price fails to break through.
Watch for "B" signals to confirm breakouts or rejections with volume support.
Combine with Your Strategy: Use the PoC levels and break signals as part of your broader trading strategy, such as trend-following or mean-reversion setups.
Why This Script is Unique
The Dynamic Volume Profile PoC stands out by combining pivot points, volume analysis, and dynamic PoC levels into a single, cohesive tool. Unlike traditional volume profile indicators that require a fixed range, this script dynamically updates PoC levels based on recent price action, making it more responsive to current market conditions. The addition of volume confirmation ensures that signals are backed by market participation, reducing false breakouts. The visually appealing design, with customizable spacing and semi-transparent zones, makes it easy to interpret key levels at a glance, even for traders unfamiliar with Pine Script.
Notes
This script works best on timeframes where pivot points are meaningful (e.g., 1H, 4H, or daily charts).
Adjust the Label Spacing Factor to ensure labels are well-spaced for your chart's zoom level and instrument.
For instruments with high volatility, you may need to increase the Volume Threshold to filter out noise.
Pullback SARPullback SAR - Parabolic SAR with Pullback Detection
Description: The "Pullback SAR" is an advanced indicator built on the classic Parabolic SAR but with additional functionality for detecting pullbacks. It helps identify moments when the price pulls back from the main trend, offering potential entry signals. Perfect for traders looking to enter the market after a correction.
Key Features:
SAR (Parabolic SAR): The Parabolic SAR indicator is used to determine potential trend reversal points. It marks levels where the price could reverse its direction.
Pullback Detection: The indicator catches periods when the price moves away from the main trend and then returns, which may suggest a re-entry opportunity.
Long and Short Signals: Once a pullback in the direction of the main trend is identified, the indicator generates signals that could be used to open positions.
Simple and Clear Construction: The indicator is based on the classic SAR, with added pullback detection logic to enhance the accuracy of the signals.
Parameters:
Start (SAR Step): Determines the initial step for the SAR calculation, which controls the rate of change in the indicator at the beginning.
Increment (SAR Increment): Defines the maximum step size for SAR, allowing traders to adjust the indicator’s sensitivity to market volatility.
Max Value (SAR Max): Sets the upper limit for the SAR value, controlling its volatility.
Usage:
Swing Trading: Ideal for swing strategies, aiming to capture larger price moves while maintaining a safe margin.
Scalping: Due to its precise pullback detection, it can also be used in scalping, especially when the price quickly returns to the main trend.
Risk Management: The combination of SAR and pullback detection allows traders to adjust their positions according to changing market conditions.
Special Notes:
Adjusting Parameters: Depending on the market and trading style, users can adjust the SAR parameters (Start, Increment, Max Value) to fit their needs.
Combination with Other Indicators: It's recommended to use the indicator alongside other technical analysis tools (e.g., EMA, RSI) to enhance the accuracy of the signals.
Link to the script: This open-source version of the indicator is available on TradingView, enabling full customization and adjustments to meet your personal trading strategy. Share your experiences and suggestions!
EMA and VWAP by Phil VoEMA and VWAP by Phil Vo
Description
This indicator combines two powerful technical analysis tools: Exponential Moving Averages (EMAs) and Volume Weighted Average Price (VWAP). Designed to assist traders in identifying trends and key price levels, this script overlays two customizable EMAs and a daily VWAP on your chart.
* EMA 1 (Blue): A fast-moving EMA with a default period of 9, ideal for short-term trend analysis.
* EMA 2 (Red): A slower EMA with a default period of 21, useful for confirming longer-term trends.
* VWAP (Yellow): The Volume Weighted Average Price, calculated using the typical price (HLC3) and volume, resetting daily. It serves as a dynamic support/resistance level and reflects the average price weighted by volume.
Features
* Customizable EMAs: Adjust the periods of both EMAs via the settings (minimum period: 1).
* Visual Clarity: Each line is plotted in a distinct color (Blue for EMA 1, Red for EMA 2, Yellow for VWAP) with a linewidth of 2 for easy identification.
* Daily VWAP: The VWAP resets at the start of each trading day, providing a reliable intraday reference point.
* Tooltips: Hover over the input settings to see descriptions of each EMA period.
How to Use
1. Add the indicator to your chart.
2. Customize the EMA periods in the settings if desired (defaults are 9 and 21).
3. Use the EMAs to spot trends:
* When EMA 1 crosses above EMA 2, it may signal a bullish trend.
* When EMA 1 crosses below EMA 2, it may indicate a bearish trend.
4. Use the VWAP as a dynamic support/resistance level:
* Prices above VWAP might suggest bullish momentum.
* Prices below VWAP might indicate bearish pressure.
Settings
* EMA 1 Length: Set the period for the fast EMA (default: 9).
* EMA 2 Length: Set the period for the slow EMA (default: 21).
Notes
* The VWAP resets daily by default, making it most suitable for intraday trading.
* This script is open-source under the Mozilla Public License 2.0, so feel free to study or modify it!
Author
Created by Phil Vo. Happy trading!
How to Add This to TradingView
When you publish the script:
1. Paste the description above into the "Description" field in the "Publish Script" dialog.
2. Set the title as "EMA and VWAP by Phil Vo".
3. Choose "Public" visibility and "Open" access to share it with the community.
4. Add tags like "EMA", "VWAP", "Moving Average", "Trend", and "Volume" to help users find it.
This description provides a clear explanation of the indicator’s purpose, usage instructions, and customization options, making it accessible and helpful for TradingView users. Let me know if you’d like to adjust anything!
DM Support / Resistance (USA Session)This indicator is specifically designed for use on the 4-hour time frame and helps traders identify key support and resistance levels during the USA trading session (9:30 AM to 4:00 PM Eastern Time). The indicator calculates important price levels to assist in making well-informed entry and exit decisions, particularly for those focusing on swing trades or longer-term intraday strategies. It also includes a feature to skip setups when relevant fundamental news is scheduled, ensuring you avoid trading during periods of high volatility.
Key Features:
Support and Resistance Levels (S1 & R1):
The indicator calculates and displays Support 1 (S1) and Resistance 1 (R1) levels, which act as key barriers for price action and help traders spot potential reversal or breakout zones on the chart.
Pivot Point (PP):
The Pivot Point (PP) is calculated as the average of the previous period's high, low, and close. It serves as a central reference point for market direction, allowing traders to evaluate whether the market is in a bullish or bearish trend.
Market Bias:
The Bias is shown as a histogram that helps traders assess the strength of the market trend. A positive bias suggests bullish sentiment, while a negative bias signals bearish conditions. This can be used to confirm the overall trend direction.
4-Hour Time Frame:
The indicator is optimized for the 4-hour time frame, making it suitable for traders looking for swing trades or those who wish to capture longer-term trends within the USA session. The key support, resistance, and pivot levels are recalculated dynamically to reflect price action over 4-hour periods.
Dynamic Plotting and Alerts:
Support and resistance levels are drawn as dashed horizontal lines, updating in real-time to reflect the most current market data during the USA session. Alerts can be set for significant price movements crossing these levels.
Stop-Loss Strategy Based on 15-Minute Time Frame:
A unique feature of this indicator is its stop-loss strategy, which uses 15-minute time frame support and resistance levels. When a long or short entry is triggered on the 4-hour chart, traders should place their stop-loss according to the relevant 15-minute support or resistance level.
If the price closes above the 15-minute support for a long entry, or closes below the 15-minute resistance for a short entry, it signals the need to exit or adjust your position based on these levels.
Fundamental News Filter:
To avoid unnecessary risk, the indicator incorporates a fundamental news filter. If there is relevant news scheduled during the USA session, such as high-impact economic data or central bank announcements, the indicator will skip the setup for that period. This prevents traders from entering positions during times of elevated volatility caused by news events, which could result in unpredictable price movements.
How to Use:
Long Entry: When the Bias is positive and the price breaks above Support 1 (S1), this signals a potential bullish move. Consider entering a long position at this point.
Stop-Loss Strategy: Set your stop-loss at the respective 15-minute support level. If the price closes below this level, it could signal a reversal, prompting you to exit the trade.
Short Entry: When the Bias is negative and the price breaks below Resistance 1 (R1), this signals a potential bearish move. Enter a short position at this point.
Stop-Loss Strategy: Set your stop-loss at the respective 15-minute resistance level. If the price closes above this level, exit the short trade as it could indicate a bullish reversal.
Pivot Point (PP): The Pivot Point serves as a reference level to gauge potential price reversals. A move above the PP suggests a bullish bias, while trading below the PP suggests a bearish outlook.
Bias Histogram: The Bias Histogram helps confirm trend direction. A positive bias confirms long positions, while a negative bias reinforces short trades.
Avoid Trading During High-Impact News: If there is significant economic news or fundamental events scheduled during the USA session, the indicator will automatically skip any potential setup. This feature ensures you avoid entering trades that might be affected by unexpected news-driven volatility, keeping your trading strategy safer and more reliable.
Why Use This Indicator:
The 4-hour time frame is ideal for traders who prefer swing trading or those looking to capture longer-term trends in a structured manner. This indicator provides crucial insights into market direction, support/resistance levels, and potential entry/exit points.
The stop-loss management based on the 15-minute support and resistance levels helps traders protect their positions from sudden price reversals, ensuring more precise risk management.
The fundamental news filter is particularly useful for avoidance of high-risk periods. By skipping setups during high-impact news events, traders can avoid entering trades when price volatility could be unpredictable.
Overall, this indicator is a powerful tool for traders who want to make data-driven decisions based on technical analysis while ensuring that their positions are managed responsibly and avoiding news-driven risk.
Dskyz Adaptive Futures Elite (DAFE)Dskyz Adaptive Futures Edge (DAFE)
imgur.com
A Dynamic Futures Trading Strategy
DAFE adapts to market volatility and price action using technical indicators and advanced risk management. It’s built for high-stakes futures trading (e.g., MNQ, BTCUSDT.P), offering modular logic for scalpers and swing traders alike.
Key Features
Adaptive Moving Averages
Dynamic Logic: Fast and slow SMAs adjust lengths via ATR, reacting to momentum shifts and smoothing in calm markets.
Signals: Long entry on fast SMA crossing above slow SMA with price confirmation; short on cross below.
RSI Filtering (Optional)
Momentum Check: Confirms entries with RSI crossovers (e.g., above oversold for longs). Toggle on/off with custom levels.
Fine-Tuning: Adjustable lookback and thresholds (e.g., 60/40) for precision.
Candlestick Pattern Recognition
Eng|Enhanced Detection: Identifies strong bullish/bearish engulfing patterns, validated by volume and range strength (vs. 10-period SMA).
Conflict Avoidance: Skips trades if both patterns appear in the lookback window, reducing whipsaws.
Multi-Timeframe Trend Filter
15-Minute Alignment: Syncs intrabar trades with 15-minute SMA trends; optional for flexibility.
Dollar-Cost Averaging (DCA) New!
Scaling: Adds up to a set number of entries (e.g., 4) on pullbacks/rallies, spaced by ATR multiples.
Control: Caps exposure and resets on exit, enhancing trend-following potential.
Trade Execution & Risk Management
Entry Rules: Prioritizes moving averages or patterns (user choice), with volume, volatility, and time filters.
Stops & Trails:
Initial Stop: ATR-based (2–3.5x, volatility-adjusted).
Trailing Stop: Locks profits with configurable ATR offset and multiplier.
Discipline
Cooldown: Pauses post-exit (e.g., 0–5 minutes).
Min Hold: Ensures trades last a set number of bars (e.g., 2–10).
Visualization & Tools
Charts: Overlays MAs, stops, and signals; trend shaded in background.
Dashboard: Shows position, P&L, win rate, and more in real-time.
Debugging: Logs signal details for optimization.
Input Parameters
Parameter Purpose Suggested Use
Use RSI Filter - Toggle RSI confirmation *Disable 4 price-only
trading
RSI Length - RSI period (e.g., 14) *7–14 for sensitivity
RSI Overbought/Oversold - Adjust for market type *Set levels (e.g., 60/40)
Use Candlestick Patterns - Enables engulfing signals *Disable for MA focus
Pattern Lookback - Pattern window (e.g., 19) *10–20 bars for balance
Use 15m Trend Filter - Align with 15-min trend *Enable for trend trades
Fast/Slow MA Length - Base MA lengths (e.g., 9/19) *10–25 / 30–60 per
timeframe
Volatility Threshold - Filters volatile spikes *Max ATR/close (e.g., 1%)
Min Volume - Entry volume threshold *Avoid illiquid periods
(e.g., 10)
ATR Length - ATR period (e.g., 14) *Standard volatility
measure
Trailing Stop ATR Offset - Trail distance (e.g., 0.5) *0.5–1.5 for tightness
Trailing Stop ATR Multi - Trail multiplier (e.g., 1.0) *1–3 for trend room
Cooldown Minutes - Post-exit pause (e.g., 0–5) *Prevents overtrading
Min Bars to Hold - Min trade duration (e.g., 2) *5–10 for intraday
Trading Hours - Active window (e.g., 9–16) *Focus on key sessions
Use DCA - Toggle DCA *Enable for scaling
Max DCA Entries - Cap entries (e.g., 4) *Limit risk exposure
DCA ATR Multiplier Entry spacing (e.g., 1.0) *1–2 for wider gaps
Compliance
Realistic Testing: Fixed quantities, capital, and slippage for accurate backtests.
Transparency: All logic is user-visible and adjustable.
Risk Controls: Cooldowns, stops, and hold periods ensure stability.
Flexibility: Adapts to various futures and timeframes.
Summary
DAFE excels in volatile futures markets with adaptive logic, DCA scaling, and robust risk tools. Currently in prop account testing, it’s a powerful framework for precision trading.
Caution
DAFE is experimental, not a profit guarantee. Futures trading risks significant losses due to leverage. Backtest, simulate, and monitor actively before live use. All trading decisions are your responsibility.
Intrinsic Event (Multi DC OS)Overview
This indicator implements an event-based approach to analyze price movements in the foreign exchange market, inspired by the intrinsic time framework introduced in Fractals and Intrinsic Time - A Challenge to Econometricians by U. A. Müller et al. (1995). It identifies significant price events using an intrinsic time perspective and supports multi-agent analysis to reflect the heterogeneous nature of financial markets. The script plots these events as lines and labels on the chart, offering a visual tool for traders to understand market dynamics at different scales.
Key Features
Intrinsic Events : The indicator detects directional change (DC) and overshoot (OS) events based on user-defined thresholds (delta), aligning with the paper’s concept of intrinsic time (Section 6). Intrinsic time redefines time based on market activity, expanding during volatile periods and contracting during inactive ones, rather than relying on a physical clock.
Multi-Agent Analysis : Supports up to five agents, each with its own threshold and color settings, reflecting the heterogeneous market hypothesis (Section 5). This allows the indicator to capture the perspectives of market participants with different time horizons, such as short-term FX dealers and long-term central banks.
How It Works
Intrinsic Events Detection : The script identifies two types of events using intrinsic time principles:
Directional Change (DC) : Triggered when the price reverses by the threshold (delta) against the current trend (e.g., a drop by delta in an uptrend signals a "Down DC").
Overshoot (OS) : Occurs when the price continues in the trend direction by the threshold (e.g., a rise by delta in an uptrend signals an "Up OS").
DC events are plotted as solid lines, and OS events as dashed lines, with labels like "Up DC" or "OS Down" for clarity. The label style adjusts based on the trend to ensure visibility.
Multi-Agent Setup : Each agent operates independently with its own threshold, mimicking market participants with varying time horizons (Section 5). Smaller thresholds detect frequent, short-term events, while larger thresholds capture broader, long-term movements.
Settings
Each agent can be configured with:
Enable Agent : Toggle the agent on or off.
Threshold (%) : The percentage threshold (delta) for detecting DC and OS events (default values: 0.1%, 0.2%, 0.5%, 1%, 2% for agents 1–5).
Up Mode Color : Color for lines and labels in up mode (DC events).
Down Mode Color : Color for lines and labels in down mode (OS events).
Usage Notes
This indicator is designed for the foreign exchange market, leveraging its high liquidity, as noted in the paper (Section 1). Adjust the threshold values based on the instrument’s volatility—higher volatility leads to more intrinsic events (Section 4). It can be adapted to other markets where event-based analysis applies.
Reference
The methodology is based on:
Fractals and Intrinsic Time - A Challenge to Econometricians by U. A. Müller, M. M. Dacorogna, R. D. Davé, O. V. Pictet, R. B. Olsen, and J. R. Ward (June 28, 1995). Olsen & Associates Preprint.
Failed Breakout DetectionThis indicator is a reverse-engineered copy of the FBD Detection indicator published by xfuturesgod. The original indicator aimed at detecting "Failed Breakdowns". This version tracks the opposite signals, "Failed Breakouts". It was coded with the ES Futures 15 minute chart in mind but may be useful on other instruments and time frames.
The original description, with terminology reversed to explain this version:
'Failed Breakouts' are a popular set up for short entries.
In short, the set up requires:
1) A significant high is made ('initial high')
2) Initial high is undercut with a new high
3) Price action then 'reclaims' the initial high by moving +8-10 points from the initial high
This script aims at detecting such set ups. It was coded with the ES Futures 15 minute chart in mind but may be useful on other instruments and time frames.
Business Logic:
1) Uses pivot highs to detect 'significant' initial highs
2) Uses amplitude threshold to detect a new high above the initial high; used /u/ben_zen script for this
3) Looks for a valid reclaim - a red candle that occurs within 10 bars of the new high
4) Price must reclaim at least 8 points for the set up to be valid
5) If a signal is detected, the initial high value (pivot high) is stored in array that prevents duplicate signals from being generated.
6) FBO Signal is plotted on the chart with "X"
7) Pivot high detection is plotted on the chart with "P" and a label
8) New highs are plotted on the chart with a red triangle
Notes:
User input
- My preference is to use the defaults as is, but as always feel free to experiment
- Can modify pivot length but in my experience 10/10 work best for pivot highs
- New high detection - 55 bars and 0.05 amplitude work well based on visual checks of signals
- Can modify the number of points needed to reclaim a high, and the # of bars limit over which this must occur.
Alerts:
- Alerts are available for detection of new highs and detection of failed breakouts
- Alerts are also available for these signals but only during 7:30PM-4PM EST - 'prime time' US trading hours
Limitations:
- Current version of the script only compares new highs to the most recent pivot high, does not look at anything prior to that
- Best used as a discretionary signal
Smarter Money Concepts - OBs [PhenLabs]📊 Smarter Money Concepts - OBs
Version: PineScript™ v6
📌 Description
Smarter Money Concepts - OBs (Order Blocks) is an advanced technical analysis tool designed to identify and visualize institutional order zones on your charts. Order blocks represent significant areas of liquidity where smart money has entered positions before major moves. By tracking these zones, traders can anticipate potential reversals, continuations, and key reaction points in price action.
This indicator incorporates volume filtering technology to identify only the most significant order blocks, eliminating low-quality signals and focusing on areas where institutional participation is likely present. The combination of price structure analysis and volume confirmation provides traders with high-probability zones that may attract future price action for tests, rejections, or breakouts.
🚀 Points of Innovation
Volume-Filtered Block Detection : Identifies only order blocks formed with significant volume, focusing on areas with institutional participation
Advanced Break of Structure Logic : Uses sophisticated price action analysis to detect legitimate market structure breaks preceding order blocks
Dynamic Block Management : Intelligently tracks, extends, and removes order blocks based on price interaction and time-based expiration
Structure Recognition System : Employs technical analysis algorithms to find significant swing points for accurate order block identification
Dual Directional Tracking : Simultaneously monitors both bullish and bearish order blocks for comprehensive market structure analysis
🔧 Core Components
Order Block Detection : Identifies institutional entry zones by analyzing price action before significant breaks of structure, capturing where smart money has likely positioned before moves.
Volume Filtering Algorithm : Calculates relative volume compared to a moving average to qualify only order blocks formed with significant market participation, eliminating noise.
Structure Break Recognition : Uses price action analysis to detect legitimate breaks of market structure, ensuring order blocks are identified only at significant market turning points.
Dynamic Block Management : Continuously monitors price interaction with existing blocks, extending, maintaining, or removing them based on current market behavior.
🔥 Key Features
Volume-Based Filtering : Filter out insignificant blocks by requiring a minimum volume threshold, focusing only on zones with likely institutional activity
Visual Block Highlighting : Color-coded boxes clearly mark bullish and bearish order blocks with customizable appearance
Flexible Mitigation Options : Choose between “Wick” or “Close” methods for determining when a block has been tested or mitigated
Scan Range Adjustment : Customize how far back the indicator looks for structure points to adapt to different market conditions and timeframes
Break Source Selection : Configure which price component (close, open, high, low) is used to determine structure breaks for precise block identification
🎨 Visualization
Bullish Order Blocks : Blue-colored rectangles highlighting zones where bullish institutional orders were likely placed before upward moves, representing potential support areas.
Bearish Order Blocks : Red-colored rectangles highlighting zones where bearish institutional orders were likely placed before downward moves, representing potential resistance areas.
Block Extension : Order blocks extend to the right of the chart, providing clear visualization of these significant zones as price continues to develop.
📖 Usage Guidelines
Order Block Settings
Scan Range : Default: 25. Defines how many bars the indicator scans to determine significant structure points for order block identification.
Bull Break Price Source : Default: Close. Determines which price component is used to detect bullish breaks of structure.
Bear Break Price Source : Default: Close. Determines which price component is used to detect bearish breaks of structure.
Visual Settings
Bullish Blocks Color : Default: Blue with 85% transparency. Controls the appearance of bullish order blocks.
Bearish Blocks Color : Default: Red with 85% transparency. Controls the appearance of bearish order blocks.
General Options
Block Mitigation Method : Default: Wick, Options: Wick, Close. Determines how block mitigation is calculated - “Wick” uses high/low values while “Close” uses close values for more conservative mitigation criteria.
Remove Filled Blocks : Default: Disabled. When enabled, order blocks are removed once they’ve been mitigated by price action.
Volume Filter
Volume Filter Enabled : Default: Enabled. When activated, only shows order blocks formed with significant volume relative to recent average.
Volume SMA Period : Default: 15, Range: 1-50. Number of periods used to calculate the average volume baseline.
Min. Volume Ratio : Default: 1.5, Range: 0.5-10.0. Minimum volume ratio compared to average required to display an order block; higher values filter out more blocks.
✅ Best Use Cases
Identifying high-probability support and resistance zones for trade entries and exits
Finding optimal stop-loss placement behind significant order blocks
Detecting potential reversal areas where price may react after extended moves
Confirming breakout trades when price clears major order blocks
Building a comprehensive market structure map for medium to long-term trading decisions
Pinpointing areas where smart money may have positioned before major market moves
⚠️ Limitations
Most effective on higher timeframes (1H and above) where institutional activity is more clearly defined
Can generate multiple signals in choppy market conditions, requiring additional filtering
Volume filtering relies on accurate volume data, which may be less reliable for some securities
Recent market structure changes may invalidate older order blocks not yet automatically removed
Block identification is based on historical price action and may not predict future behavior with certainty
💡 What Makes This Unique
Volume Intelligence : Unlike basic order block indicators, this script incorporates volume analysis to identify only the most significant institutional zones, focusing on quality over quantity.
Structural Precision : Uses sophisticated break of structure algorithms to identify true market turning points, going beyond simple price pattern recognition.
Dynamic Block Management : Implements automatic block tracking, extension, and cleanup to maintain a clean and relevant chart display without manual intervention.
Institutional Focus : Designed specifically to highlight areas where smart money has likely positioned, helping retail traders align with institutional perspectives rather than retail noise.
🔬 How It Works
1. Structure Identification Process :
The indicator continuously scans price action to identify significant swing points and structure levels within the specified range, establishing a foundation for order block recognition.
2. Break Detection :
When price breaks an established structure level (crossing below a significant low for bearish breaks or above a significant high for bullish breaks), the indicator marks this as a potential zone for order block formation.
3. Volume Qualification :
For each potential order block, the algorithm calculates the relative volume compared to the configured period average. Only blocks formed with volume exceeding the minimum ratio threshold are displayed.
4. Block Creation and Management :
Valid order blocks are created, tracked, and managed as price continues to develop. Blocks extend to the right of the chart until they are either mitigated by price action or expire after the designated timeframe.
5. Continuous Monitoring :
The indicator constantly evaluates price interaction with existing blocks, determining when blocks have been tested, mitigated, or invalidated, and updates the visual representation accordingly.
💡 Note:
Order Blocks represent areas where institutional traders have likely established positions and may defend these zones during future price visits. For optimal results, use this indicator in conjunction with other confluent factors such as key support/resistance levels, trendlines, or additional confirmation indicators. The most reliable signals typically occur on higher timeframes where institutional activity is most prominent. Start with the default settings and adjust parameters gradually to match your specific trading instrument and style.
Correlation Heatmap█ OVERVIEW
This indicator creates a correlation matrix for a user-specified list of symbols based on their time-aligned weekly or monthly price returns. It calculates the Pearson correlation coefficient for each possible symbol pair, and it displays the results in a symmetric table with heatmap-colored cells. This format provides an intuitive view of the linear relationships between various symbols' price movements over a specific time range.
█ CONCEPTS
Correlation
Correlation typically refers to an observable statistical relationship between two datasets. In a financial time series context, it usually represents the extent to which sampled values from a pair of datasets, such as two series of price returns, vary jointly over time. More specifically, in this context, correlation describes the strength and direction of the relationship between the samples from both series.
If two separate time series tend to rise and fall together proportionally, they might be highly correlated. Likewise, if the series often vary in opposite directions, they might have a strong anticorrelation . If the two series do not exhibit a clear relationship, they might be uncorrelated .
Traders frequently analyze asset correlations to help optimize portfolios, assess market behaviors, identify potential risks, and support trading decisions. For instance, correlation often plays a key role in diversification . When two instruments exhibit a strong correlation in their returns, it might indicate that buying or selling both carries elevated unsystematic risk . Therefore, traders often aim to create balanced portfolios of relatively uncorrelated or anticorrelated assets to help promote investment diversity and potentially offset some of the risks.
When using correlation analysis to support investment decisions, it is crucial to understand the following caveats:
• Correlation does not imply causation . Two assets might vary jointly over an analyzed range, resulting in high correlation or anticorrelation in their returns, but that does not indicate that either instrument directly influences the other. Joint variability between assets might occur because of shared sensitivities to external factors, such as interest rates or global sentiment, or it might be entirely coincidental. In other words, correlation does not provide sufficient information to identify cause-and-effect relationships.
• Correlation does not predict the future relationship between two assets. It only reflects the estimated strength and direction of the relationship between the current analyzed samples. Financial time series are ever-changing. A strong trend between two assets can weaken or reverse in the future.
Correlation coefficient
A correlation coefficient is a numeric measure of correlation. Several coefficients exist, each quantifying different types of relationships between two datasets. The most common and widely known measure is the Pearson product-moment correlation coefficient , also known as the Pearson correlation coefficient or Pearson's r . Usually, when the term "correlation coefficient" is used without context, it refers to this correlation measure.
The Pearson correlation coefficient quantifies the strength and direction of the linear relationship between two variables. In other words, it indicates how consistently variables' values move together or in opposite directions in a proportional, linear manner. Its formula is as follows:
𝑟(𝑥, 𝑦) = cov(𝑥, 𝑦) / (𝜎𝑥 * 𝜎𝑦)
Where:
• 𝑥 is the first variable, and 𝑦 is the second variable.
• cov(𝑥, 𝑦) is the covariance between 𝑥 and 𝑦.
• 𝜎𝑥 is the standard deviation of 𝑥.
• 𝜎𝑦 is the standard deviation of 𝑦.
In essence, the correlation coefficient measures the covariance between two variables, normalized by the product of their standard deviations. The coefficient's value ranges from -1 to 1, allowing a more straightforward interpretation of the relationship between two datasets than what covariance alone provides:
• A value of 1 indicates a perfect positive correlation over the analyzed sample. As one variable's value changes, the other variable's value changes proportionally in the same direction .
• A value of -1 indicates a perfect negative correlation (anticorrelation). As one variable's value increases, the other variable's value decreases proportionally.
• A value of 0 indicates no linear relationship between the variables over the analyzed sample.
Aligning returns across instruments
In a financial time series, each data point (i.e., bar) in a sample represents information collected in periodic intervals. For instance, on a "1D" chart, bars form at specific times as successive days elapse.
However, the times of the data points for a symbol's standard dataset depend on its active sessions , and sessions vary across instrument types. For example, the daily session for NYSE stocks is 09:30 - 16:00 UTC-4/-5 on weekdays, Forex instruments have 24-hour sessions that span from 17:00 UTC-4/-5 on one weekday to 17:00 on the next, and new daily sessions for cryptocurrencies start at 00:00 UTC every day because crypto markets are consistently open.
Therefore, comparing the standard datasets for different asset types to identify correlations presents a challenge. If two symbols' datasets have bars that form at unaligned times, their correlation coefficient does not accurately describe their relationship. When calculating correlations between the returns for two assets, both datasets must maintain consistent time alignment in their values and cover identical ranges for meaningful results.
To address the issue of time alignment across instruments, this indicator requests confirmed weekly or monthly data from spread tickers constructed from the chart's ticker and another specified ticker. The datasets for spreads are derived from lower-timeframe data to ensure the values from all symbols come from aligned points in time, allowing a fair comparison between different instrument types. Additionally, each spread ticker ID includes necessary modifiers, such as extended hours and adjustments.
In this indicator, we use the following process to retrieve time-aligned returns for correlation calculations:
1. Request the current and previous prices from a spread representing the sum of the chart symbol and another symbol ( "chartSymbol + anotherSymbol" ).
2. Request the prices from another spread representing the difference between the two symbols ( "chartSymbol - anotherSymbol" ).
3. Calculate half of the difference between the values from both spreads ( 0.5 * (requestedSum - requestedDifference) ). The results represent the symbol's prices at times aligned with the sample points on the current chart.
4. Calculate the arithmetic return of the retrieved prices: (currentPrice - previousPrice) / previousPrice
5. Repeat steps 1-4 for each symbol requiring analysis.
It's crucial to note that because this process retrieves prices for a symbol at times consistent with periodic points on the current chart, the values can represent prices from before or after the closing time of the symbol's usual session.
Additionally, note that the maximum number of weeks or months in the correlation calculations depends on the chart's range and the largest time range common to all the requested symbols. To maximize the amount of data available for the calculations, we recommend setting the chart to use a daily or higher timeframe and specifying a chart symbol that covers a sufficient time range for your needs.
█ FEATURES
This indicator analyzes the correlations between several pairs of user-specified symbols to provide a structured, intuitive view of the relationships in their returns. Below are the indicator's key features:
Requesting a list of securities
The "Symbol list" text box in the indicator's "Settings/Inputs" tab accepts a comma-separated list of symbols or ticker identifiers with optional spaces (e.g., "XOM, MSFT, BITSTAMP:BTCUSD"). The indicator dynamically requests returns for each symbol in the list, then calculates the correlation between each pair of return series for its heatmap display.
Each item in the list must represent a valid symbol or ticker ID. If the list includes an invalid symbol, the script raises a runtime error.
To specify a broker/exchange for a symbol, include its name as a prefix with a colon in the "EXCHANGE:SYMBOL" format. If a symbol in the list does not specify an exchange prefix, the indicator selects the most commonly used exchange when requesting the data.
Note that the number of symbols allowed in the list depends on the user's plan. Users with non-professional plans can compare up to 20 symbols with this indicator, and users with professional plans can compare up to 32 symbols.
Timeframe and data length selection
The "Returns timeframe" input specifies whether the indicator uses weekly or monthly returns in its calculations. By default, its value is "1M", meaning the indicator analyzes monthly returns. Note that this script requires a chart timeframe lower than or equal to "1M". If the chart uses a higher timeframe, it causes a runtime error.
To customize the length of the data used in the correlation calculations, use the "Max periods" input. When enabled, the indicator limits the calculation window to the number of periods specified in the input field. Otherwise, it uses the chart's time range as the limit. The top-left corner of the table shows the number of confirmed weeks or months used in the calculations.
It's important to note that the number of confirmed periods in the correlation calculations is limited to the largest time range common to all the requested datasets, because a meaningful correlation matrix requires analyzing each symbol's returns under the same market conditions. Therefore, the correlation matrix can show different results for the same symbol pair if another listed symbol restricts the aligned data to a shorter time range.
Heatmap display
This indicator displays the correlations for each symbol pair in a heatmap-styled table representing a symmetric correlation matrix. Each row and column corresponds to a specific symbol, and the cells at their intersections correspond to symbol pairs . For example, the cell at the "AAPL" row and "MSFT" column shows the weekly or monthly correlation between those two symbols' returns. Likewise, the cell at the "MSFT" row and "AAPL" column shows the same value.
Note that the main diagonal cells in the display, where the row and column refer to the same symbol, all show a value of 1 because any series of non-na data is always perfectly correlated with itself.
The background of each correlation cell uses a gradient color based on the correlation value. By default, the gradient uses blue hues for positive correlation, orange hues for negative correlation, and white for no correlation. The intensity of each blue or orange hue corresponds to the strength of the measured correlation or anticorrelation. Users can customize the gradient's base colors using the inputs in the "Color gradient" section of the "Settings/Inputs" tab.
█ FOR Pine Script® CODERS
• This script uses the `getArrayFromString()` function from our ValueAtTime library to process the input list of symbols. The function splits the "string" value by its commas, then constructs an array of non-empty strings without leading or trailing whitespaces. Additionally, it uses the str.upper() function to convert each symbol's characters to uppercase.
• The script's `getAlignedReturns()` function requests time-aligned prices with two request.security() calls that use spread tickers based on the chart's symbol and another symbol. Then, it calculates the arithmetic return using the `changePercent()` function from the ta library. The `collectReturns()` function uses `getAlignedReturns()` within a loop and stores the data from each call within a matrix . The script calls the `arrayCorrelation()` function on pairs of rows from the returned matrix to calculate the correlation values.
• For consistency, the `getAlignedReturns()` function includes extended hours and dividend adjustment modifiers in its data requests. Additionally, it includes other settings inherited from the chart's context, such as "settlement-as-close" preferences.
• A Pine script can execute up to 40 or 64 unique `request.*()` function calls, depending on the user's plan. The maximum number of symbols this script compares is half the plan's limit, because `getAlignedReturns()` uses two request.security() calls.
• This script can use the request.security() function within a loop because all scripts in Pine v6 enable dynamic requests by default. Refer to the Dynamic requests section of the Other timeframes and data page to learn more about this feature, and see our v6 migration guide to learn what's new in Pine v6.
• The script's table uses two distinct color.from_gradient() calls in a switch structure to determine the cell colors for positive and negative correlation values. One call calculates the color for values from -1 to 0 based on the first and second input colors, and the other calculates the colors for values from 0 to 1 based on the second and third input colors.
Look first. Then leap.
Multi-Timeframe Trend Analysis [BigBeluga]Multi-Timeframe Trend Analysis
A powerful trend-following dashboard designed to help traders monitor and compare trend direction across multiple higher timeframes. By analyzing EMA conditions from five customizable timeframes, this tool gives a clear visual breakdown of short- to long-term trend alignment.
🔵Key Features:
Multi-Timeframe EMA Dashboard:
➣ Displays a table in the top-right corner showing trend direction across 5 user-defined timeframes.
➣ Each row shows whether ema is rising or falling its corresponding EMA for that timeframe.
➣ Green arrows (🢁) indicate uptrends, purple arrows (🢃) signal downtrends.
Custom Timeframe Selection:
➣ Traders can input any 5 timeframes (e.g., 1h, 2h, 3h, etc.) with individual EMA lengths for flexible trend mapping.
➣ The tool auto-adjusts to match and align external timeframe EMAs to the current chart for seamless overlay.
Dynamic Chart Arrows:
➣ On-chart arrows mark when EMA rising or falling EMAs from the current chart timeframe.
➣ Each EMA arrows has a unique transparency level—shorter EMA arrows are more transparent, longer EMA arrows are more vivid. (Hover Mouse over the arrow to see which EMAs it is)
Gradient EMA Plotting:
➣ All five EMAs are plotted with gradually increasing opacity.
➣ Gradient fills between EMAs enhance visual structure, making it easier to track convergence/divergence.
🔵Usage:
Trend Confirmation: Use the dashboard to confirm multi-timeframe trend alignment before entering trades.
Entry Filtering: Avoid countertrend trades by spotting when higher timeframes disagree with the current one.
Momentum Insight: Track the transition of arrows from lighter to stronger opacity to visualize trend shifts over time.
Scalping or Swinging: Customize timeframes depending on your strategy—from intraday scalps to longer-term swings.
Multi-Timeframe Trend Analysis is the ultimate visual companion for traders who want clarity on how price behaves across multiple time horizons. With its smart EMA mapping and dashboard feedback, it keeps you aligned with dominant trend directions and transition zones at all times.
Pullback Entry Zone FinderPullback Entry Zone Finder
Overview:
This indicator is designed to help traders identify potential buying opportunities during short-term pullbacks, particularly when faster-moving averages show signs of converging back towards slower ones. It visually flags potential zones where price might find support and resume its upward movement, based on moving average dynamics and price proximity.
How It Works:
The indicator utilizes four customizable moving averages (Trigger, Short-term, Intermediate, and Long-term) and Average True Range (ATR) to pinpoint specific conditions:
Pullback Detection: It identifies when the fast 'Trigger MA' is below the 'Short-term MA', indicating a potential short-term pullback or consolidation phase.
MA Convergence: Crucially, it looks for signs that the pullback might be weakening by detecting when the gap between the Short-term MA and the Trigger MA is narrowing (maConverging). This suggests the faster average is starting to catch up, potentially preceding a move back up.
Base Buy Zone (Orange Diamond): This signal appears when both the Pullback and Convergence conditions are met simultaneously. It indicates the general area where conditions are becoming favourable for a potential entry.
Refined Entry Zones:
Prime Entry Zone (Green Diamond): This appears within a Base Buy Zone if the bar's low comes within a specified percentage (Max Distance %) of the Short-term MA. It suggests price has pulled back close to the dynamic support of the Short MA.
ATR Entry Zone (Purple Diamond): This appears within a Base Buy Zone if the bar's low comes within the specified percentage (Max Distance %) of an ATR-based target level. This target level (Buy ATR Target Level, plotted as a purple line when active) is calculated by adding a multiple (ATR Multiplier %) of the ATR to the Short-term MA, providing a volatility-adjusted potential entry area.
Visual Elements:
Moving Averages: Four lines representing the Trigger, Short-term, Intermediate, and Long-term MAs (colors and opacity are customizable). Use the Intermediate and Long-term MAs to gauge the broader market trend.
Orange Diamond (Below Bar): Indicates a 'Base Buy Zone' where a pullback and MA convergence are detected.
Green Diamond (Below Bar): Indicates a 'Prime Entry Zone' where price is close to the Short-term MA during a Base Buy Zone.
Purple Diamond (Below Bar): Indicates an 'ATR Entry Zone' where price is close to the ATR-based target level during a Base Buy Zone.
Purple Line: Plots the calculated 'Buy ATR Target Level' only when the Base Buy Zone condition is active.
Input Parameters:
Moving Averages: Customize the Length and Type (EMA, SMA, WMA, VWMA) for all four moving averages.
ATR Settings: Adjust the ATR Length, the ATR Multiplier % (for calculating the target level), and the Max Distance % (for triggering the Prime and ATR Entry Zones).
Visualization: Set the colors for the four Moving Average lines.
How to Use:
Look for the Orange Diamond as the initial signal that pullback/convergence conditions are met.
The Green and Purple Diamonds suggest price has reached potentially more optimal entry levels within that zone, based on proximity to the Short MA or the ATR target, respectively.
Always consider the signals within the context of the broader trend, indicated by the Intermediate and Long-term MAs. This indicator is generally more effective when used to find entries during pullbacks within an established uptrend (e.g., Intermediate MA > Long MA).
Combine these signals with other forms of analysis, such as chart patterns, support/resistance levels, volume analysis, or other indicators for confirmation.
Disclaimer:
You should always use proper risk management techniques and conduct your own analysis before making any trading decisions. This indicator, or any other, will be of no use if you don't have good risk management.