AlgoPilotX - Breakout & Breakdown Meter (v1)Version Note:
This is a revised and improved version of the AlgoPilotX – Breakout & Breakdown Meter. It includes expanded explanations of the underlying logic, variable usage, and originality to comply with TradingView guidelines.
AlgoPilotX – Breakout & Breakdown Meter is a structured trading tool that combines Fair Value Gap (FVG) detection, session-based support/resistance breakouts, and a clean market condition info panel. It’s designed to help traders spot potential setups early and confirm stronger breakouts or breakdowns with context from momentum, volatility, and trend indicators.
How It Works
Session Levels → The first candle high/low of the session defines dynamic support/resistance. Unlike static pivots, these levels update with each new trading session and reflect real intraday sentiment.
Fair Value Gaps (FVGs) → A three-candle imbalance highlights inefficiencies. When detected, the script marks the open of the third candle as a potential entry (light green/red arrow).
Pullback Confirmations → If price pulls back into session support/resistance and then breaks away strongly, a stronger entry signal (dark green/red arrow) is plotted.
Breakouts & Breakdowns → Additional arrows appear when price crosses decisively above resistance or below support.
Signal Hierarchy → Arrows vary by color/size:
Light = early/potential setups.
Dark/Large = stronger confirmations.
Info Panel Dashboard → RSI, MACD, Bollinger Bands, and EMAs are displayed in a compact table with both numeric values and Bullish/Bearish/Neutral states, color-coded for quick interpretation.
How the Functions and Variables Work Together
Session Levels (Support & Resistance)
The script uses time() and session inputs to identify the first candle of the chosen trading session.
Variables sessionHigh and sessionLow are stored with var so they persist until the next session.
These levels are then plotted as dynamic support/resistance lines. This approach is different from static pivots or daily highs/lows, because it adapts in real-time to the market open.
Fair Value Gap (FVG) Detection
Conditions check for three-candle imbalances ( low > high for bullish, high < low for bearish).
When detected, a potential entry is marked at the open of the third candle.
Variables fvgBull and fvgBear define this logic , making FVGs a core entry condition rather than a side overlay.
Entry Hierarchy (Light vs. Dark Arrows)
longPotentialEntry and shortPotentialEntry mark light green/red arrows as early signals.
pullbackToSupport and pullbackToResistance build on these by requiring price to return to session levels and then break away again.
This creates the dark green/red arrows for stronger entries, introducing a two-step filtering process.
Breakout & Breakdown Detection
breakAbove = ta.crossover(close, sessionHigh)
breakBelow = ta.crossunder(close, sessionLow)
These conditions confirm true breakouts or breakdowns beyond support/resistance, reducing noise.
Info Panel Construction
A table is created and updated each bar.
Functions like ta.rsi(), ta.ema(), ta.sma(), and ta.stdev() calculate RSI, MACD, EMAs, and Bollinger Bands.
Each indicator’s state is summarized into human-readable text (e.g., “Bullish,” “Bearish,” “Above,” “Oversold”) and displayed with color coding using the helper function f_stateColor().
Values are also displayed numerically (RSI, MACD histogram, EMA levels, BB width), making this a dashboard rather than just arrows on a chart.
Helper Function for States
f_stateColor(state) translates qualitative states into consistent colors (green for bullish/above, red for bearish/below, orange for neutral, purple for overbought/oversold).
This ensures that every signal in the info panel has a visual identity that traders can read instantly.
Alerts Integration
alertcondition() is tied to each major event: FVG potential entries, strong pullback confirmations, and breakout/breakdown signals.
This allows the script to be used for alerts, notifications and automation , not just visual charting.
How to Use
1. Default timeframe = 15m (adjustable).
2. The first session candle defines support & resistance.
3. Watch for arrows:
Light green (▲) below candle → Potential breakout long (FVG detected).
Dark green (▲) below candle → Strong breakout confirmation after pullback.
Light red (▼) above candle → Potential breakdown short (FVG detected).
Dark red (▼) above candle → Strong breakdown confirmation after pullback.
Larger arrows = higher confidence signals.
4. Check the Info Panel for context:
RSI → momentum
MACD → trend confirmation
Bollinger Bands → overbought/oversold
EMA20 & EMA50 → short- and medium-term trend bias
5. Always confirm with your own price action, volume, and risk management rules.
6. Easily move the Info Panel to any corner of the chart via settings to keep your view clear.
Why This Structure Is Original
Not a mashup : Instead of simply overlaying RSI, MACD, or EMAs, the script integrates them into a signal-filtering framework.
Dynamic anchoring: Session-based high/low variables make levels adaptive to intraday structure, unlike fixed pivots.
Dual entry tiering: Light vs. dark arrows are built by combining FVGs + pullback conditions, offering nuance most breakout scripts lack.
Dashboard-style panel: Variables are summarized into a real-time info box with both numbers and state labels, replacing multiple chart overlays with one compact tool.
Modular functions: Breakout, pullback, FVG detection, and indicator states are modularized with separate variables — making the script flexible, extendable, and unique in design.
Disclaimer
This script is for educational purposes only. It does not constitute financial advice and does not guarantee profitable outcomes. Always backtest thoroughly, paper trade, and use proper risk management before trading live.
K-macd
All Divergences (MACD, RSIOI, CVD) Multi-Divergence Suite (MACD Area, RSIOI, CVD)
Description:
This indicator is a comprehensive suite designed to identify multiple types of market divergences on your chart. Instead of using several different indicators, you can use this single script to find potential turning points and trend continuations based on momentum and volume analysis.
Key Features:
1. MACD Area Divergence:
Unlike standard MACD divergence that only compares the peaks of the histogram, this module calculates the entire area (volume) of each MACD cycle. It then compares this momentum "volume" to price action to detect both Regular Divergences (signaling potential trend reversals) and Hidden Divergences (signaling potential trend continuations).
2. RSIOI (RSI Overbought/Oversold) Divergence:
This module identifies classic RSI divergences with a specific filter: it only looks for price pivots that occur while the RSI is in overbought (e.g., >70) or oversold (e.g., <30) territory. This helps to focus on signals that appear at potential market extremes.
3. CVD (Cumulative Volume Delta) Divergence:
This powerful module shows the divergence between price and Cumulative Volume Delta, giving you a clearer view of the underlying buying and selling pressure. It features a unique "Ultra Data" mode that can aggregate volume from dozens of different brokers for a more accurate picture of the market, which is especially useful for Forex and Crypto pairs.
Customization:
Each of the three divergence modules can be enabled or disabled independently.
Filter signals to show "Longs Only," "Shorts Only," or both to match your trading bias.
AWESOME Momentum & Trend MeterMomentum + Trend Meter Indicator –
Imagine the stock chart is a road, and we want to know which way the cars are going (trend) and how fast they are moving (momentum). This indicator gives us two special meters to see that.
1. Momentum Meter (AO Baseline)
Think of AO (Awesome Oscillator) as a ruler that tells us if the road is going uphill (bullish) or downhill (bearish).
MACD is like a speedometer that tells us how fast the cars are moving.
Colors show how strong the movement is:
Dark green = strong uphill (good for buying)
Light green = uphill but slow
Dark red = strong downhill (good for selling)
Light red = downhill but slow
rey = mixed signals, be careful!
So, this meter tells you: “The trend is up/down, and the speed is fast/slow.”
2. Trend Meter (All 3 Trend Meters Align + WaveTrend)
This meter looks at three different signals (like checking the weather, traffic lights, and road signs) to see if they all agree on the trend.
Circles mean all three signals say the same direction (all green = bullish, all red = bearish).
Crosses mean all three signals agree AND the momentum is strong (extra confirmation).
The background color also shows the trend: green = up, red = down.
So, this meter tells you: “All signs agree — it’s safe to follow the trend.”
How You Can Use It
Look for Momentum Meter and Trend Meter agreeing:
Both show green → good time to buy.
Both show red → good time to sell.
Grey areas or light colors → be careful, the trend is weak or confusing.
This indicator doesn’t guess, it just shows the trend and momentum clearly.
It’s like having two helpers:
One tells you which way the road goes (Momentum Meter)
The other tells you if it’s safe to move (Trend Meter).
MACD Swing Trader MACD Swing Trader
Overview
The MACD Swing Trader is a Pine Script v5 indicator designed for swing trading on the BTC/USDT pair, optimized for 4-hour or daily timeframes. Built on the classic MACD (Moving Average Convergence Divergence) indicator, it incorporates a 200-period EMA trend filter and a unique feature to prevent consecutive Buy or Sell signals, ensuring cleaner and more reliable trade setups. This indicator is ideal for traders seeking high-probability entries and exits in the volatile crypto market, with a backtested win rate of approximately 80-87% on historical BTC/USDT data.
Features
MACD-Based Signals: Generates Buy signals on MACD line crossovers above the signal line (below zero) and Sell signals on crossunders (above zero), capturing momentum shifts.
EMA 200 Trend Filter: Only triggers Buy signals in uptrends (price > EMA 200) and Sell signals in downtrends (price < EMA 200), aligning trades with the broader market direction.
No Consecutive Signals: Prevents repetitive signals (e.g., no back-to-back Buy signals) until an opposite signal occurs, reducing noise and improving signal quality.
Visual Aids: Displays the EMA 200 line, color-coded trend background (green for uptrend, red for downtrend), and clear Buy/Sell labels on the chart.
Customizable Parameters: Adjustable MACD lengths (default: 12, 26, 9) and EMA length (default: 200) for fine-tuning to different market conditions.
Alerts: Built-in alert conditions for real-time notifications on Buy/Sell signals, compatible with TradingView's alert system.
Separate MACD Panel: Visualizes MACD and signal lines with a zero line for additional analysis.
How to Use
Setup: Add the indicator to TradingView by copying the Pine Script code into the Pine Editor and applying it to the BTC/USDT chart (recommended: 4h or daily timeframe).
Entry Rules:
Buy: Green "BUY" label appears below the price bar when MACD crosses above the signal line, MACD is below zero, and price is above EMA 200.
Sell: Red "SELL" label appears above the price bar when MACD crosses below the signal line, MACD is above zero, and price is below EMA 200.
Exit Rules: Use a trailing stop (e.g., ATR-based) or exit on the opposite signal. Aim for a risk-to-reward ratio of 2:1 or 3:1.
Backtesting: Validate performance using TradingView’s Strategy Tester. Historical backtests suggest a win rate of ~80-87% on BTC/USDT 4h, though results may vary.
Risk Management: Always use proper risk management (e.g., 1-3% risk per trade) and test thoroughly before live trading.
Notes
Market Specificity: Optimized for BTC/USDT due to its volatility and trending nature. Test on other pairs before use.
Customization: Adjust MACD or EMA parameters for different timeframes or assets. Consider adding volume filters for enhanced accuracy.
Risk Warning: Trading cryptocurrencies involves significant risk. Past performance does not guarantee future results. Only risk capital you can afford to lose.
Community Sharing
Feel free to share this indicator with the TradingView community! It’s designed to help swing traders capture high-probability setups while minimizing signal clutter. Feedback and suggestions for improvements are welcome.
AriVestHub_MACDPhilosophy and Function of AriVestHub_MACD
The AriVestHub_MACD is an enhanced version of the classic MACD indicator. By combining histogram extremum analysis with statistical logic, it provides a precise view of the true significance of market movements.
Core Functionality
1. Detecting MACD Histogram Extremes:
The indicator automatically identifies and stores the local maxima and minima of the MACD histogram. These extremum points form the basis for further analysis and plotting key levels.
2. Dynamic Threshold Levels (U15 and L55):
Based on the last N extremum points (user-defined), two critical lines are drawn:
o U15: The level above which the top 15% of recent histogram extrema lie.
o L55: The level below which the bottom 55% of recent histogram extrema lie.
These lines update dynamically on every bar, providing a real-time picture of market conditions.
3. Analyzing Distribution and Significance of Histogram Extremes:
By calculating the number of extrema above U15 and below L55, the indicator identifies which MACD movements have high, medium, or low significance. This allows traders to assess the real strength of MACD movements, even when their apparent size on the chart is misleading.
4. Statistical and Reliable Insights:
Instead of relying on guesswork or visual impressions, the indicator uses statistically grounded percentage analysis, ensuring decisions are consistent, objective, and repeatable.
Practical Benefits
• Identify key price levels and potential reversal zones
• Evaluate the significance of histogram movements
• Improve risk management and timing of entries/exits
• Adapt to market changes across different timeframes
Summary Philosophy
The AriVestHub_MACD focuses on extremum points and their distribution. Using dynamic threshold lines, it enables traders to:
• Distinguish highly significant moves from less important ones
• Accurately define support and resistance zones based on real data
• Make decisions based on statistically grounded insights
In essence, this indicator merges classic technical analysis with advanced statistical logic, empowering traders to operate more intelligently and data-driven.
SLG's EMA+MACD Signal Trading Strategy M15Trading Concept Overview
This strategy combines trend-following and momentum confirmation to identify high-probability entries in both long and short directions. It uses EMA-based trend filtering and MACD signal analysis, while managing risk dynamically using ATR-based stop loss and take profit.
1. Trend Identification
The strategy calculates a Trend EMA (emaTrend) with a user-defined period (emaTrendLen) to determine the overall market direction:
Bullish Trend: Price closes above the Trend EMA → only long trades are considered.
Bearish Trend: Price closes below the Trend EMA → only short trades are considered.
This ensures trades are aligned with the larger trend, avoiding counter-trend signals.
2. Momentum Signal with MACD
MACD Calculation:
fastEMA - slowEMA generates the MACD line.
Signal line is an EMA of the MACD line.
delta = MACD - Signal measures the momentum difference.
Entry Logic:
Long Signal: delta crosses above zero AND the price is above the Trend EMA.
Short Signal: delta crosses below zero AND the price is below the Trend EMA.
This ensures that entries occur only when momentum is aligned with the overall trend.
3. Dynamic Risk Management (ATR-based SL/TP)
Uses Average True Range (ATR) to dynamically set stop loss and take profit:
Long Trade:
Stop Loss = Close - ATR * atrSLMult
Take Profit = Close + ATR * atrTPMult
Short Trade:
Stop Loss = Close + ATR * atrSLMult
Take Profit = Close - ATR * atrTPMult
This allows the strategy to adapt to market volatility, protecting capital in choppy conditions and scaling profit targets in trending markets.
4. Visual and Alert Features
Plots:
Trend EMA for visual trend guidance.
MACD delta to observe momentum.
Long/Short signals as small triangles directly on the chart.
Alerts:
Generates notifications for long and short signals to trigger timely trades.
5. Core Trading Philosophy
Trend-Following Bias: Only trade in the direction of the trend EMA.
Momentum Confirmation: Enter trades when the MACD delta confirms the move.
Volatility-Adjusted Risk: Use ATR to dynamically scale stops and targets.
Disclaimer / Risk Notice
Trading financial markets involves significant risk and may not be suitable for all investors. Past performance is not indicative of future results.
Market conditions can change rapidly and unpredictably, and no strategy can guarantee profits. Always use proper risk management and position sizing.
This strategy is for educational and informational purposes only. Users are responsible for their own trading decisions.
MACD ProThe MACD Pro is a modern take on the classic MACD, designed to give traders deeper insights into market momentum, trend conditions, and potential turning points. While it keeps the standard MACD foundation, it introduces a few enhancements to make it more adaptive and visually intuitive.
At its core, the indicator calculates the traditional MACD line, Signal line and Histogram. The histogram can be optionally displayed.
One of the things that set this version apart is the addition of the MACD Leader, an optional feature that makes the MACD more responsive to price action. By applying an adaptive smoothing factor (Leader Sensitivity), the Leader line can provide earlier momentum cues compared to the standard MACD and help anticipate shifts before they become obvious on a standard MACD indicator.
Another enhancement is the regime-based color system for the MACD line. Instead of simply coloring based on the MACD or histogram itself, this indicator identifies the overall market regime using momentum and trend strength conditions.
Bullish Regime: Momentum is positive and trend strength is above average.
Bearish Regime: Momentum is negative and trend strength is above average.
Sideways Regime: Momentum remains weak and within noise levels.
This regime detection allows the MACD line to visually adapt, giving traders an extra layer of context beyond standard MACD signals to blend momentum analysis with market conditions, helping distinguish between trending and ranging environments.
AA1 MACD 09.2025this is a learing project i want to share
the script is open for anyone
I combain some ema's mcad and more indicators to help find stocks in momentum
MACD Area on Chart w/ DivergenceMACD Area & Divergence Suite
This is an all-in-one MACD analysis tool that overlays key information directly onto your price chart, helping you visualize momentum and potential trend changes.
Instead of looking at a separate indicator pane, this script brings all the critical data to your main chart.
Features
MACD Histogram Area: The script calculates the cumulative value (the "area") of the MACD histogram for each cycle (from one signal line cross to the next).
Cycle Boxes: It draws a border around the price bars that correspond to each positive (green) and negative (red) MACD histogram cycle.
Area Labels: Displays the calculated area value in the center of each box.
MACD Zero-Line Cross: Automatically draws a vertical dashed line when the main MACD line (not the histogram) crosses the zero line, signaling a major momentum shift.
Full Divergence Detection: This is the core feature. The script automatically finds, draws, and labels both types of divergence:
Regular Divergence: Signals a potential trend reversal.
Hidden Divergence: Signals a potential trend continuation.
Advanced Filtering: Includes a powerful option to validate divergences, ensuring they do not cross the MACD zero line. This helps filter for higher-quality signals.
Highly Customizable: Every feature can be turned on or off in the settings, including a "Divergence Only" mode for a cleaner chart. All colors and transparency are fully adjustable.
Adaptive Convergence Divergence### Adaptive Convergence Divergence (ACD)
By Gurjit Singh
The Adaptive Convergence Divergence (ACD) reimagines the classic MACD by replacing fixed moving averages with adaptive moving averages. Instead of a static smoothing factor, it dynamically adjusts sensitivity based on price momentum, relative strength, volatility, fractal roughness, or volume pressure. This makes the oscillator more responsive in trending markets while filtering noise in choppy ranges.
#### 📌 Key Features
1. Dual Adaptive Structure: The oscillator uses two adaptive moving averages to form its convergence-divergence line, with EMA/RMA as signal line:
* Primary Adaptive (MA): Fast line, reacts quickly to changes.
* Following Adaptive (FAMA): Slow line, with half-alpha smoothing for confirmation.
2. Adaptive MA Types
* ACMO: Adaptive CMO (momentum)
* ARSI: Adaptive RSI (relative strength)
* FRMA: Fractal Roughness (volatility + fractal dimension)
* VOLA: Volume adaptive (volume pressure)
3. PPO Option: Switch between classic MACD or Percentage Price Oscillator (PPO) style calculation.
4. Signal Smoothing: Choose between EMA or Wilder’s RMA.
5. Visuals: Colored oscillator, signal line, histogram with adaptive transparency.
6. Alerts: Bullish/Bearish crossovers built-in.
#### 🔑 How to Use
1. Add to chart: Works on any timeframe and asset.
2. Choose MA Type: Experiment with ACMO, ARSI, FRMA, or VOLA depending on market regime.
3. Crossovers:
* Bullish (🐂): Oscillator crosses above signal → potential long entry.
* Bearish (🐻): Oscillator crosses below signal → potential short entry.
4. Histogram: expansion = strengthening trend; contraction = weakening trend.
5. Divergences:
* Bullish (hidden strength): Price pushes lower, but ACD turns higher = potential upward reversal.
* Bearish (hidden weakness): Price pushes higher, but ACD turns lower = potential downward reversal.
6. Customize: Adjust lengths, smoothing type, and PPO/MACD mode to match your style.
7. Set Alerts:
* Enable Bullish or Bearish crossover alerts to catch momentum shifts in real time.
#### 💡 Tips
* PPO mode normalizes values across assets, useful for cross-asset analysis.
* Wilder’s smoothing is gentler than EMA, reducing whipsaws in sideways conditions.
* Adaptive smoothing helps reduce false divergence signals by filtering noise in choppy ranges.
MACD Aspray Hybrid Bars (teal/red) = raw momentum (Aspray Histogram).
Teal line = smooth curve of the histogram (Aspray Line).
Orange line = 9-EMA of that line (new signal).
Zero line for reference.
MACD X Cross with PlotThe default MACD indicator with the crossover added at the top of the MACD plot pane. Arrow up for MACD crossover signal line. Arrow down for MACD crossunder signal line.
REMS Snap Shot OverlayThe REMS Snap Shot indicator is a multi-factor, confluence-based system that combines momentum (RSI, Stochastic RSI), trend (EMA, MACD), and optional filters (volume, MACD histogram, session time) to identify high-probability trade setups. Signals are only triggered when all enabled conditions align, giving the trader a filtered, visually clear entry signal.
This indicator uses an optional 'look-back' feature where in it will signal an entry based on the recency of specified cross events.
To use the indicator, select which technical indicators you wish to filter, the session you wish to apply (default is 9:30am - 4pm EST, based on your chart time settings), and if which cross events you wish to trigger a reset on the cooldown.
The default settings filter the 4 major technical indicators (RSI, EMAs, MACD, Stochastic RSI) but optional filters exist to further fine tune Stochastic Range, MACD momentum and strength, and volume, with optional visual cues for MACD position, Stochastic RSI position, and volume.
EMAs can be drawn on the chart from this indicator with optional shaded background.
This indicator is an alternative to REMS First Strike, which uses a recency filter instead of a cool down.
REMS First Strike OverlayThe REMS First Strike indicator is a multi-factor, confluence-based system that combines momentum (RSI, Stochastic RSI), trend (EMA, MACD), and optional filters (volume, MACD histogram, session time) to identify high-probability trade setups. Signals are only triggered when all enabled conditions align, giving the trader a filtered, visually clear entry signal.
This indicator uses an optional 'cool down' feature where in it will signal an entry only after any of the specified cross events occur.
To use the indicator, select which technical indicators you wish to filter, the session you wish to apply (default is 9:30am - 4pm EST, based on your chart time settings), and if which cross events you wish to trigger a reset on the cooldown.
The default settings filter the 4 major technical indicators (RSI, EMAs, MACD, Stochastic RSI) but optional filters exist to further fine tune Stochastic Range, MACD momentum and strength, and volume, with optional visual cues for MACD position, Stochastic RSI position, and volume.
EMAs can be drawn on the chart from this indicator with optional shaded background.
This indicator is an alternative to REMS Snap Shot, which uses a recency filter instead of a cool down.
VWMA MACD Trend Grinder Buy/Sell SignalsDescription:
This indicator combines a VWMA-based MACD with volume and trend filters to reduce false buy and sell signals.
It is designed to give more reliable entry and exit points in trending markets while avoiding low-volume noise.
Features:
1. VWMA MACD:
- MACD is calculated using Volume-Weighted Moving Averages (VWMA) instead of standard EMAs.
- Histogram shows the difference between MACD and its signal line.
2. Volume Filter:
- Signals are only triggered when current volume exceeds a multiple of its moving average.
- Reduces false signals in low-volume periods.
3. Trend Filter:
- Only triggers buy signals when price is above a long-term VWMA (uptrend).
- Only triggers sell signals when price is below the long-term VWMA (downtrend).
- Helps avoid counter-trend trades.
4. Plots:
- MACD (blue), Signal (orange), Histogram (green/red)
- Trend VWMA (purple)
- Buy and Sell arrows in the indicator pane (green/red)
5. Alerts:
- Configurable alerts for buy and sell signals filtered by volume and trend.
Inputs:
- Fast Length: VWMA period for the fast MACD line (default 12)
- Slow Length: VWMA period for the slow MACD line (default 26)
- Signal Length: EMA period for the MACD signal line (default 9)
- Volume MA Length: Length for volume moving average filter (default 20)
- Volume Threshold Multiplier: Multiplier for volume filter (default 1.2)
- Trend VWMA Length: Period for long-term trend VWMA (default 50)
- Price Source: Close, HL2, HLC3, OHLC4
Usage:
- Use as a confirmation tool along with other analysis techniques.
- Buy when the green triangle appears (MACD crossover, above trend VWMA, sufficient volume).
- Sell when the red triangle appears (MACD crossunder, below trend VWMA, sufficient volume).
- Trend VWMA helps visually confirm the market trend.
VWMA MACD Amanita Buy/Sell Signals VWMA MACD Amanita Buy/Sell Signals – Volume-Weighted Momentum Indicator
A twist on the classic MACD: this indicator uses Volume Weighted Moving Averages (VWMA) instead of EMAs, giving more weight to price moves backed by higher volume.
Features:
VWMA-based MACD line & signal line
Histogram highlights bullish/bearish momentum
Color-coded for easy visualization
Quick Guide:
MACD above Signal → bullish
MACD below Signal → bearish
Rising histogram → strengthening trend
Falling histogram → weakening trend
Perfect for traders who want momentum confirmed by volume.
VWMA MACD AmanitaVWMA MACD (Volume-Weighted MACD)
This indicator modifies the standard MACD by replacing EMAs with VWMAs
(Volume-Weighted Moving Averages).
- Fast VWMA (default 12 bars)
- Slow VWMA (default 26 bars)
- MACD Line = Fast VWMA - Slow VWMA
- Signal Line = EMA of MACD (default 9 bars)
- Histogram = MACD - Signal
Compared to the standard MACD, this version emphasizes price moves that
are backed by higher trading volume, helping to filter out weak signals.
The script also lets you choose the price source (Close, HL2, HLC3, OHLC4).
MACD StrategyOverview
The "MACD Strategy" is a straightforward trading strategy tested for BTCUSDT Futures on the 1-minute timeframe, leveraging the Moving Average Convergence Divergence (MACD) indicator to identify momentum-based buy and sell opportunities. Developed with input from expert trading analyst insights, this strategy combines technical precision with risk management, making it suitable for traders of all levels on platforms like TradingView. It focuses on capturing trend reversals and momentum shifts, with clear visual cues and automated alerts for seamless integration with trading bots (e.g., Bitget webhooks).
#### How It Works
This strategy uses the MACD indicator to generate trading signals based on momentum and trend direction:
- **Buy Signal**: Triggered when the MACD line crosses above the signal line, and the MACD histogram turns positive (above zero). This suggests increasing bullish momentum.
- **Sell Signal**: Triggered when the MACD line crosses below the signal line, and the MACD histogram turns negative (below zero), indicating growing bearish momentum.
Once a signal is detected, the strategy opens a position (long for buy, short for sell) with a position size calculated based on your risk tolerance. It includes a stop-loss to limit losses and a take-profit to lock in gains, both dynamically adjusted using the Average True Range (ATR) for adaptability to market volatility.
#### Key Features
- **MACD-Based Signals**: Relies solely on MACD for entry points, plotted in a separate pane for clear momentum analysis.
- **Risk Management**: Automatically calculates position size based on a percentage of your account balance and sets stop-loss and take-profit levels using ATR multipliers and a risk:reward ratio.
- **Visual Feedback**: Plots entry, stop-loss, and take-profit lines on the chart with labeled markers for easy tracking.
- **Alerts**: Includes Bitget webhook-compatible alerts for automated trading, notifying you of buy and sell signals in real-time.
#### Input Parameters
- **Account Balance**: Default 10000 – Set your initial trading capital to determine position sizing.
- **MACD Fast Length**: Default 12 – The short-term EMA period for MACD sensitivity.
- **MACD Slow Length**: Default 26 – The long-term EMA period for MACD calculation.
- **MACD Signal Length**: Default 9 – The smoothing period for the signal line.
- **Risk Per Trade (%)**: Default 3.0 – The percentage of your account balance risked per trade (e.g., 3% of 10000 = 300).
- **Risk:Reward Ratio**: Default 3.0 – The ratio of potential profit to risk (e.g., 3:1 means risking 1 to gain 3).
- **SL Multiplier**: Default 1.0 – Multiplies ATR to set the stop-loss distance (e.g., 1.0 x ATR).
- **TP Multiplier**: Default 3.0 – Multiplies ATR to set the take-profit distance, adjusted by the risk:reward ratio.
- **Line Length (bars)**: Default 25 – Duration in bars for displaying trade lines on the chart.
- **Label Position**: Default 'left' – Position of text labels (left or right) relative to trade lines.
- **ATR Period**: Default 14 – The number of periods for calculating ATR to measure volatility.
#### How to Use
1. **Add to Chart**: Load the "MACD Strategy" as a strategy and the "MACD Indicator" as a separate indicator on your TradingView chart (recommended for BTCUSDT Futures on the 1-minute timeframe).
2. **Customize Settings**: Adjust the input parameters based on your risk tolerance and market conditions. For BTCUSDT Futures, consider reducing `Risk Per Trade (%)` during high volatility (e.g., 1%) or increasing `SL Multiplier` for wider stops.
3. **Visual Analysis**: Watch the main chart for trade entry lines (green for buy, red for sell), stop-loss (red), and take-profit (green) lines with labels. Use the MACD pane below to confirm momentum shifts.
4. **Set Alerts**: Create alerts in TradingView for "Buy Signal" and "Sell Signal" to automate trades via Bitget webhooks.
5. **Backtest and Optimize**: Test the strategy on historical BTCUSDT Futures 1-minute data to fine-tune parameters. The short timeframe requires quick execution, so monitor closely for slippage or latency.
#### Tips for Success
- **Market Conditions**: This strategy performs best in trending markets on the 1-minute timeframe. Avoid choppy conditions where MACD crossovers may produce false signals.
- **Risk Management**: Start with the default 3% risk per trade and adjust downward (e.g., 1%) during volatile periods like BTCUSDT news events. The 3:1 risk:reward ratio targets consistent profitability.
- **Timeframe**: Optimized for 1-minute charts; switch to 5-minute or 15-minute for less noise if needed.
- **Confirmation**: Cross-check MACD signals with price action or support/resistance levels for higher accuracy on BTCUSDT Futures.
#### Limitations
- This strategy relies solely on MACD, so it may lag in fast-moving or sideways markets. Consider adding a secondary filter (e.g., RSI) if needed.
- Stop-loss and take-profit are ATR-based and may need adjustment for BTCUSDT Futures’ high volatility, especially during leverage trading.
#### Conclusion
The "MACD Strategy" offers a simple yet effective way to trade momentum shifts using the MACD indicator, tested for BTCUSDT Futures on the 1-minute timeframe, with robust risk management and visual tools. Whether you’re scalping crypto futures or exploring short-term trends, this strategy provides a solid foundation for automated or manual trading. Share your feedback or customizations in the comments, and happy trading!
MACD Bullish Divergence + Multi-TF RSI Buy SignalsNew script to overlap MACD Bullish Divergence and RSI signals to give confluence.
Penguin Trend with RSI on DiffVisualizes volatility regime via the percent spread between the upper Bollinger Band and the upper Keltner Channel, with bar colors from a lightweight trend engine and an RSI computed on the Diff signal. Supports SMA/EMA/WMA/RMA/HMA/VWMA/VWAP and an optional calculation timeframe. Defaults preserve the original look and behavior.
Penguin Trend with RSI on Diff shows expansion vs. compression in price action by comparing two classic volatility envelopes. It computes:
Diff% = (UpperBB − UpperKC) / UpperKC × 100
• Diff > 0: Bollinger Bands are wider than Keltner Channels → expansion / momentum regime
• Diff < 0: BB narrower than KC → compression / squeeze regime
A white “Average Diff” line smooths Diff% (default: SMA(5)) to highlight regime shifts. Bars are colored only when Diff > 0 to focus on expansion phases. A lightweight trend engine defines four states from a fast/slow MA bias and a short “thrust” MA on ohlc4:
• Green: Bullish bias and thrust > fast MA (healthy upside thrust)
• Red: Bearish bias and thrust < fast MA (healthy downside thrust)
• Yellow: Bullish bias but thrust ≤ fast MA (pullback/weakness)
• Blue: Bearish bias but thrust ≥ fast MA (bear rally/short squeeze)
RSI on Diff:
The indicator adds an RSI applied to Diff% to gauge momentum of the expansion/compression signal itself. Choose between Built-in RSI or a manual RMA-based computation, and optionally smooth it. Default OB/OS lines are 70/30.
How it works:
• Bollinger Bands (BB): Basis = selected MA of src (default SMA(20)); Width = StdDev × Mult (default 2.0)
• Keltner Channels (KC): Basis = selected MA of src (default SMA(20)); Width = ATR(kcATR) × Mult (defaults 20 and 2.0)
• Diff%: Safe division guards against division-by-zero
• MA engine: Select SMA / EMA / WMA / RMA / HMA / VWMA / VWAP for BB/KC bases, Average Diff, and trend components (VWAP is session-anchored)
• Calculation timeframe: Compute internals on a chosen TF via request.security() while viewing any chart TF
Inputs (key):
• Calculation timeframe: Empty = chart TF; set e.g., 60/240 to compute on that TF
• BB: Length, StdDev Mult, MA Type
• KC: Basis Length, ATR Length, Multiplier, MA Type
• Average Diff: Length and MA Type
• RSI on Diff: RSI Length, Method (Built-in or Manual RMA), Smoothing Length, OB/OS levels, show/hide
• Trend Engine: Fast/Slow lengths & MA type, Signal (kept for completeness), Thrust MA length & type
• Display/Visibility: Paint bars only when Diff > 0; show zero line; “true Blue” color toggle; show/hide Diff columns and Average Diff
How to use:
1. Regime changes: Watch Diff% or Average Diff crossing 0. Above zero favors momentum/continuation setups; below zero suggests compression and potential breakout conditions.
2. State confirmation: During expansion (Diff > 0), prioritize Green/Red for aligned thrust; treat Yellow/Blue as cautionary/contrarian.
3. RSI on Diff: Use OB/OS and crossovers for timing entries/exits or for confirming/negating expansion strength.
Alerts:
• Diff crosses above/below 0
• Average Diff crosses above/below 0
• RSI(Diff) crosses above OB / below OS
• State changes: GREEN / RED / YELLOW / BLUE
Notes & limitations:
• VWAP is session-anchored and best on intraday data. If not applicable on the selected calculation TF, the script automatically falls back to EMA.
• Defaults (SMA(20) for BB/KC, multipliers 2.0, SMA(5) Average Diff, original trend coloring and bar painting) preserve the original appearance.
• RSI on Diff is plotted in the same pane for a compact workflow; you can hide it or split into a separate indicator if desired.
Release notes:
v6.0 — Upgraded to Pine v6. Added multi-MA options (SMA/EMA/WMA/RMA/HMA/VWMA/VWAP), calculation timeframe, RSI on Diff (Built-in or Manual RMA) with smoothing, safe division guard, optional zero line, and optional true Blue color. Defaults retain the original behavior.
License / disclaimer:
© waranyu.trkm — MIT License. Educational use only; not financial advice.
Penguin TrendMeasures the volatility regime by comparing the upper Bollinger Band to the upper Keltner Channel and colors bars with a lightweight trend state. Supports SMA/EMA/WMA/RMA/HMA/VWMA/VWAP and a selectable calculation timeframe. Default settings preserve the original look and behavior.
Penguin Trend visualizes expansion vs. compression in price action by comparing two classic volatility envelopes. It computes:
Diff% = (UpperBB − UpperKC) / UpperKC × 100
* Diff > 0: Bollinger Bands are wider than Keltner Channels -> expansion / momentum regime.
* Diff < 0: BB narrower than KC -> compression / squeeze regime.
A white “Average Difference” line smooths Diff% (default: SMA(5)) to help spot regime shifts.
Trend coloring (kept from original):
Bars are colored only when Diff > 0 to emphasize expansion phases. A lightweight trend engine defines four states using a fast/slow MA bias and a short “thrust” MA applied to ohlc4:
* Green: Bullish bias and thrust > fast MA (healthy upside thrust).
* Red: Bearish bias and thrust < fast MA (healthy downside thrust).
* Yellow: Bullish bias but thrust ≤ fast MA (pullback/weakness).
* Blue: Bearish bias but thrust ≥ fast MA (bear rally/short squeeze).
Note: By default, Blue renders as Yellow to preserve the original visual style. Enable “Use true BLUE color” if you prefer Aqua for Blue.
How it works (under the hood):
* Bollinger Bands (BB): Basis = selected MA of src (default SMA(20)). Width = StdDev × Mult (default 2.0).
* Keltner Channels (KC): Basis = selected MA of src (default SMA(20)). Width = ATR(kcATR) × Mult (defaults 20 and 2.0).
* Diff%: Safe division guards against division-by-zero.
* MA engine: You can choose SMA / EMA / WMA / RMA / HMA / VWMA / VWAP for BB/KC bases, Diff smoothing, and the trend components (VWAP is session-anchored).
* Calculation timeframe: Set “Calculation timeframe” to compute all internals on a chosen TF via request.security() while viewing any chart TF.
Inputs (key ones):
* Calculation timeframe: Empty = use chart TF; if set (e.g., 60), all internals compute on that TF.
* BB: Length, StdDev Mult, MA Type.
* KC: Basis Length, ATR Length, Multiplier, MA Type.
* Smoothing: Average Length & MA Type for the “Average Difference” line.
* Trend Engine: Fast/Slow lengths & MA type; Signal (kept for completeness); Thrust length & MA type (defaults replicate original behavior).
* Display: Paint bars only when Diff > 0; optional Zero line; optional true Blue color.
How to use:
1. Regime changes: Watch Diff% or Average Diff crossing 0. Above zero favors momentum/continuation setups; below zero suggests compression and potential breakout conditions.
2. State confirmation: Use bar colors to qualify expansion: Green/Red indicate expansion aligned with trend thrust; Yellow/Blue flag weaker/contrarian thrust during expansion.
3. Multi-timeframe analysis: Run calculations on a higher TF (e.g., H1/H4) while trading a lower TF chart to smooth noise.
Alerts:
* Diff crosses above/below 0.
* Average Diff crosses above/below 0.
* State changes: GREEN / RED / YELLOW / BLUE.
Notes & limitations:
* VWAP is session-anchored and best on intraday data. If not applicable on the selected calculation TF, the script automatically falls back to EMA.
* Default parameters (SMA(20) for BB/KC, multipliers 2.0, SMA(5) smoothing, trend logic and bar painting) preserve the original appearance.
Release notes:
v6.0 — Rewritten in Pine v6 with structured inputs and guards. Multi-MA support (SMA/EMA/WMA/RMA/HMA/VWMA/VWAP). Calculation timeframe via request.security() for multi-TF workflows. Safe division; optional zero line; optional true Blue color. Original visuals and behavior preserved by default.
License / disclaimer:
© waranyu.trkm — MIT License. Educational use only; not financial advice.