Supertrend + MACD Trend Change with AlertsDetailed Guide
1. Indicator Overview
Purpose:
This script combines the Supertrend and MACD indicators to help you detect potential trend changes. It plots a Supertrend line (green for bullish, red for bearish) and marks the chart with shapes when a trend reversal is signaled by both indicators. In addition, it includes alert conditions so that you can be notified when a potential trend change occurs.
How It Works:
Supertrend: Uses the Average True Range (ATR) to determine dynamic support and resistance levels. When the price crosses these levels, it signals a possible change in trend.
MACD: Focuses on the crossover between the MACD line and the signal line. A bullish crossover (MACD line crossing above the signal line) suggests upward momentum, while a bearish crossover (MACD line crossing below the signal line) suggests downward momentum.
2. Supertrend Component
Key Parameters:
Factor:
Function: Multiplies the ATR to create an offset from the mid-price (hl2).
Adjustment Impact: Lower values make the indicator more sensitive (producing more frequent signals), while higher values result in fewer, more confirmed signals.
ATR Period:
Function: Sets the number of bars over which the ATR is calculated.
Adjustment Impact: A shorter period makes the ATR react more quickly to recent price changes (but can be noisy), whereas a longer period provides a smoother volatility measurement.
Trend Calculation:
The script compares the previous close with the dynamically calculated upper and lower bands. If the previous close is above the upper band, the trend is set to bullish (1); if it’s below the lower band, the trend is bearish (-1). The Supertrend line is then plotted in green for bullish trends and red for bearish trends.
3. MACD Component
Key Parameters:
Fast MA (Fast Moving Average):
Function: Represents a shorter-term average, making the MACD line more sensitive to recent price movements.
Slow MA (Slow Moving Average):
Function: Represents a longer-term average to smooth out the MACD line.
Signal Smoothing:
Function: Defines the period for the signal line, which is a smoothed version of the MACD line.
Crossover Logic:
The script uses the crossover() function to detect when the MACD line crosses above the signal line (bullish crossover) and crossunder() to detect when it crosses below (bearish crossover).
4. Combined Signal Logic
How Signals Are Combined:
Bullish Scenario:
When the MACD shows a bullish crossover (MACD line crosses above the signal line) and the Supertrend indicates a bullish trend (green line), a green upward triangle is plotted below the bar.
Bearish Scenario:
When the MACD shows a bearish crossover (MACD line crosses below the signal line) and the Supertrend indicates a bearish trend (red line), a red downward triangle is plotted above the bar.
Rationale:
By combining the signals from both indicators, you increase the likelihood that the detected trend change is reliable, filtering out some false signals.
5. Alert Functionality
Alert Setup in the Code:
The alertcondition() function is used to define conditions under which TradingView can trigger alerts.
There are two alert conditions:
Bullish Alert: Activated when there is a bullish MACD crossover and the Supertrend confirms an uptrend.
Bearish Alert: Activated when there is a bearish MACD crossover and the Supertrend confirms a downtrend.
What Happens When an Alert Triggers:
When one of these conditions is met, TradingView registers the alert condition. You can then create an alert in TradingView (using the alert dialog) and choose one of these alert conditions. Once set up, you’ll receive notifications (via pop-ups, email, or SMS, depending on your settings) whenever a trend change is signaled.
6. User Adjustments and Their Effects
Factor (Supertrend):
Adjustment: Lowering the factor increases sensitivity, resulting in more frequent signals; raising it will filter out some signals, making them potentially more reliable.
ATR Period (Supertrend):
Adjustment: A shorter ATR period makes the indicator more responsive to recent price movements (but can introduce noise), while a longer period smooths out the response.
MACD Parameters (Fast MA, Slow MA, and Signal Smoothing):
Adjustment:
Shortening the Fast MA increases sensitivity, generating earlier signals that might be less reliable.
Lengthening the Slow MA produces a smoother MACD line, reducing noise.
Adjusting the Signal Smoothing changes how quickly the signal line responds to changes in the MACD line.
7. Best Practices and Considerations
Multiple Confirmation:
Even if both indicators signal a trend change, consider confirming with additional analysis such as volume, price action, or other indicators.
Market Conditions:
These indicators tend to perform best in trending markets. In sideways or choppy conditions, you may experience more false alerts.
Backtesting:
Before applying the indicator in live trading, backtest your settings to ensure they suit your trading style and the market conditions.
Risk Management:
Always use proper risk management, including stop-loss orders and appropriate position sizing, as alerts may occasionally produce late or false signals.
Happy trading!
Indicateurs et stratégies
Stock Earnings Viewer for Pine ScreenerThe script, titled "Stock Earnings Viewer with Surprise", fetches actual and estimated earnings, calculates absolute and percent surprise values, and presents them for analysis. It is intended to use in Pine Screener, as on chart it is redundant.
How to Apply to Pine Screener
Favorite this script
Open pine screener www.tradingview.com
Select "Stock Earnings Viewer with Surprise" in "Choose indicator"
Click "Scan"
Data
Actual Earnings: The reported earnings per share (EPS) for the stock, sourced via request.earnings().
Estimated Earnings: Analyst-predicted EPS, accessed with field=earnings.estimate.
Absolute Surprise: The difference between actual and estimated earnings (e.g., actual 1.2 - estimated 1.0 = 0.2).
Percent Surprise (%): The absolute surprise as a percentage of estimated earnings (e.g., (0.2 / 1.0) * 100 = 20%). Note: This may return NaN or infinity if estimated earnings are zero, due to division by zero.
Practical Use
This screener script allows users to filter stocks based on earnings metrics. For example, you could screen for stocks where Percent Surprise > 15 to find companies exceeding analyst expectations significantly, or use Absolute Surprise < -0.5 to identify underperformers.
Gradient Trend Filter [ChartPrime]The Gradient Trend Filter is a dynamic trend analysis tool that combines a noise-filtered trend detection system with a color-gradient cloud. It provides traders with a visual representation of trend strength, momentum shifts, and potential reversals.
⯁ KEY FEATURES
Trend Noise Filtering
Uses an advanced smoothing function to filter market noise and produce a more reliable trend representation.
// Noise filter function
noise_filter(src, length) =>
alpha = 2 / (length + 1)
nf_1 = 0.0
nf_2 = 0.0
nf_3 = 0.0
nf_1 := (alpha * src) + ((1 - alpha) * nz(nf_1 ))
nf_2 := (alpha * nf_1) + ((1 - alpha) * nz(nf_2 ))
nf_3 := (alpha * nf_2) + ((1 - alpha) * nz(nf_3 ))
nf_3 // Final output with three-stage smoothing
Color-Based Trend Visualization
The mid-line changes color based on trend direction—green for uptrends and red for downtrends—making it easy to identify trends at a glance.
Orange diamond markers appear when a trend shift is confirmed, providing actionable signals for traders.
Gradient Color Trend Cloud
A cloud around the base trend line that dynamically changes color, often signaling trend shifts ahead of the main trend line.
When in a downtrend, if the cloud starts turning green, it suggests weakening bearish momentum or an upcoming bullish reversal. Conversely, when in an uptrend, a red cloud indicates potential trend weakening or a bearish reversal.
Multi-Layered Trend Bands
The cloud consists of multiple bands, offering a range of support and resistance zones that traders can use for confluence in decision-making.
⯁ HOW TO USE
Identify Trend Strength & Reversals
Use the mid-line and cloud color changes to assess the strength of a trend and spot early signs of reversals.
Monitor Momentum Shifts
Watch for gradient cloud color shifts before the trend line changes color, as this can indicate early weakening or strengthening of momentum.
Act on Trend Shift Markers
Use the orange diamonds as confirmation of trend shifts and potential trade entry or exit points.
Utilize Cloud Bands as Support/Resistance
The outer bands of the cloud act as dynamic support and resistance, helping traders refine their stop-loss and take-profit placements.
⯁ CONCLUSION
The Gradient Trend Filter is an advanced trend detection tool designed for traders looking to anticipate trend shifts with greater precision. By integrating a noise-filtered trend line with a gradient-based trend cloud, this indicator enhances traders' ability to navigate market trends effectively.
MACD Highs and Lows - Dynamic Support & ResistanceDescription:
Enhance your trading strategy with the MACD Highs and Lows indicator, designed to identify dynamic support and resistance levels based on MACD crossovers. This tool plots key price levels triggered by shifts in MACD momentum, helping traders spot potential reversal zones, breakout points, and trend confirmation signals.
Key Features
Dynamic Levels: Automatically plots recent highs/lows when MACD crosses above/below the zero line.
Customizable MACD Parameters:
Adjustable fast/slow lengths (default: 12/26).
Choose between SMA or EMA for oscillator/signal line.
Flexible signal smoothing (1-50 periods).
Visual Clarity:
Clear green/red lines for highs and lows.
Tracks both price extremes and adjacent candle levels (e.g., high-of-low-bar, low-of-high-bar).
Multi-Timeframe Utility: Works across charts for swing trading, scalping, or trend analysis.
How It Works
Bullish Signal: When MACD crosses above zero, the indicator marks the recent lowest low (support) and its corresponding high.
Bearish Signal: When MACD crosses below zero, it plots the recent highest high (resistance) and its corresponding low.
Levels persist until the next crossover, creating actionable reference zones.
Use Cases
Trend Confirmation: Validate breakouts when price closes above/below plotted levels.
Stop Loss Placement: Set stops beyond recent dynamic highs/lows.
Divergence Detection: Spot discrepancies between MACD momentum and price action.
Settings Tips:
Increase Fast Length for responsiveness or Slow Length for smoother signals.
Use EMA for faster reactions, SMA for reduced noise.
Intrabar Volume Distribution [BigBeluga]Intrabar Volume Distribution is an advanced volume and order flow indicator that visualizes the buy and sell volume distribution within each candlestick.
🔔 Before Use:
Turn off the background color of your candles for clear visibility.
Overlay the indicator on the top layout to ensure accurate alignment with the price chart.
🔵 Key Features:
Inside Bar Volume Visualization:
Each candlestick is divided into two columns:
Left column displays the sell % volume amount.
Right column displays the buy % volume amount.
Provides a clear representation of buyer-seller activity within individual bars.
Percentage Volume Labels:
Labels above each bar show the percentage share of sell and buy volume relative to the total (100%).
Quickly assess market sentiment and volume imbalances.
Point of Control (POC) Levels:
Orange dashed lines mark the POC inside each bar, indicating the price level with the highest traded volume.
Helps identify key liquidity zones within individual candlesticks.
Multi-Timeframe Volume Analysis:
The indicator automatically uses a timeframe 20-30 times lower than the current one to gather detailed volume data.
For each higher timeframe candle, it collects 20-30 bars of lower timeframe data for precise volume mapping.
Each bar is divided into 100 volume bins to capture detailed volume distribution across the price range.
Bins are filled based on the aggregated volume from the lower timeframe data.
Lookback Period:
Allows traders to select how many bars to display with delta and volume information.
The beginning of the selected lookback period is marked with a gray line and label for quick reference.
Indicator displays up to 80 bars back
🔵 Usage:
Order Flow Analysis: Monitor buy/sell volume distribution to spot potential reversals or continuations.
Liquidity Identification: Use POC levels to locate areas of strong market interest and potential support/resistance.
Volume Imbalance Detection: Pay attention to percentage labels for quick recognition of buyer or seller dominance.
Scalping & Intraday Trading: Ideal for traders seeking real-time insight into order flow and volume behavior.
Historical Analysis: Adjust the lookback period to analyze past price action and volume activity.
Intrabar Volume Distribution is a powerful tool for traders aiming to gain deeper insight into market sentiment through detailed volume analysis, allowing for more informed trading decisions based on real-time order flow dynamics.
DynamicMALibrary "DynamicMA"
Dynamic Moving Averages Library
Introduction
The Dynamic Moving Averages Library is a specialized collection of custom built functions designed to calculate moving averages dynamically, beginning from the first available bar. Unlike standard moving averages, which rely on fixed length lookbacks, this library ensures that indicators remain fully functional from the very first data point, making it an essential tool for analysing assets with short time series or limited historical data.
This approach allows traders and developers to build robust indicators that do not require a preset amount of historical data before generating meaningful outputs. It is particularly advantageous for:
Newly listed assets with minimal price history.
High-timeframe trading, where large lookback periods can lead to delayed or missing data.
By eliminating the constraints of fixed lookback periods, this library enables the seamless construction of trend indicators, smoothing functions, and hybrid models that adapt instantly to market conditions.
Comprehensive Set of Custom Moving Averages
The library includes a wide range of custom dynamic moving averages, each designed for specific analytical use cases:
SMA (Simple Moving Average) – The fundamental moving average, dynamically computed.
EMA (Exponential Moving Average) – Adaptive smoothing for better trend tracking.
DEMA (Double Exponential Moving Average) – Faster trend detection with reduced lag.
TEMA (Triple Exponential Moving Average) – Even more responsive than DEMA.
WMA (Weighted Moving Average) – Emphasizes recent price action while reducing noise.
VWMA (Volume Weighted Moving Average) – Accounts for volume to give more weight to high-volume periods.
HMA (Hull Moving Average) – A superior smoothing method with low lag.
SMMA (Smoothed Moving Average) – A hybrid approach between SMA and EMA.
LSMA (Least Squares Moving Average) – Uses linear regression for trend detection.
RMA (Relative Moving Average) – Used in RSI-based calculations for smooth momentum readings.
ALMA (Arnaud Legoux Moving Average) – A Gaussian-weighted MA for superior signal clarity.
Hyperbolic MA (HyperMA) – A mathematically optimized averaging method with dynamic weighting.
Each function dynamically adjusts its calculation length to match the available bar count, ensuring instant functionality on all assets.
Fully Optimized for Pine Script v6
This library is built on Pine Script v6, ensuring compatibility with modern TradingView indicators and scripts. It includes exportable functions for seamless integration into custom indicators, making it easy to develop trend-following models, volatility filters, and adaptive risk-management systems.
Why Use Dynamic Moving Averages?
Traditional moving averages suffer from a common limitation: they require a fixed historical window to generate meaningful values. This poses several problems:
New Assets Have No Historical Data - If an asset has only been trading for a short period, traditional moving averages may not be able to generate valid signals.
High Timeframes Require Massive Lookbacks - On 1W or 1M charts, a 200-period SMA would require 200 weeks or months of data, making it unusable on newer assets.
Delayed Signal Initialization - Standard indicators often take dozens of bars to stabilize, reducing effectiveness when trading new trends.
The Dynamic Moving Averages Library eliminates these issues by ensuring that every function:
Starts calculation from bar one, using available data instead of waiting for a lookback period.
Adapts dynamically across timeframes, making it equally effective on low or high timeframes.
Allows smoother, more responsive trend tracking, particularly useful for volatile or low-liquidity assets.
This flexibility makes it indispensable for custom script developers, quantitative analysts, and discretionary traders looking to build more adaptive and resilient indicators.
Final Summary
The Dynamic Moving Averages Library is a versatile and powerful set of functions designed to overcome the limitations of fixed-lookback indicators. By dynamically adjusting the calculation length from the first bar, this library ensures that moving averages remain fully functional across all timeframes and asset types, making it an essential tool for traders and developers alike.
With built-in adaptability, low-lag smoothing, and support for multiple moving average types, this library unlocks new possibilities for quantitative trading and strategy development - especially for assets with short price histories or those traded on higher timeframes.
For traders looking to enhance signal reliability, minimize lag, and build adaptable trading systems, the Dynamic Moving Averages Library provides an efficient and flexible solution.
SMA(sourceData, maxLength)
Dynamic SMA
Parameters:
sourceData (float)
maxLength (int)
EMA(src, length)
Dynamic EMA
Parameters:
src (float)
length (int)
DEMA(src, length)
Dynamic DEMA
Parameters:
src (float)
length (int)
TEMA(src, length)
Dynamic TEMA
Parameters:
src (float)
length (int)
WMA(src, length)
Dynamic WMA
Parameters:
src (float)
length (int)
HMA(src, length)
Dynamic HMA
Parameters:
src (float)
length (int)
VWMA(src, volsrc, length)
Dynamic VWMA
Parameters:
src (float)
volsrc (float)
length (int)
SMMA(src, length)
Dynamic SMMA
Parameters:
src (float)
length (int)
LSMA(src, length, offset)
Dynamic LSMA
Parameters:
src (float)
length (int)
offset (int)
RMA(src, length)
Dynamic RMA
Parameters:
src (float)
length (int)
ALMA(src, length, offset_sigma, sigma)
Dynamic ALMA
Parameters:
src (float)
length (int)
offset_sigma (float)
sigma (float)
HyperMA(src, length)
Dynamic HyperbolicMA
Parameters:
src (float)
length (int)
Hidden Order BlockThe Crystal Order Block Indicator is designed to help traders identify institutional order blocks with precision and reliability. By analyzing price action and volume behavior, this tool highlights high-probability zones where smart money has likely placed orders.
🔹 Key Features:
✅ Automated Order Block Detection – Identifies valid bullish & bearish order blocks based on price structure and volume dynamics.
✅ Unmitigated Order Block Filtering – Highlights fresh order blocks that haven’t been tapped, helping traders find high-probability trade setups.
✅ Smart Money Concepts (SMC) & ICT-Based Logic – Uses institutional trading principles to refine entry and exit points.
✅ Multi-Timeframe Compatibility – Works effectively on all timeframes, making it suitable for scalping, intraday, and swing trading.
✅ Customizable Alerts – Stay notified when a new order block forms, ensuring you never miss an opportunity.
✅ Risk Management Enhancement – Helps traders set precise stop-loss and take-profit levels based on institutional trading zones.
📌 How It Works:
The indicator scans price movements and detects areas where significant buying or selling pressure occurred, forming institutional order blocks. It then checks for mitigated vs. unmitigated order blocks, ensuring only the most relevant zones are displayed.
✔️ Bullish Order Blocks: Marked when a strong buying zone is detected, often acting as support.
✔️ Bearish Order Blocks: Identified in areas of strong selling pressure, often acting as resistance.
The indicator is optimized for Smart Money trading strategies, making it a valuable tool for traders who follow ICT, SMC, and VSA concepts.
🎯 How to Use It Effectively:
🔹 Entry Strategy: Wait for price to retest a fresh order block and confirm entry with additional confluences (e.g., volume spikes, price action signals).
🔹 Exit Strategy: Use order blocks as take-profit targets or stop-loss levels, improving risk-reward ratios.
🔹 Timeframe Recommendation: Best results on M30 and higher, but can be used on lower timeframes with additional confirmations.
🚀 What’s New in the Updated Version?
🔹 More Accurate Order Block Detection – Improved filtering for better precision.
🔹 Mitigation Tracking – Helps traders focus on fresh order blocks for higher success rates.
🔹 Better Visualization – Enhanced clarity for quick decision-making.
This indicator is a must-have for traders who want to trade like institutions and refine their trading strategy using smart money concepts.
Market DNA: Structure, Volume, Range, and SessionsMarket DNA: Structure, Volume, Range, and Sessions**
The Market DNA indicator combines market structure, volume analysis, trading ranges, and global trading sessions into a single, comprehensive tool for traders. It helps identify key price levels, volume patterns, consolidation phases, and active market periods, enabling informed trading decisions.
Market Structure Detects swing highs and lows using `ta.pivothigh` and `ta.pivotlow`, plotting them as red/green triangles to highlight support/resistance and trend reversals.
- Fractal Volume Zones (FVG): Highlights areas of significant buying/selling pressure by comparing current volume to an average over a lookback period; high-volume zones are marked with a semi-transparent blue background.
- Trading Range: Defines a price channel using the Average True Range (ATR) and a multiplier, creating upper/lower bands to identify consolidation, breakouts, and potential trade levels.
- Market Sessions: Highlights major global trading sessions (Asia, Europe, US) with colored backgrounds (purple, teal, yellow) to indicate liquidity and volatility shifts.
How It Works
- Swing points help analyze trends and reversals.
- FVG confirms price movements with high volume for stronger signals.
- Trading range bands assist in identifying breakout opportunities and setting stops/take-profits.
- Session highlights allow traders to adapt strategies based on regional activity.
Customization
- Adjust `swing_length` for sensitivity in detecting turning points.
- Modify `volume_lookback` to control volume averaging.
- Tune `range_multiplier` for wider/narrower trading bands.
- Enable/disable session highlighting via `session_highlight`.
Use Cases
- Identify trends and key levels using swing points and FVG.
- Spot breakout opportunities with trading range bands.
- Adapt strategies to regional trading sessions for optimal timing.
This all-in-one indicator provides a clear, customizable view of the market, empowering traders to make data-driven decisions across asset classes and timeframes.
CountdownsDisplays a table of countdowns of the current bar on different time frames.
It shows how much time is left until candle close if we were to change the chart to that time frame, but without the need to do so.
An adaptation of 'Countdown Candle RRS' by reza9300 (), including up to 10 customizable time frames, plus some additional table styling options.
Usage:
Add the indicator to your chart to see a table of countdown timers.
Adjust the settings to customize the appearance and to check / uncheck which time frames to include.
Notes:
Updates are based on price changes, so counters may appear 'frozen' or 'lagging' when there is no real time tick update in price.
Crystal Cloud EMA# Crystal Cloud EMA Indicator 🚀
The **Crystal Cloud EMA Indicator** is a hybrid technical analysis tool that uniquely merges the multi-dimensional perspective of the Ichimoku Cloud with the precision of EMA crossovers (EMA 50 & EMA 200). This integration is designed to help traders identify key market trends, dynamic support and resistance zones, and potential momentum shifts with enhanced clarity and reliability.
---
## Key Components & Originality
### Ichimoku Cloud
- **Dynamic Support & Resistance:**
Utilizes standard Ichimoku calculations to form a cloud (Kumo) that highlights areas where price may find support or resistance.
- **Visual Clarity:**
The cloud’s upper and lower boundaries provide clear visual cues of market sentiment, helping to identify potential reversal or consolidation zones.
### EMA 50 & EMA 200
- **Trend Confirmation:**
These exponential moving averages smooth price data to reveal underlying trends.
- **Crossover Signals:**
A crossover of EMA 50 and EMA 200 is used as a signal confirmation—when EMA 50 crosses above EMA 200, it suggests a bullish trend; when it crosses below, it indicates a bearish trend.
### Unique Integration
- **Combined Analysis for Enhanced Accuracy:**
By fusing the Ichimoku Cloud’s dynamic support/resistance zones with the precise timing of EMA crossovers, the indicator minimizes false signals.
- **Confluence of Methods:**
Only when both the cloud position and EMA crossover align does the indicator generate a trading signal, offering a more robust framework than using either method in isolation.
---
## How It Works
1. **Cloud Evaluation:**
- The indicator calculates the Ichimoku Cloud using traditional parameters, establishing dynamic zones where price reactions are likely.
- It monitors how price interacts with these zones, signaling potential momentum shifts when the price moves in or out of the cloud.
2. **EMA Crossover Analysis:**
- Simultaneously, it computes EMA 50 and EMA 200.
- **Bullish Condition:** When price is above the cloud and EMA 50 crosses above EMA 200.
- **Bearish Condition:** When price is below the cloud and EMA 50 crosses below EMA 200.
3. **Signal Confirmation:**
- A breakout from the cloud, in conjunction with a crossover, further validates the strength of the trend.
- This dual confirmation approach filters out market noise and increases the reliability of the signals.
---
## Trading Strategy & Usage
### Buy Signal
- **Conditions:**
- Price is trading above the Ichimoku Cloud.
- EMA 50 crosses above EMA 200.
- A confirmed breakout above the cloud supports the bullish trend.
- **Application:**
- Enter long positions when these conditions align.
- Use the cloud’s lower boundary for potential stop-loss placement and set profit targets based on key resistance levels identified by the cloud.
### Sell Signal
- **Conditions:**
- Price is trading below the Ichimoku Cloud.
- EMA 50 crosses below EMA 200.
- A breakdown below the cloud reinforces the bearish trend.
- **Application:**
- Enter short positions under these conditions.
- Use the cloud’s upper boundary as a reference for setting stop-loss orders and profit targets.
### Best Timeframes & Trading Styles
- **Timeframes:**
Optimally used on M30 and higher timeframes to ensure trend reliability and reduce market noise.
- **Trading Styles:**
Suitable for swing trading, intraday trading, and momentum-based strategies.
- **Risk Management:**
Always complement indicator signals with additional analysis (like volume or price action) and apply proper risk management techniques.
---
## Important Note
This indicator is a **technical analysis tool** designed to assist traders in identifying market trends and potential reversal points. It should be used in conjunction with comprehensive market analysis and proper risk management. Trading decisions should not rely solely on this indicator.
Bar Color - Moving Average Convergence Divergence [nsen]The Pine Script you've provided creates a custom indicator that utilizes the MACD (Moving Average Convergence Divergence) and displays various outputs, such as bar color changes based on MACD signals, and a table of data from multiple timeframes. Here's a breakdown of how the script works:
1. Basic Settings (Input)
• The script defines several user-configurable parameters, such as the MACD values, bar colors, the length of the EMA (Exponential Moving Average) periods, and signal smoothing.
• Users can also choose timeframes to analyze the MACD values, like 5 minutes, 15 minutes, 1 hour, 4 hours, and 1 day.
2. MACD Calculation
• It uses the EMA of the close price to calculate the MACD value, with fast_length and slow_length representing the fast and slow periods. The signal_length is used to calculate the Signal Line.
• The MACD value is the difference between the fast and slow EMA, and the Signal Line is the EMA of the MACD.
• The Histogram is the difference between the MACD and the Signal Line.
3. Plotting the Histogram
• The Histogram values are plotted with colors that change based on the value. If the Histogram is positive (rising), it is colored differently than if it's negative (falling). The colors are determined by the user inputs, for example, green for bullish (positive) signals and red for bearish (negative) signals.
4. Bar Coloring
• The bar color changes based on the MACD's bullish or bearish signal. If the MACD is bullish (MACD > Signal), the bar color will change to the color defined for bullish signals, and if it's bearish (MACD < Signal), the bar color will change to the color defined for bearish signals.
5. Multi-Timeframe Data Table
• The script includes a table displaying the MACD trend for different timeframes (e.g., 5m, 15m, 1h, 4h, 1d).
• Each timeframe will show a colored indicator: green (🟩) for bullish and red (🟥) for bearish, with the background color changing based on the trend.
6. Alerts
• The script has alert conditions to notify the user when the MACD shows a bullish or bearish entry:
• Bullish Entry: When the MACD turns bullish (crosses above the Signal Line).
• Bearish Entry: When the MACD turns bearish (crosses below the Signal Line).
• Alerts are triggered with custom messages such as "🟩 MACD Bullish Entry" and "🟥 MACD Bearish Entry."
Key Features:
• Customizable Inputs: Users can adjust the MACD settings, histogram colors, and timeframe options.
• Visual Feedback: The color changes of the histogram and bars provide instant visual cues for bullish or bearish trends.
• Multi-Timeframe Analysis: The table shows the MACD trend across multiple timeframes, helping traders monitor trends in different timeframes.
• Alert Conditions: Alerts notify users when key MACD crossovers occur.
Astro R4.0Regarding the code that has a significant impact on Pine Community and many feel helped by it, this is the code that I ported from VBA to PineScript which comes from simontelescopium owner of astroexcel dot wordpress dot com and "astrofnc" by Keith Burnett, previously I used it personally but I forgot to give a citation to those who are entitled to them both so that when I shared it for community use and it has been shared by brother @BarefootJoey with the additions made by him personally, there was no citation for them.
Apologies for my negligence because I am only human.
Hopefully with this script it can help the community to see the potential for implementation in the trading world as a significant variable.
Finally, I publish this script as a reference to find out astronomical charts presented in table form to make it easier to visualize and debug as long as the input.timestamp() allow it.
Future updates for optimization using library of brother @BarefootJoey
Thank you.
3 Red / 3 Green Strategy with Volatility CheckStrategy Name: 3 Red / 3 Green Strategy with Volatility Check by AlgoTradeKit
Overview
This long-only strategy is designed for daily bars on NASDAQ (or similar instruments) and combines simple price action with a volatility filter. It “tells it like it is” – enter when the market shows weakness, but only in sufficiently volatile conditions, and exit either on signs of a reversal or after a set number of days.
Entry Conditions
- Price Action :
Enter a long position when there are 3 consecutive red days (each day's close is below its open).
- Volatility Filter :
The entry is allowed only if the current ATR (Average True Range) calculated over the specified ATR Period (default 12) is greater than its 30-day simple moving average. This ensures the market has enough volatility to justify the trade.
Exit Conditions
- Reversal Signal :
Exit the long position when 3 consecutive green days occur (each day's close is above its open), signaling a potential reversal.
- Time Limit :
Regardless of market conditions, any open trade is closed if it reaches the Maximum Trade Duration (default 22 days). This helps limit exposure during stagnant or unfavorable market conditions.
- You can toggle the three-green-day exit if you want to isolate the time-based exit.
Input Parameters
- Maximum Trade Duration (days): Default is 22 days.
- ATR Period: Default is 12.
- Use 3 Green Days Exit: Toggle to enable or disable the three-green-day exit condition.
How It Works
1. Entry: The strategy monitors daily price action for 3 consecutive down days. When this occurs and if the market is volatile enough (current ATR > 30-day ATR average), it opens a long position.
2. Exit: The position is closed if the price action reverses with 3 consecutive up days or if the trade has been open for the maximum allowed duration - i.e. use it on daily chart.
Risk Management
- The built-in maximum trade duration prevents trades from lingering too long in a non-trending or consolidating market.
- The volatility filter helps ensure that trades are only taken when there is sufficient price movement, potentially increasing the odds of a meaningful move.
Disclaimer
This strategy is provided “as is” without any warranties. It is essential to backtest and validate the performance on your specific instrument and market conditions before deploying live capital. Trading involves significant risk, and you should adjust parameters to match your risk tolerance.
Test and tweak this strategy to see if it fits your trading style and market conditions. Happy trading!
Pre-London High-Low Breakout IndicatorOverview
The Pre-London High-Low Breakout Indicator helps traders identify breakout opportunities at the London session open. It marks the high and low one hour before London opens (5 PM - 6 PM AEST) and incorporates a 200 SMA filter to confirm trade direction. The indicator also provides real-time breakout markers for precise entries.
How the Indicator Works
1. Pre-London High & Low Identification (5 PM - 6 PM AEST)
The indicator tracks the highest and lowest price levels within this period.
These levels act as key breakout zones once London opens.
The high and low remain visible until 12 AM AEST for reference.
2. 200 SMA as a Trend Filter
A 200 SMA (yellow, thick line) is plotted to filter breakout trades.
Only long (buy) trades are valid if price is above the 200 SMA.
Only short (sell) trades are valid if price is below the 200 SMA.
3. Real-Time Breakout Confirmation
Buy Signal (Green Diamond):
Price breaks above the pre-London high.
Price is above the 200 SMA.
Sell Signal (Red Diamond):
Price breaks below the pre-London low.
Price is below the 200 SMA.
No signal appears if the breakout is against the SMA trend, reducing false trades.
How to Use the Indicator Properly
Step 1: Identify the Pre-London Range (5 PM - 6 PM AEST)
Observe price movements and note the session high & low.
Do not take trades within this period—wait for a clear breakout.
Step 2: Wait for a Breakout After 6 PM AEST
A breakout must occur beyond the session high or low.
The breakout should be clear and decisive, not hovering around the range.
Step 3: Confirm with the 200 SMA
If price is above the 200 SMA, only buy signals are valid.
If price is below the 200 SMA, only sell signals are valid.
If a breakout occurs against the SMA, ignore it.
Step 4: Enter the Trade and Manage Risk
Enter the trade after the breakout candle closes.
Set stop-loss just inside the pre-London range to minimize risk.
Take profit using a 1:2 or 1:3 risk-reward ratio, or trail the stop.
Why This Strategy Works
Pre-London Liquidity Grab: Institutional traders set positions before the London open, making this range significant.
Trend Confirmation with SMA: Reduces false breakouts by filtering trades in the direction of the trend.
Real-Time Breakout Detection: Green and red diamond markers highlight valid breakouts that meet all conditions.
Final Notes
If price breaks out but quickly reverses, it may be a false breakout—avoid impulsive trades.
The indicator works best when combined with other confluences such as volume analysis or key support/resistance levels.
Alerts can be added to notify traders when a valid breakout occurs.
This setup is ideal for traders looking for a structured, rule-based approach to trading London session breakouts with a strong trend confirmation mechanism.
SuperTrend AI Oscillator StrategySuperTrend AI Oscillator Strategy
Overview
This strategy is a trend-following approach that combines the SuperTrend indicator with oscillator-based filtering.
By identifying market trends while utilizing oscillator-based momentum analysis, it aims to improve entry precision.
Additionally, it incorporates a trailing stop to strengthen risk management while maximizing profits.
This strategy can be applied to various markets, including Forex, Crypto, and Stocks, as well as different timeframes. However, its effectiveness varies depending on market conditions, so thorough testing is required.
Features
1️⃣ Trend Identification Using SuperTrend
The SuperTrend indicator (a volatility-adjusted trend indicator based on ATR) is used to determine trend direction.
A long entry is considered when SuperTrend turns bullish.
A short entry is considered when SuperTrend turns bearish.
The goal is to capture clear trend reversals and avoid unnecessary trades in ranging markets.
2️⃣ Entry Filtering with an Oscillator
The Super Oscillator is used to filter entry signals.
If the oscillator exceeds 50, it strengthens long entries (indicating strong bullish momentum).
If the oscillator drops below 50, it strengthens short entries (indicating strong bearish momentum).
This filter helps reduce trades in uncertain market conditions and improves entry accuracy.
3️⃣ Risk Management with a Trailing Stop
Instead of a fixed stop loss, a SuperTrend-based trailing stop is implemented.
The stop level adjusts automatically based on market volatility.
This allows profits to run while managing downside risk effectively.
4️⃣ Adjustable Risk-Reward Ratio
The default risk-reward ratio is set at 1:2.
Example: A 1% stop loss corresponds to a 2% take profit target.
The ratio can be customized according to the trader’s risk tolerance.
5️⃣ Clear Trade Signals & Visual Support
Green "BUY" labels indicate long entry signals.
Red "SELL" labels indicate short entry signals.
The Super Oscillator is plotted in a separate subwindow to visually assess trend strength.
A real-time trailing stop is displayed to support exit strategies.
These visual aids make it easier to identify entry and exit points.
Trading Parameters & Considerations
Initial Account Balance: Default is $7,000 (adjustable).
Base Currency: USD
Order Size: 10,000 USD
Pyramiding: 1
Trading Fees: $0.94 per trade
Long Position Margin: 50%
Short Position Margin: 50%
Total Trades (M5 Timeframe): 1,032
Visual Aids for Clarity
This strategy includes clear visual trade signals to enhance decision-making:
Green "BUY" labels for long entries
Red "SELL" labels for short entries
Super Oscillator plotted in a subwindow with a 50 midline
Dynamic trailing stop displayed for real-time trend tracking
These visual aids allow traders to quickly identify trade setups and manage positions with greater confidence.
Summary
The SuperTrend AI Oscillator Strategy is developed based on indicators from Black Cat and LuxAlgo.
By integrating high-precision trend analysis with AI-based oscillator filtering, it provides a strong risk-managed trading approach.
Important Notes
This strategy does not guarantee profits—performance varies based on market conditions.
Past performance does not guarantee future results. Markets are constantly changing.
Always test extensively with backtesting and demo trading before using it in live markets.
Risk management, position sizing, and market conditions should always be considered when trading.
Conclusion
This strategy combines trend analysis with momentum filtering, enhancing risk management in trading.
By following market trends carefully, making precise entries, and using trailing stops, it seeks to reduce risk while maximizing potential profits.
Before using this strategy, be sure to test it thoroughly via backtesting and demo trading, and adjust the settings to match your trading style.
AEST High-Low MarkerOverview
This TradingView indicator, AEST High-Low Marker, is designed to mark the highest and lowest price levels observed between 5:00 PM and 6:00 PM AEST and extend these levels visually on the chart only between 5:00 PM and 12:00 AM AEST.
Functionality
Time Conversion for AEST
Since TradingView operates in UTC, the script translates AEST (UTC+10 or UTC+11 during daylight savings) into UTC time.
The script starts tracking from 5:00 PM AEST (7 AM UTC) to 6:00 PM AEST (8 AM UTC).
The high and low lines will be displayed only between 5:00 PM and 12:00 AM AEST (7 AM to 2 PM UTC).
Real-Time High & Low Calculation
The indicator dynamically updates the session high and low as new candles form during the 5 PM - 6 PM AEST period.
It captures the maximum high and minimum low during this timeframe.
Line Display Restrictions
The session high and low lines will only be drawn between 5:00 PM and 12:00 AM AEST to prevent chart clutter.
The lines disappear after 12:00 AM AEST.
Visual Representation
Blue Line: Marks the session high recorded between 5 PM - 6 PM AEST.
Red Line: Marks the session low recorded between 5 PM - 6 PM AEST.
Both lines extend until 12 AM AEST and then disappear.
Use Case
This indicator is useful for traders looking to track key price levels formed between 5 PM and 6 PM AEST and observe how price interacts with these levels until midnight.
It is particularly beneficial for intraday and short-term trading strategies, allowing users to identify potential support and resistance zones based on early evening price action.
3x Supertrend + EMA200 Signal Buy/Sell [nsen]The indicator uses signals from three Supertrend lines to determine whether to trade Buy or Sell, with the assistance of a moving average for bias.
Buy/Sell signals are generated when the conditions are met:
A Buy signal is triggered when all three Supertrend lines indicate a bullish trend and are above the EMA.
A Sell signal is triggered when all three Supertrend lines indicate a bearish trend and are below the EMA.
Indicator ใช้สัญญาณจาก Supertrend ทั้งหมด 3 เส้น โดยใช้ในการกำหนดว่าจะเลือกเทรด Buy หรือ Sell โดยการใช้ moveing average เข้ามาช่วยในการ bias
แสดงสัญญาณ Buy/Sell เมื่อเข้าเงื่อนไข
- Supertrend ทั้ง 3 เส้นเป็นสัญญาณ Bullish และอยู่เหนือเส้น EMA จะเปิดสัญญาณ Buy
- Supertrend ทั้ง 3 เส้นเป็นสัญญาณ Bearish และอยู่ใต้เส้น EMA จะเปิดสัญญาณ Sell
SMA Crossover with RSI ConfirmationThis is a sniper entry indicator that provides Buy and Sell signals using other Indicators to give the best possible Entries
Moving Average Crossovers:
The indicator uses two moving averages: a short-term SMA (Simple Moving Average) and a long-term SMA.
When the short-term SMA crosses above the long-term SMA, it generates a buy signal (indicating potential upward momentum).
When the short-term SMA crosses below the long-term SMA, it generates a sell signal (indicating potential downward momentum).
RSI Confirmation:
The indicator incorporates RSI (Relative Strength Index) to confirm the buy and sell signals generated by the moving average crossovers.
RSI is used to gauge the overbought and oversold conditions of the market.
A buy signal is confirmed if RSI is below a specified overbought level, indicating potential buying opportunity.
A sell signal is confirmed if RSI is above a specified oversold level, indicating potential selling opportunity.
Dynamic Take Profit and Stop Loss:
The indicator calculates dynamic take profit and stop loss levels based on the Average True Range (ATR).
ATR is used to gauge market volatility, and the take profit and stop loss levels are adjusted accordingly.
This feature helps traders to manage their risk effectively by setting appropriate profit targets and stop loss levels.
Combining the information provided by these, the indicator will provide an entry point with a provided take profit and stop loss. The indicator can be applied to different asset classes. Risk management must be applied when using this indicator as it is not 100% guaranteed to be profitable.
Multi-Timeframe VWAP DashboardMulti-Timeframe VWAP Dashboard with Advanced Customization**
Unlock the power of **Volume-Weighted Average Price (VWAP)** across multiple timeframes with this highly customizable and feature-rich Pine Script. Designed for traders who demand precision and flexibility, this script provides a **comprehensive VWAP dashboard** that adapts to your trading style and strategy. Whether you're a day trader, swing trader, or long-term investor, this tool offers unparalleled insights into market trends and price levels.
---
### **Key Features:**
1. **Multi-Timeframe VWAP Calculation:**
- Calculate VWAP across **12-minute, 48-minute, 96-minute, 192-minute, daily, weekly, monthly, and even yearly timeframes**.
- Supports **custom timeframes** for tailored analysis.
2. **Price Source Selection:**
- Choose from multiple price sources for VWAP calculation, including **Open, High, Low, Close, HL2, HLC3, HLCC4, and All**.
- Optimize VWAP for **uptrends and downtrends** by selecting the most relevant price source.
3. **Customizable Labels:**
- Add **dynamic labels** to each VWAP line for quick reference.
- Customize label **colors, sizes, and offsets** to suit your chart setup.
- Display **price values** and **session types** (e.g., "12 Min", "Daily", "Weekly") directly on the chart.
4. **Advanced Session Detection:**
- Automatically detect new sessions for **intraday, daily, weekly, monthly, and yearly timeframes**.
- Ensures accurate VWAP calculations for each session.
5. **Plot Visibility Control:**
- Toggle the visibility of individual VWAP plots to **reduce clutter** and focus on the most relevant timeframes.
- Includes options for **short-term, medium-term, and long-term VWAPs**.
6. **Comprehensive Timeframe Coverage:**
- From **12-minute intervals** to **12-month intervals**, this script covers all major timeframes.
- Perfect for traders who analyze markets across multiple horizons.
7. **User-Friendly Inputs:**
- Intuitive input options for **timeframes, colors, labels, and offsets**.
- Easily customize the script to match your trading preferences.
8. **Dynamic Label Positioning:**
- Labels adjust automatically based on price movements and session changes.
- Choose from **multiple offset options** to position labels precisely.
9. **Miscellaneous Customization:**
- Adjust **text color, label size, and price display settings**.
- Enable or disable **price values** and **session type labels** for a cleaner chart.
---
### **Why Use This Script?**
- **Versatility:** Suitable for all trading styles, including scalping, day trading, swing trading, and long-term investing.
- **Precision:** Accurate VWAP calculations across multiple timeframes ensure you never miss key price levels.
- **Customization:** Tailor the script to your specific needs with a wide range of input options.
- **Clarity:** Dynamic labels and customizable plots make it easy to interpret market trends at a glance.
---
### **How It Works:**
1. **Select Your Price Source:**
- Choose the price source (e.g., Open, Close, HL2) for VWAP calculation based on your trading strategy.
2. **Choose Timeframes:**
- Define the timeframes for VWAP calculation, from intraday to yearly intervals.
3. **Customize Labels and Plots:**
- Enable or disable labels and plots for each timeframe.
- Adjust colors, sizes, and offsets to match your chart setup.
4. **Analyze Market Trends:**
- Use the VWAP lines and labels to identify **support/resistance levels**, **trend direction**, and **potential reversal points**.
5. **Adapt to Market Conditions:**
- Switch between timeframes and price sources to adapt to changing market conditions.
---
### **Ideal For:**
- **Day Traders:** Use short-term VWAPs (e.g., 12-minute, 48-minute) to identify intraday trends and key levels.
- **Swing Traders:** Leverage medium-term VWAPs (e.g., 96-minute, daily) to spot swing opportunities.
- **Long-Term Investors:** Analyze long-term VWAPs (e.g., weekly, monthly) to gauge overall market direction.
---
### **How to Get Started:**
1. Add the script to your TradingView chart.
2. Customize the inputs to match your trading preferences.
3. Analyze the VWAP lines and labels to make informed trading decisions.
---
### **Pro Tip:**
Combine this script with other technical indicators (e.g., moving averages, RSI) for a **holistic view** of the market. Use the VWAP lines as dynamic support/resistance levels to enhance your entry and exit strategies.
This script is a must-have tool for traders who value precision, flexibility, and clarity. Share it with your audience to help them elevate their trading game. Whether they're beginners or seasoned professionals, this **Multi-Timeframe VWAP Dashboard** will become an essential part of their toolkit.
OHLC OLHC - Monthly, Weekly, Daily and HourlyThis indicator plots the previous day's (or any selected timeframe’s) Open, High, Low, and Close (OHLC) levels on the current chart. It helps traders analyze historical price levels to identify support and resistance zones.
Key Features:
Multi-Timeframe Support:
Users can select a timeframe (D, W, M, etc.) to fetch previous OHLC data.
The script requests OHLC values from the selected timeframe and overlays them on the current chart.
Customizable Display Options:
Users can choose to display only the last OHLC levels instead of all past session levels.
Users can extend the OHLC lines across the chart.
Background Highlighting:
The script fills the background only for the Previous Open and Previous Close levels, making them visually distinct.
Previous High and Low levels do not have background color.
This script is particularly useful for day traders and swing traders who rely on key price levels to make trading decisions. Let me know if you need further refinements!
Aggressive Strategy for High IV Market### Strategic background
In a volatile high IV market, prices are volatile and market expectations of future uncertainty are high. This environment provides opportunities for aggressive trading strategies, but also comes with a high level of risk. In pursuit of a high Sharpe ratio (i.e., risk-adjusted return), we need to design a strategy that captures the benefits of market volatility while effectively controlling risk. Based on daily line cycles, I choose a combination of trend tracking and volatility filtering for highly volatile assets such as stocks, futures or cryptocurrencies.
---
### Strategy framework
#### Data
- Use daily data, including opening, closing, high and low prices.
- Suitable for highly volatile markets such as technology stocks, cryptocurrencies or volatile index futures.
#### Core indicators
1. ** Trend Indicators ** :
Fast Exponential Moving Average (EMA_fast) : 10-day EMA, used to capture short-term trends.
- Slow Exponential Moving Average (EMA_slow) : 30-day EMA, used to determine the long-term trend.
2. ** Volatility Indicators ** :
Average true Volatility (ATR) : 14-day ATR, used to measure market volatility.
- ATR mean (ATR_mean) : A simple moving average of the 20-day ATR that serves as a volatility benchmark.
- ATR standard deviation (ATR_std) : The standard deviation of the 20-day ATR, which is used to judge extreme changes in volatility.
#### Trading logic
The strategy is based on a trend following approach of double moving averages and filters volatility through ATR indicators, ensuring that trading only in a high-volatility environment is in line with aggressive and high sharpe ratio goals.
---
### Entry and exit conditions
#### Admission conditions
- ** Multiple entry ** :
- EMA_fast Crosses EMA_slow (gold cross), indicating that the short-term trend is turning upward.
-ATR > ATR_mean + 1 * ATR_std indicates that the current volatility is above average and the market is in a state of high volatility.
- ** Short Entry ** :
- EMA_fast Crosses EMA_slow (dead cross) downward, indicating that the short-term trend turns downward.
-ATR > ATR_mean + 1 * ATR_std, confirming high volatility.
#### Appearance conditions
- ** Long show ** :
- EMA_fast Enters the EMA_slow (dead cross) downward, and the trend reverses.
- or ATR < ATR_mean-1 * ATR_std, volatility decreases significantly and the market calms down.
- ** Bear out ** :
- EMA_fast Crosses the EMA_slow (gold cross) on the top, and the trend reverses.
- or ATR < ATR_mean-1 * ATR_std, the volatility is reduced.
---
### Risk management
To control the high risk associated with aggressive strategies, set up the following mechanisms:
1. ** Stop loss ** :
- Long: Entry price - 2 * ATR.
- Short: Entry price + 2 * ATR.
- Dynamic stop loss based on ATR can adapt to market volatility changes.
2. ** Stop profit ** :
- Fixed profit target can be selected (e.g. entry price ± 4 * ATR).
- Or use trailing stop losses to lock in profits following price movements.
3. ** Location Management ** :
- Reduce positions appropriately in times of high volatility, such as dynamically adjusting position size according to ATR, ensuring that the risk of a single trade does not exceed 1%-2% of the account capital.
---
### Strategy features
- ** Aggressiveness ** : By trading only in a high ATR environment, the strategy takes full advantage of market volatility and pursues greater returns.
- ** High Sharpe ratio potential ** : Trend tracking combined with volatility filtering to avoid ineffective trades during periods of low volatility and improve the ratio of return to risk.
- ** Daily line Cycle ** : Based on daily line data, suitable for traders who operate frequently but are not too complex.
---
### Implementation steps
1. ** Data Preparation ** :
- Get the daily data of the target asset.
- Calculate EMA_fast (10 days), EMA_slow (30 days), ATR (14 days), ATR_mean (20 days), and ATR_std (20 days).
2. ** Signal generation ** :
- Check EMA cross signals and ATR conditions daily to generate long/short signals.
3. ** Execute trades ** :
- Enter according to the signal, set stop loss and profit.
- Monitor exit conditions and close positions in time.
4. ** Backtest and Optimization ** :
- Use historical data to backtest strategies to evaluate Sharpe ratios, maximum retracements, and win rates.
- Optimize parameters such as EMA period and ATR threshold to improve policy performance.
---
### Precautions
- ** Trading costs ** : Highly volatile markets may result in frequent trading, and the impact of fees and slippage on earnings needs to be considered.
- ** Risk Control ** : Aggressive strategies may face large retracements and need to strictly implement stop losses.
- ** Scalability ** : Additional metrics (such as volume or VIX) can be added to enhance strategy robustness, or combined with machine learning to predict trends and volatility.
---
### Summary
This is a trend following strategy based on dual moving averages and ATR, designed for volatile high IV markets. By entering into high volatility and exiting into low volatility, the strategy combines aggressive and risk-adjusted returns for traders seeking a high sharpe ratio. It is recommended to fully backtest before implementation and adjust the parameters according to the specific market.
Cumulative Price Change AlertCumulative Price Change Alert
Version: 1.0
Author: QCodeTrader 🚀
Overview 🔍
The Cumulative Price Change Alert indicator analyzes the percentage change between the current and previous open prices and sums these changes over a user-defined number of bars. It then generates visual buy and sell signals using arrows and labels on the chart, helping traders spot cumulative price momentum and potential trading opportunities.
Key Features ⚙️
Customizable Timeframe 🕒:
Use a custom timeframe or default to the chart's timeframe for price data.
User-Defined Summation 🔢:
Specify the number of bars to sum, allowing you to analyze cumulative price changes.
Custom Buy & Sell Conditions 🔔:
Set individual percentage change thresholds and cumulative sum thresholds to tailor signals for
your strategy.
Visual Alerts 🚀:
Displays green upward arrows for buy signals and red downward arrows for sell signals directly
on the chart.
Informative Labels 📝:
Provides labels with formatted percentage change and cumulative sum details for the analyzed
bars.
Versatile Application 📊:
Suitable for stocks, forex, crypto, commodities, and more.
How It Works ⚡
Price Change Calculation ➗:
The indicator calculates the percentage change between the current bar's open price and the
previous bar's open price.
Cumulative Sum ➕:
It then sums these percentage changes over the last N bars (as specified by the user).
Signal Generation 🚦:
Buy Signal 🟢: When both the individual percentage change and the cumulative sum exceed
their respective buy thresholds, a green arrow and label are displayed.
Sell Signal 🔴: Conversely, if the individual change and cumulative sum fall below the sell
thresholds, a red arrow and label are shown.
How to Use 💡
Add the Indicator ➕:
Apply the indicator to your chart.
Customize Settings ⚙️:
Set a custom timeframe if desired.
Define the number of bars to sum.
Adjust the buy/sell percentage change and cumulative sum thresholds to match your trading
strategy.
Interpret Visual Cues 👀:
Monitor the chart for green or red arrows and corresponding labels that signal potential buy or
sell opportunities based on cumulative price movements.
Settings Explained 🛠️
Custom Timeframe:
Select an alternative timeframe for analysis, or leave empty to use the current chart's timeframe.
Number of Last Bars to Sum:
Determines how many bars are used to compute the cumulative percentage change.
Buy Condition - Min % Change:
The minimum individual percentage change required to consider a buy signal.
Buy Condition - Min Sum of Bars:
The minimum cumulative percentage change over the defined bars needed for a buy signal.
Sell Condition - Max % Change:
The maximum individual percentage change threshold for a sell signal.
Sell Condition - Max Sum of Bars:
The maximum cumulative percentage change over the defined bars for triggering a sell signal.
Best Use Cases 🎯
Momentum Identification 📈:
Quickly spot strong cumulative price movements and momentum shifts.
Entry/Exit Signals 🚪:
Use the visual signals to determine potential entry and exit points in your trading.
Versatile Strategy Application 🔄:
Effective for scalping, swing trading, and longer-term analysis across various markets.
UPD: uncheck labels for better performance
[GYTS] Filters ToolkitFilters Toolkit indicator
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- 1. INTRODUCTION --------- 🌸
💮 Overview
The GYTS Filters Toolkit indicator is an advanced, interactive interface built atop the high‐performance, curated functions provided by the FiltersToolkit library . It allows traders to experiment with different combinations of filtering methods -— from smoothing low-pass filters to aggressive detrenders. With this toolkit, you can build custom indicators tailored to your specific trading strategy, whether you're looking for trend following, mean reversion, or cycle identification approaches.
🌸 --------- 2. FILTER METHODS AND TYPES --------- 🌸
💮 Filter categories
The available filters fall into four main categories, each marked with a distinct symbol:
🌗 Low Pass Filters (Smoothers)
These filters attenuate high-frequency components (noise) while allowing low-frequency components (trends) to pass through. Examples include:
Ultimate Smoother
Super Smoother (2-pole and 3-pole variants)
MESA Adaptive Moving Average (MAMA) and Following Adaptive Moving Average (FAMA)
BiQuad Low Pass Filter
ADXvma (Adaptive Directional Volatility Moving Average)
A2RMA (Adaptive Autonomous Recursive Moving Average)
Low pass filters are displayed on the price chart by default, as they follow the overall price movement. If they are combined with a high-pass or bandpass filter, they will be displayed in the subgraph.
🌓 High Pass Filters (Detrenders)
These filters do the opposite of low pass filters - they remove low-frequency components (trends) while allowing high-frequency components to pass through. Examples include:
Butterworth High Pass Filter
BiQuad High Pass Filter
High pass filters are displayed as oscillators in the subgraph below the price chart, as they fluctuate around a zero line.
🌑 Band Pass Filters (Cycle Isolators)
These filters combine aspects of both low and high pass filters, isolating specific frequency ranges while attenuating both higher and lower frequencies. Examples include:
Ehlers Bandpass Filter
Cyber Cycle
Relative Vigor Index (RVI)
BiQuad Bandpass Filter
Band pass filters are also displayed as oscillators in a separate panel.
🔮 Predictive Filter
Voss Predictive Filter: A special filter that attempts to predict future values of band-limited signals (only to be used as post-filter). Keep its prediction horizon short (1–3 bars) for reasonable accuracy.
Note that the the library contains elaborate documentation and source material of each filter.
🌸 --------- 3. INDICATOR FEATURES --------- 🌸
💮 Multi-filter configuration
One of the most powerful aspects of this indicator is the ability to configure multiple filters. compare them and observe their combined effects. There are four primary filters, each with its own parameter settings.
💮 Post-filtering
Process a filter’s output through an additional filter by enabling the post-filter option. This creates a filter chain where the output of one filter becomes the input to another. Some powerful combinations include:
Ultimate Smoother → MAMA: Creates an adaptive smoothing effect that responds well to market changes, good for trend-following strategies
Butterworth → Super Smoother → Butterworth: Produces a well-behaved oscillator with minimal phase distortion, John Ehlers also calls a "roofing filter". Great for identifying overbought/oversold conditions with minimal lag.
A bandpass filter → Voss Prediction filter: Attempts to predict future movements of cyclical components, handy to find peaks and troughs of the market cycle.
💮 Aggregate filters
Arguably the coolest feature: aggregating filters allow you to combine multiple filters with different weights. Important notes about aggregation:
You can only aggregate filters that appear on the same chart (price chart or oscillator panel).
The weights are automatically normalised, so only their relative values matter
Setting a weight to 0 (zero) excludes that filter from the aggregation
Filters don't need to be visibly displayed to be included in aggregation
💮 Rich visualisation & alerts
The indicator intelligently determines whether a filter is displayed on the price chart or in the subgraph (as an oscillator) based on its characteristics.
Dynamic colour palettes, adjustable line widths, transparency, and custom fill between any of enabled filters or between oscillators and the zero-line.
A clear legend showing which filters are active and how they're configured
Alerts for direction changes and crossovers of all filters
🌸 --------- 4. ACKNOWLEDGEMENTS --------- 🌸
This toolkit builds on the work of numerous pioneers in technical analysis and digital signal processing:
John Ehlers, whose groundbreaking research forms the foundation of many filters.
Robert Bristow-Johnson for the BiQuad filter formulations.
The TradingView community, especially @The_Peaceful_Lizard, @alexgrover, and others mentioned in the code of the library.
Everyone who has provided feedback, testing and support!