Support & Resistance by WhalesDesk Support & Resistance by whales Desk.
This indicates mark automatically Support & Resistance on chart.
Hareketli Ortalamalar
Andean Pulse Oscillator [APO] Andean Pulse Oscillator (APO)
The Andean Pulse Oscillator (APO) is a momentum-based technical indicator designed to detect early shifts in bullish and bearish pressure using adaptive exponential envelopes. Inspired by the original Andean Oscillator concept, this upgraded version maintains the spirit of the tool while improving clarity, responsiveness, and usability.
🧠 Key Features:
Two core components:
🔹 Bullish Component (green) – Measures strength of downward volatility (bullish momentum).
🔻 Bearish Component (red) – Measures strength of upward volatility (bearish momentum).
A Signal Line (orange) smooths the dominant component to help filter out noise.
Background shading provides at-a-glance trend bias: green for bullish dominance, red for bearish.
Optional Buy/Sell Signal Arrows when bullish and bearish lines cross.
⚙️ Inputs:
Length – Controls smoothing sensitivity of the envelope-based momentum calculation.
Signal Length – Controls smoothing of the dominant component (signal line).
Show Buy/Sell Signals – Toggle crossover arrows on or off.
🔍 Usage Tips:
Look for bullish crossovers (green crosses above red) below the zero-line during corrections for potential long setups.
Look for bearish crossunders (red crosses above green) near tops for potential short setups.
Can be combined with price structure, trend filters, or divergence analysis for added confirmation.
👨🎨 Credit:
Originally conceptualized by @Andean, the APO version enhances it with modern visuals, cleaner signals, and modular structure — a tribute to a powerful and underutilized oscillator.
Donchian x WMA Crossover (2025 Only, Adjustable TP, Real OHLC)Short Description:
Long-only breakout system that goes long when the Donchian Low crosses up through a Weighted Moving Average, and closes when it crosses back down (with an optional take-profit), restricted to calendar year 2025. All signals use the instrument’s true OHLC data (even on Heikin-Ashi charts), start with 1 000 AUD of capital, and deploy 100 % equity per trade.
Ideal parameters configured for Temple & Webster on ASX 30 minute candles. Adjust parameter to suit however best to download candle interval data and have GPT test the pine script for optimum parameters for your trading symbol.
Detailed Description
1. Strategy Concept
This strategy captures trend-driven breakouts off the bottom of a Donchian channel. By combining the Donchian Low with a WMA filter, it aims to:
Enter when volatility compresses and price breaks above the recent Donchian Low while the longer‐term WMA confirms upward momentum.
Exit when price falls back below that same WMA (i.e. when the Donchian Low crosses back down through WMA), but only if the WMA itself has stopped rising.
Optional Take-Profit: you can specify a profit target in decimal form (e.g. 0.01 = 1 %).
2. Timeframe & Universe
In-sample period: only bars stamped between Jan 1 2025 00:00 UTC and Dec 31 2025 23:59 UTC are considered.
Any resolution (e.g. 30 m, 1 h, D, etc.) is supported—just set your preferred timeframe in the TradingView UI.
3. True-Price Execution
All indicator calculations (Donchian Low, WMA, crossover checks, take-profit) are sourced from the chart’s underlying OHLC via request.security(). This guarantees that:
You can view Heikin-Ashi or other styled candles, but your strategy will execute on the real OHLC bars.
Chart styling never suppresses or distorts your backtest results.
4. Position Sizing & Equity
Initial capital: 1 000 AUD
Size per trade: 100 % of available equity
No pyramiding: one open position at a time
5. Inputs (all exposed in the “Inputs” tab):
Input Default Description
Donchian Length 7 Number of bars to calculate the Donchian channel low
WMA Length 62 Period of the Weighted Moving Average filter
Take Profit (decimal) 0.01 Exit when price ≥ entry × (1 + take_profit_perc)
6. How It Works
Donchian Low: ta.lowest(low, DonchianLength) over the specified look-back.
WMA: ta.wma(close, WMALength) applied to true closes.
Entry: ta.crossover(DonchianLow, WMA) AND barTime ∈ 2025.
Exit:
Cross-down exit: ta.crossunder(DonchianLow, WMA) and WMA is not rising (i.e. momentum has stalled).
Take-profit exit: price ≥ entry × (1 + take_profit_perc).
Calendar exit: barTime falls outside 2025.
7. Usage Notes
After adding to your chart, open the Strategy Tester tab to review performance metrics, list of trades, equity curve, etc.
You can toggle your chart to Heikin-Ashi for visual clarity without affecting execution, thanks to the real-OHLC calls.
BACAP PRICE STRUCTURE 21 EMA TREND21dma-STRUCTURE
Overview
The 21dma-STRUCTURE indicator is a sophisticated overlay indicator that visualizes price action relative to a triple 21-period exponential moving average structure. Originally developed by BalarezoCapital and enhanced by PrimeTrading, this indicator provides clear visual cues for trend direction and momentum through dynamic bar coloring and EMA structure analysis.
Key Features
Triple EMA Structure
- 21 EMA High: Tracks the exponential moving average of high prices
- 21 EMA Close: Tracks the exponential moving average of closing prices
- 21 EMA Low: Tracks the exponential moving average of low prices
- Dynamic Cloud: Gray fill between high and low EMAs for visual structure reference
Smart Bar Coloring System
- Blue Bars: Price closes above all three EMAs (strong bullish momentum)
- Pink Bars: Daily high falls below the lowest EMA (strong bearish signal)
- Gray Bars: Neutral conditions or transitional phases
- Color Memory: Maintains previous color until new condition is met
Dynamic Center Line
- Trend-Following Color: Green when all EMAs are rising, red when all are falling
- Color Persistence: Maintains trend color during sideways movement
- Visual Clarity: Thicker center line for easy trend identification
Customizable Visual Elements
- Adjustable line thickness for all EMA plots
- Customizable colors for bullish and bearish conditions
- Configurable trend colors for uptrend and downtrend phases
- Optional bar color changes with toggle control
How to Use
Trend Identification
- Rising Green Center Line: All EMAs trending upward (bullish structure)
- Falling Red Center Line: All EMAs trending downward (bearish structure)
- Flat Center Line: Maintains last trend color during consolidation
Momentum Analysis
- Blue Bars: Strong bullish momentum with price above entire EMA structure
- Pink Bars: Strong bearish momentum with high below lowest EMA
- Gray Bars: Neutral or transitional momentum phases
Entry and Exit Signals
- Bullish Setup: Look for blue bars during green center line periods
- Bearish Setup: Look for pink bars during red center line periods
- Exit Consideration: Watch for color changes as potential momentum shifts
Structure Trading
- Support/Resistance: Use EMA cloud as dynamic support and resistance zones
- Breakout Confirmation: Bar color changes can confirm structure breakouts
- Trend Continuation: Color persistence suggests ongoing momentum
Settings
Visual Customization
- Change Bar Color: Toggle to enable/disable bar coloring
- Line Size: Adjust thickness of EMA lines (default: 3)
- Bullish Candle Color: Customize blue bar color
- Bearish Candle Color: Customize pink bar color
Trend Colors
- Uptrend Color: Color for rising EMA center line (default: green)
- Downtrend Color: Color for falling EMA center line (default: red)
- Cloud Color: Fill color between high and low EMAs (default: gray)
Advanced Features
Modified Bar Logic
Unlike traditional EMA systems, this indicator uses refined conditions:
- Bullish signals require close above ALL three EMAs
- Bearish signals require high below the LOWEST EMA
- Enhanced precision reduces false signals compared to single EMA systems
Trend Memory System
- Intelligent color persistence during sideways movement
- Reduces noise from minor EMA fluctuations
- Maintains trend context during consolidation periods
Performance Optimization
- Efficient calculation methods for real-time performance
- Clean visual design that doesn't clutter charts
- Compatible with all timeframes and instruments
Best Practices
Multi-Timeframe Analysis
- Use higher timeframes to identify overall trend direction
- Apply on multiple timeframes for confluence
- Combine with weekly/monthly charts for position trading
Risk Management
- Use bar color changes as early warning signals
- Consider position sizing based on EMA structure strength
- Set stops relative to EMA support/resistance levels
Combination Strategies
- Pair with volume indicators for confirmation
- Use alongside RSI or MACD for momentum confirmation
- Combine with key support/resistance levels
Market Context
- More effective in trending markets than choppy conditions
- Consider overall market environment and sector strength
- Adjust expectations during high volatility periods
Technical Specifications
- Based on 21-period exponential moving averages
- Uses Pine Script v6 for optimal performance
- Overlay indicator that works with any chart type
- Maximum 500 lines for clean performance
Ideal Applications
- Swing trading on daily charts
- Position trading on weekly charts
- Intraday momentum trading (adjust timeframe accordingly)
- Trend following strategies
- Structure-based trading approaches
Disclaimer
This indicator is for educational and informational purposes only. It should not be used as the sole basis for trading decisions. Always combine with other forms of analysis, proper risk management, and consider your individual trading plan and risk tolerance.
Compatible with Pine Script v6 | Works on all timeframes | Optimized for trending markets
SMEMA Trend CoreSMEMA Trend Core is a multi-timeframe trend analysis tool designed to provide a clean, adaptive and structured view of the market’s directional bias. It can be used in short term, swing or long term contexts. The internal calculation adjusts automatically based on the selected trading style, while always combining data from six timeframes.
At its core, the indicator uses a SMEMA, which is a Simple Moving Average applied to an EMA. This combination improves smoothness without losing reactivity. The SMEMA is calculated separately on 1H, 4H, 1D, 3D, 1W and 1M timeframes. These six values are then combined using dynamic weights that depend on the trading mode:
Short Term mode gives more influence to 1H and 4H
Swing Trading mode gives more influence to 1D, 3D and 1W
Long Term mode gives more influence to 1W and 1M
However, all six timeframes are always included in the final result. This avoids the tunnel vision of relying on a single resolution and ensures that the indicator captures both local and structural movements.
The result is a synthetic trend line, called Global SMEMA, that adapts to market conditions and offers a realistic view of the ongoing trend. To enhance the reading, the indicator calculates a Trend Score. This score reflects the position of price relative to the Global SMEMA, scaled by a long-term ATR, and adjusted by the slope of the trend line. A hyperbolic tangent function is used to normalize values and reduce distortion from outliers.
The final score is capped between -10 and +10, and used to define the trend state:
Green when the trend is bullish (score > +1.5)
Red when the trend is bearish (score < -1.5)
Brown when the trend is neutral (score between -1.5 and +1.5)
Optional Deviation Bands can be displayed at ±1, ±2 and ±3 ATR distances around the central line. These dynamic zones help identify extended price movements or potential support and resistance areas, depending on the current trend bias.
Main features:
A single, stable trend line based on six timeframes
Automatic rebalancing depending on trading mode
Quantified score integrating distance and slope
No overreaction to short-term noise
Deviation zones for advanced market context
No repainting, no lookahead, 100% real-time
SMEMA Trend Core is not a signal tool. It is a directional framework that helps you stay aligned with the real structure of the market. Use it to confirm setups, filter trades or simply understand where the market stands in its trend cycle.
Multi-Timeframe 20 EMA Horizontal LinesOverview
This Multi-Timeframe 20 EMA indicator provides intelligent trend analysis by displaying your current timeframe EMA alongside relevant higher timeframe EMA levels as horizontal support/resistance lines. On lower timeframes, you see all higher EMA levels for comprehensive multi-timeframe confluence, while on higher timeframes, it filters out lower timeframe noise to maintain focus on macro trends. This allows traders to align short-term entries with long-term market structure, identifying high-probability setups where multiple timeframe EMAs converge while using the current timeframe EMA for precise timing.
Feature
Multi-Timeframe Horizontal EMA Lines
The indicator fetches and displays 20 EMAs from five higher timeframes:
Daily (D): Daily 20 EMA
Weekly (W): Weekly 20 EMA
Monthly (M): Monthly 20 EMA
Quarterly (Q): 3-Month 20 EMA
Half-Yearly (HY): 6-Month 20 EMA
Intelligent Timeframe Filtering
Smart Display Logic: Only shows EMAs from timeframes higher than your current chart timeframe
Prevents Redundancy: Automatically filters out lower timeframe EMAs to avoid clutter
Example: On a 4-hour chart, you'll see Daily, Weekly, Monthly, Quarterly, and Half-Yearly EMAs, but on a Weekly chart, you'll only see Weekly and higher timeframes
Half-Yearly (HY): 6-Month 20 EMA
Shows only current timeframe EMA with half-yearly horizontal line, filtering out all lower timeframes.
Quarterly (Q): 3-Month 20 EMA
Displays current timeframe EMA with quarterly and higher horizontal lines, hiding monthly, weekly, and daily EMAs.
Monthly (M): Monthly 20 EMA
Shows current timeframe EMA with monthly and higher horizontal EMAs, excluding weekly and daily timeframes.
Weekly (W): Weekly 20 EMA
Displays current timeframe EMA with weekly and higher horizontal EMA lines, filtering out daily timeframe.
Daily (D):
Shows current timeframe EMA with all higher timeframe horizontal EMAs (daily, weekly, monthly, quarterly, half-yearly).
Note: Make sure to enable Price-Line in Style Settings after Importing Script.
Gold $15 Trend Continuation Alert🔔 Gold $15 Trend Continuation Alert (EMA Filtered)
This script helps identify high-probability trend continuation setups on XAUUSD (Gold), using price action + EMA confluence.
🔹 Logic:
Detects a $15+ directional move in the past hour
Confirms shallow pullback (<33%)
Price must align with EMA13, EMA50, and EMA200 in the same direction
Plots a single BUY (green label) or SELL (red label) alert only once per move
Includes visual EMA overlay
✅ Buy Conditions:
Price has risen $15 from local low
Pullback is shallow
Price is above all 3 EMAs
✅ Sell Conditions:
Price has dropped $15 from local high
Pullback is shallow
Price is below all 3 EMAs
Use this with caution on volatile news days. Best suited during trending London/NY sessions.
MES Scalping AI IndicatorScalping the MES (Micro E-mini S&P 500) futures market on a 1-5 minute timeframe requires a disciplined, high-speed approach to capture small price movements. Below is a straightforward and effective scalping strategy tailored for MES futures, focusing on technical indicators, precise entry/exit rules, and robust risk management. This strategy is designed for traders comfortable with fast-paced environments and assumes access to a reliable trading platform with real-time data
Color Change EMA 200 (4H)200 Color Change EMA (4H Locked)
Overview
This indicator displays a 200-period Exponential Moving Average (EMA) that is locked to the 4-hour timeframe, regardless of what chart timeframe you're currently viewing. The EMA line changes color dynamically based on price action to provide clear visual trend signals.
Key Features
• Multi-Timeframe Capability : Always shows the 4H 200 EMA on any chart timeframe
• Dynamic Color Coding :
- Green: Price is above the 200 EMA (bullish condition)
- Red: Price is below the 200 EMA (bearish condition)
• Clean Visual Design : Bold 2-pixel line width for clear visibility
• Real-time Updates : Colors change instantly as price crosses above or below the EMA
How to Use
1. Add the indicator to any timeframe chart
2. The 4H 200 EMA will appear as a smooth line
3. Watch for color changes:
- When the line turns green, it indicates price strength above the key moving average
- When the line turns red, it suggests price weakness below the moving average
4. Use for trend identification, support/resistance levels, and entry/exit timing
Best Practices
• Combine with other technical analysis tools for confirmation
• Use the color changes as alerts for potential trend shifts
• Consider the 200 EMA as a major support/resistance level
• Works well for swing trading and position sizing decisions
Settings
• Length : Default 200 periods (customizable)
• Source : Default closing price (customizable)
Perfect for traders who want to keep the important 4H 200 EMA visible across all timeframes with instant visual trend feedback.
Babil34 Comparative Average PanelBabil34 Comparative Average Panel is an advanced moving averages dashboard that allows you to add and compare up to 5 EMAs, 5 DEMAs, and 5 SMAs simultaneously.
You can independently set the period, source, and timeframe for each average. With its colorful table and optional labels, you can easily observe the differences, trend changes, and crossovers between all averages at a glance.
It is suitable for both short-term and long-term strategies and lets you monitor multiple averages side by side.
Key Features:
Support for up to 5 independent EMAs, 5 DEMAs, and 5 SMAs
Multi-timeframe and multi-source selection
Clean, colorful table visualization
Toggleable labels and table for flexibility
Compatible with all markets and timeframes
Enhanced visual and technical analysis
This panel is specifically designed for traders who want to compare different types and periods of moving averages at a glance.
SMA 5 & 50 Up and Down VisualisationIntroducing the TomTurboInvest TTI_SMA_5/50 Indicator – a powerful tool designed to identify short- and mid-term trends with ease. The indicator highlights upward and downward movements, visually supported by background colors for clearer trend recognition.
If both SMA5 and SMA50 are upwards the background is colored in green
If both SMA5 and SMA50 are downwards the background is colored in red
Chebyshev-Gauss Moving AverageThis indicator applies the principles of Chebyshev-Gauss Quadrature to create a novel type of moving average. Inspired by reading rohangautam.github.io
What is Chebyshev-Gauss Quadrature?
It's a numerical method to approximate the integral of a function f(x) that is weighted by 1/sqrt(1-x^2) over the interval . The approximation is a simple sum: ∫ f(x)/sqrt(1-x^2) dx ≈ (π/n) * Σ f(xᵢ) where xᵢ are special points called Chebyshev nodes.
How is this applied to a Moving Average?
A moving average can be seen as the "mean value" of the price over a lookback window. The mean value of a function with the Chebyshev weight is calculated as:
Mean = /
The math simplifies beautifully, resulting in the mean being the simple arithmetic average of the function evaluated at the Chebyshev nodes:
Mean = (1/n) * Σ f(xᵢ)
What's unique about this MA?
The Chebyshev nodes xᵢ are not evenly spaced. They are clustered towards the ends of the interval . We map this interval to our lookback period. This means the moving average samples prices more intensely from the beginning and the end of the lookback window, and less intensely from the middle. This gives it a unique character, responding quickly to recent changes while also having a long "memory" of the start of the trend.
Chebyshev-Gauss Convergence DivergenceThe Chebyshev-Gauss Convergence Divergence is a momentum indicator that leverages the Chebyshev-Gauss Moving Average (CG-MA) to provide a smoother and more responsive alternative to traditional oscillators like the MACD. For more information see the moving average script:
How it works:
It calculates a fast CG-MA and a slow CG-MA. The CG-MA uses Gauss-Chebyshev quadrature to compute a weighted average, which can offer a better trade-off between lag and smoothness compared to simple or exponential MAs.
The Oscillator line is the difference between the fast CG-MA and the slow CG-MA.
A Signal Line, which is a simple moving average of the Oscillator line, is plotted to show the average trend of the oscillator.
A Histogram is plotted, representing the difference between the Oscillator and the Signal Line. The color of the histogram bars changes to indicate whether momentum is strengthening or weakening.
How to use:
Crossovers: A buy signal can be generated when the Oscillator line crosses above the Signal line. A sell signal can be generated when it crosses below.
Zero Line: When the Oscillator crosses above the zero line, it indicates upward momentum (fast MA is above slow MA).When it crosses below zero, it indicates downward momentum.
Divergence: Like with the MACD, look for divergences between the oscillator and price action to spot potential reversals.
Histogram: The histogram provides a visual representation of the momentum. When the bars are growing, momentum is increasing. When they are shrinking, momentum is fading.
Kenan Ortalama Göstergesi [16 MA] All averages are in a single indicator, 4 from each average, you can change the colors as you wish.
200 EMA Trend Direction [Dr.K.C.Prakash]📘 Indicator Description: 200 EMA Trend Direction
The "200 EMA Trend Direction " indicator is a visual trend-following tool designed to identify and confirm major market direction using the slope of the 200-period Exponential Moving Average (EMA). It’s ideal for traders who want to stay on the right side of the trend and avoid noise.
🔍 Key Components
1. 200 EMA (Exponential Moving Average)
The 200 EMA is a widely used long-term trend indicator in technical analysis.
It reacts faster than the simple moving average (SMA) due to its weighting toward recent prices.
2. Trend Detection Logic
Uptrend is detected when the current EMA value is higher than the previous candle’s EMA.
Downtrend is detected when the EMA starts sloping downward, i.e., current EMA < previous EMA.
🎨 Visual Representation
Green EMA Line: Indicates the 200 EMA is rising → bullish trend (uptrend).
Red EMA Line: Indicates the 200 EMA is falling → bearish trend (downtrend).
This color-coding helps you instantly understand the market context without needing to analyze multiple indicators.
✅ Best Use Cases
📈 Trend Confirmation: Use it to confirm the direction before entering a trade.
⚠️ Avoid Counter-Trend Trades: Helps in staying aligned with the dominant trend.
🧠 Supports All Timeframes: Although best suited for 5m, 15m, or higher, it can also be used for 1-minute charts in scalping systems when aligned with higher timeframes.
⚙️ Customization Possibilities
You can extend this indicator with:
🔔 Trend change alerts
🟩🟥 Background shading based on trend
💹 Buy/Sell signals when price crosses above/below the 200 EMA
Macro Dashboard Multi-TickerThis indicator gives you a compact, high-impact overview of up to 10 custom assets — showing whether each is currently trading above or below a key moving average on a shared timeframe.
🟩 Above MA = colored bar
⬛ Below MA = dimmed bar
Features:
Monitor up to 10 symbols (stocks, crypto, ETFs, etc.)
Customize:
- Symbol
- Color
- Timeframe
- MA type (EMA/SMA)
- MA length
Shared logic keeps the layout clean and consistent.
Use Cases:
- Build a macro trend dashboard for SPY, QQQ, BTC, ETH, ARKK, IWM, DXY, VIX, etc.
- Confirm risk-on alignment
- Identify broad market rotation or weakness
- Pair with individual asset setups to stay in sync with the environment
This tool is ideal for traders who want a one-glance check on market strength without cluttering their main charts. It's fast, flexible, and highly visual.
Smart Money Index (SMI) EnhancedSmart Money Index (SMI) Enhanced is an indicator that visualizes the behavior of "smart money" based on intraday price movements.
📌 Based on Don Hays’ classic formula:
SMI = Yesterday’s value – Morning movement + Late-day movement
🔍 Key Features:
Highlighted buy/sell zones for accumulation and distribution;
Alerts for crossovers between SMI and its moving average;
Supports multiple timeframes (hourly, daily, weekly).
✅ Useful for identifying institutional sentiment and potential market reversal points.
ℹ️ Works with stocks, indices, and cryptocurrencies.
This script is for educational purposes only and not financial advice.
EMA-MACD-Stoch by PashaThis indicator combines three popular technical analysis tools — EMA, MACD, and Stochastic — to generate strong and filtered buy/sell signals. It incorporates its own strategic logic and provides trade suggestions only when multiple confirmations align.
Developed by Mehmet (alias: Pasha), this indicator is designed for users seeking short-term entries in markets like BIST. It performs most effectively on the 30-minute timeframe, but can also be used across different timeframes.
Multi MA 10 Lines PRO (Custom Label + Crossover Icon)Multi MA 10 Lines PRO – 10 Custom MAs, Dynamic Labels & Persistent Crossover Symbols
The ultimate professional Moving Average indicator — plot up to 10 fully customizable MAs (type, timeframe, color, width, style), display live price labels (value, % distance, or custom text), plus advanced ATR cross markers on every crossover (MA1/MA2).
NEW: All MA crossovers are marked with persistent symbols (choose icon, color, size) — instantly spot every golden/death cross in your backtest! Complete flexibility for scalpers, swing traders, and serious strategists.
Simplified STH-MVRVSTH-MVRV for MSTR
STH-MVRV compares the Market Value (current price × circulating supply) to the Realized Value (the total cost basis of coins held by short-term holders,
21EMA Pullback (Simple)✅ Simplified 21EMA Pullback Screener (with Alert + Screener Output)
Criteria:
9EMA > 21EMA
21EMA > 50SMA
Price has either:
Touched the 21EMA (i.e., price's low ≤ 21EMA ≤ high), OR
Pierced and reclaimed (low < 21EMA and close > 21EMA)
Breakout Strategy with EMA & VolumeA breakout strategy combined with EMA and Volume data to give you the best results.
Indicator includes:
EMA 20 and EMA 50
Volume indicator
RSI (14)
EMA Crossover + SuperTrend Retest//@version=5
indicator("EMA Crossover + SuperTrend Retest", overlay=true)
// Inputs for SuperTrend
atrLength = input.int(10, "ATR Length", minval=1)
Factor = input.float(3.0, "SuperTrend Multiplier", step=0.1)
// Calculate EMAs
ema13 = ta.ema(close, 13)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
// Calculate SuperTrend
= ta.supertrend(Factor, atrLength)
// Plot EMAs
plot(ema13, "EMA 13", color=color.new(#FF6D00, 0))
plot(ema50, "EMA 50", color=color.new(#2962FF, 0))
plot(ema200, "EMA 200", color=color.new(#00BFA5, 0))
// Plot SuperTrend
plot(supertrend, "SuperTrend",
color=direction == 1 ? color.rgb(230, 13, 13) : color.rgb(17, 255, 0),
linewidth=2)
// Trend Conditions
uptrendFilter = ema50 > ema200 and close > supertrend
downtrendFilter = ema50 < ema200 and close < supertrend
// Crossover Conditions with Trend Filter
bullishCross = ta.crossover(ema13, ema50) and uptrendFilter
bearishCross = ta.crossunder(ema13, ema50) and downtrendFilter
// Retest Conditions (Both EMAs and SuperTrend)
bullishRetest = bullishCross and
(low <= ema50) and
(low <= ema200) and
(low <= supertrend)
bearishRetest = bearishCross and
(high >= ema50) and
(high >= ema200) and
(high >= supertrend)
// Plot Signals
plotshape(bullishRetest, "Bullish Signal", shape.triangleup,
location.belowbar, color=color.green, size=size.small)
plotshape(bearishRetest, "Bearish Signal", shape.triangledown,
location.abovebar, color=color.red, size=size.small)
// Alert Conditions
alertcondition(bullishRetest, "Bullish Alert",
"EMA13↑50 + Retest 50/200/SuperTrend")
alertcondition(bearishRetest, "Bearish Alert",
"EMA13↓50 + Retest 50/200/SuperTrend")