Triple Trend Indicator [BigBeluga]Triple Trend Indicator is a versatile trend-following tool designed to help traders identify trend strength and potential pullback levels using a three-band system. Each band represents a varying degree of price deviation from the mean, providing progressively stronger trend signals.
🔵 Key Features:
Three Adaptive Bands:
The indicator dynamically calculates three bands (1, 2, and 3) based on moving averages (SMA, EMA, WMA) and ATR multipliers.
Bands are positioned below the price in an uptrend and above the price in a downtrend, offering clear trend direction visualization.
Signal System:
Signals are generated when price interacts with the bands:
Signal 1: Triggered when the price touches Band 1, indicating a minor pullback within the trend.
Signal 2: Triggered at Band 2, showing a stronger price deviation and trend confirmation.
Signal 3: Triggered at Band 3, representing the most significant price deviation and strongest trend signal.
The further the price deviates from the mean, the stronger the trend signal, with Signal 3 being the most robust.
Color-Coded Bands:
Bands dynamically change color based on the trend direction:
Green bands signify an uptrend.
Brown bands signify a downtrend.
Dynamic Trend Line Changes:
Dashed lines highlight trend changes, helping traders visualize key turning points in the market.
🔵 Usage:
Use the bands to identify trend direction and strength.
Monitor the signal system to assess the level of price deviation and potential pullback strength.
Combine Signal 1, 2, and 3 to confirm trend momentum:
Signal 1 suggests a weaker pullback and continuation.
Signal 2 indicates a stronger trend confirmation.
Signal 3 highlights the strongest momentum and potential exhaustion points.
Utilize the color-coded bands for an intuitive understanding of current market conditions.
The Triple Trend Indicator is an ideal tool for trend traders looking for structured signals and dynamic support and resistance levels to optimize entries and exits.
Bands and Channels
Azhar Quantum Scalper EliteStrategy Title: Azhar Quantum Scalper Elite
By Azhar Saleem
Strategy Overview
The Azhar Quantum Scalper Elite is a high-precision trading strategy designed for scalpers and intraday traders in volatile markets like cryptocurrencies. Developed by Azhar Saleem, this strategy combines institutional-grade technical analysis with advanced risk management to deliver high-probability signals across 1-minute to 1-hour timeframes.
Key Features
✅ Multi-Timeframe Confirmation
Aligns 1m/5m entries with 15-minute trend direction for institutional-level accuracy.
✅ High-Accuracy Signals
Strong Buy/Sell: Combines EMA crossover, RSI divergence, Keltner Channels, and volume surges.
Basic Buy/Sell: Momentum-based entries with trend confirmation.
✅ Volatility-Adaptive Entries
Uses Keltner Channels (ATR-based) instead of Bollinger Bands for better crypto market performance.
✅ Smart Risk Management
Dynamic stop-loss (1.2x ATR)
Dual take-profit levels (2.5x and 4x ATR)
Trailing stops for maximizing runners
✅ Volume-Validated Signals
Requires 1.5x average volume to confirm breakouts and reversals.
Strategy Components
Trend Filter
EMA Cross (9-period vs. 21-period)
VWAP alignment for institutional bias confirmation
Momentum Engine
MACD crossover with slope confirmation
RSI divergence detection for early reversals
Volatility Framework
Keltner Channels (20-period EMA + 1.5x ATR)
Price-at-edge detection for mean reversion
Volume Surge System
20-period volume average + spike threshold
Multi-Timeframe Alignment
15-minute trend filter (50-period EMA)
Risk Management
Max Risk Per Trade: 1-2% equity (auto-adjusted for leverage)
Stop-Loss: 1.2x ATR below/above entry
Take-Profit:
TP1: 2.5x ATR (secure 50% profits)
TP2: 4x ATR with trailing stop (let winners ride)
Recommended Settings
Best For: BTC/USDT, ETH/USDT, XRP/USDT (1m-15m charts)
Leverage: Up to 20x (built-in risk controls)
Trading Hours: High-volume sessions (London/NYC overlap)
Why Choose This Strategy?
Award-Winning Design: Optimized for crypto volatility and leverage trading.
Proven Performance: 85%+ win rate in 2023-2024 backtests (BTC 1m data).
Clear Visuals:
🟢 Strong Buy/Sell labels for high-confidence entries
🔵 Keltner Channel boundaries for volatility zones
How to Use
Apply to 1m/5m charts of liquid crypto pairs.
Wait for STRONG BUY/SELL labels near Keltner edges.
Use 20x leverage cautiously (risk ≤1% per trade).
Trail profits using TP2’s auto-offset feature.
Author’s Note
"This strategy is the culmination of 3 years of crypto scalping research. Always combine it with liquidity analysis and avoid trading during low-volume hours."
Azhar Saleem
Disclaimer:
No strategy guarantees profits. Always test in a demo account first. Past performance ≠ future results. Use proper risk management.
#Scalping #Crypto #DayTrading #QuantStrategy #AzharSaleem #LeverageTrading
VWAP Bands with ML [CryptoSea]VWAP Machine Learning Bands is an advanced indicator designed to enhance trading analysis by integrating VWAP with a machine learning-inspired adaptive smoothing approach. This tool helps traders identify trend-based support and resistance zones, predict potential price movements, and generate dynamic trade signals.
Key Features
Adaptive ML VWAP Calculation: Uses a dynamically adjusted SMA-based VWAP model with volatility sensitivity for improved trend analysis.
Forecasting Mechanism: The 'Forecast' parameter shifts the ML output forward, providing predictive insights into potential price movements.
Volatility-Based Band Adjustments: The 'Sigma' parameter fine-tunes the impact of volatility on ML smoothing, adapting to market conditions.
Multi-Tier Standard Deviation Bands: Includes two levels of bands to define potential breakout or mean-reversion zones.
Dynamic Trend-Based Colouring: The VWAP and ML lines change colour based on their relative positions, visually indicating bullish and bearish conditions.
Custom Signal Detection Modes: Allows traders to choose between signals from Band 1, Band 2, or both, for more tailored trade setups.
In the image below, you can see an example of the bands on higher timeframe showing good mean reversion signal opportunities, these tend to work better in ranging markets rather than strong trending ones.
How It Works
VWAP & ML Integration: The script computes VWAP and applies a machine learning-inspired adjustment using SMA smoothing and volatility-based adaptation.
Forecasting Impact: The 'Forecast' setting shifts the ML output forward in time, allowing for anticipatory trend analysis.
Volatility Scaling (Sigma): Adjusts the ML smoothing sensitivity based on market volatility, providing more responsive or stable trend lines.
Trend Confirmation via Colouring: The VWAP line dynamically switches colour depending on whether it is above or below the ML output.
Multi-Level Band Analysis: Two standard deviation-based bands provide a framework for identifying breakouts, trend reversals, or continuation patterns.
In the example below, we can see some of the most reliable signals where we have mean reversion signals from the band whilst the price is also pulling back into the VWAP, these signals have the additional confluence which can give you a higher probabilty move.
Alerts
Bullish Signal Band 1: Alerts when the price crosses above the lower ML Band 1.
Bearish Signal Band 1: Alerts when the price crosses below the upper ML Band 1.
Bullish Signal Band 2: Alerts when the price crosses above the lower ML Band 2.
Bearish Signal Band 2: Alerts when the price crosses below the upper ML Band 2.
Filtered Bullish Signal: Alerts when a bullish signal is triggered based on the selected signal detection mode.
Filtered Bearish Signal: Alerts when a bearish signal is triggered based on the selected signal detection mode.
Application
Trend & Momentum Analysis: Helps traders identify key market trends and potential momentum shifts.
Dynamic Support & Resistance: Standard deviation bands serve as adaptive price zones for potential breakouts or reversals.
Enhanced Trade Signal Confirmation: The integration of ML smoothing with VWAP provides clearer entry and exit signals.
Customizable Risk Management: Allows users to adjust parameters for fine-tuned signal detection, aligning with their trading strategy.
The VWAP Machine Learning Bands indicator offers traders an innovative tool to improve market entries, recognize potential reversals, and enhance trend analysis with intelligent data-driven signals.
Machine Learning SupertrendThe Machine Learning Supertrend is an advanced trend-following indicator that enhances the traditional Supertrend with Gaussian Process Regression (GPR) and kernel-based learning. Unlike conventional methods that rely purely on historical ATR values, this indicator integrates machine learning techniques to dynamically estimate volatility and forecast future price movements, resulting in a more adaptive and robust trend detection system.
At the core of this indicator lies Gaussian Process Regression (GPR), which utilizes a Radial Basis Function (RBF) kernel to model price distributions and anticipate future trends. Instead of simply looking at past price action, it constructs a kernel matrix, enabling a probabilistic approach to price forecasting. This allows the indicator to not only detect current trends but also project potential trend reversals with greater accuracy.
By applying machine learning to ATR estimation, the ML Supertrend dynamically adjusts its thresholds based on predicted values rather than a fixed multiplier. This makes the trend signals more responsive to market conditions, reducing false signals and minimizing whipsaws often seen with traditional Supertrend indicators. The upper and lower bands are no longer static but evolve based on the underlying price structure, improving the reliability of trend shifts.
When the price crosses these adaptive levels, the indicator detects a trend change and plots it accordingly. Green signifies a bullish trend, while red indicates a bearish one. Alerts can also be triggered when the trend shifts, allowing traders to react quickly to potential reversals.
What makes this approach powerful is its ability to adapt to different market conditions. Traditional ATR-based methods use fixed parameters that might not always be optimal, whereas this ML-driven Supertrend continuously refines its estimations based on real-time data. The result is a more intelligent, less lagging, and highly adaptive trend-following tool.
This indicator is particularly useful for traders looking to enhance trend-following strategies with AI-driven insights. It reduces noise, improves signal reliability, and even offers a degree of trend forecasting, making it ideal for those who want a more advanced and dynamic alternative to standard Supertrend indicators.
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, and past performance is not indicative of future results. Trading involves risk, and users should conduct their own research and use proper risk management before making investment decisions.
Smart Money Breakouts [ChartPrime] with alertSmart Money Breakouts with alert Smart Money Breakouts with alertSmart Money Breakouts with alertSmart Money Breakouts with alertSmart Money Breakouts with alert
kellev1fena bir indikatör kullanmanızı tavsiye ederim İÇERİK OLARAK ZENGİN BİR İNDİKATÖR OLUP YUKARIDAN VE AŞŞAĞIDAN AL SAT SİNYALLERİNİ VERMEKTEDİR. bu tam olarak size bir trade yöntemi değil akıl vermek icin tasarlanmış olup asıl yazarı LUX tur
NEVER BROKE AGAINAlert Signal fo US30 to indicator HH and HL indicator is the best in 5min time frame created by PXYCO
Ultimate Stochastics Strategy by NHBprod Use to Day Trade BTCHey All!
Here's a new script I worked on that's super simple but at the same time useful. Check out the backtest results. The backtest results include slippage and fees/commission, and is still quite profitable. Obviously the profitability magnitude depends on how much capital you begin with, and how much the user utilizes per order, but in any event it seems to be profitable according to backtests.
This is different because it allows you full functionality over the stochastics calculations which is designed for random datasets. This script allows you to:
Designate ANY period of time to analyze and study
Choose between Long trading, short trading, and Long & Short trading
It allows you to enter trades based on the stochastics calculations
It allows you to EXIT trades using the stochastics calculations or take profit, or stop loss, Or any combination of those, which is nice because then the user can see how one variable effects the overall performance.
As for the actual stochastics formula, you get control, and get to SEE the plot lines for slow K, slow D, and fast K, which is usually not considered.
You also get the chance to modify the smoothing method, which has not been done with regular stochastics indicators. You get to choose the standard simple moving average (SMA) method, but I also allow you to choose other MA's such as the HMA and WMA.
Lastly, the user gets the option of using a custom trade extender, which essentially allows a buy or sell signal to exist for X amount of candles after the initial signal. For example, you can use "max bars since signal" to 1, and this will allow the indicator to produce an extra sequential buy signal when a buy signal is generated. This can be useful because it is possible that you use a small take profit (TP) and quickly exit a profitable trade. With the max bars since signal variable, you're able to reenter on the next candle and allow for another opportunity.
Let me know if you have any questions! Please take a look at the performance report and let me know your thoughts! :)
Estructura de Mercado - SMC//@version=5
indicator("Estructura de Mercado - SMC", overlay=true)
// Identificar altos y bajos del mercado
hh = ta.highest(high, 20)
ll = ta.lowest(low, 20)
// Detectar cambio de estructura (BOS - Break of Structure)
bos_alcista = high > ta.highest(high , 20)
bos_bajista = low < ta.lowest(low , 20)
// Detectar cambio de carácter (CHoCH - Change of Character)
choch_alcista = low > ta.lowest(low , 10) and close > open
choch_bajista = high < ta.highest(high , 10) and close < open
// Dibujar señales BOS
plotshape(series=bos_alcista, location=location.abovebar, color=color.blue, style=shape.labelup, title="BOS Alcista")
plotshape(series=bos_bajista, location=location.belowbar, color=color.orange, style=shape.labeldown, title="BOS Bajista")
// Dibujar señales CHoCH
plotshape(series=choch_alcista, location=location.abovebar, color=color.green, style=shape.triangleup, title="CHoCH Alcista")
plotshape(series=choch_bajista, location=location.belowbar, color=color.red, style=shape.triangledown, title="CHoCH Bajista")
// Dibujar niveles clave de estructura
plot(hh, color=color.purple, title="Alto más alto")
plot(ll, color=color.yellow, title="Bajo más bajo")
Support and Resistance//@version=5
indicator("Fair Value Gaps and Order Blocks", overlay=true)
// Input parameters
fvgLookback = input.int(3, title="FVG Lookback (Candles)", minval=1)
obLookback = input.int(5, title="Order Block Lookback (Candles)", minval=1)
fvgColor = input.color(color.new(color.teal, 80), title="FVG Color")
obBullishColor = input.color(color.new(color.green, 80), title="Bullish OB Color")
obBearishColor = input.color(color.new(color.red, 80), title="Bearish OB Color")
// Fair Value Gap (FVG) Detection
fvgUp = (high < low ) and (low < low ) // Bullish FVG condition
fvgDown = (low > high ) and (high > high ) // Bearish FVG condition
// Plot FVG
if (fvgUp)
label.new(bar_index , na, text="FVG", style=label.style_circle, color=fvgColor, textcolor=color.white, size=size.small)
if (fvgDown)
label.new(bar_index , na, text="FVG", style=label.style_circle, color=fvgColor, textcolor=color.white, size=size.small)
// Order Block (OB) Detection
isBullishOB = (close > open ) and (close > close ) and (open < close ) // Bullish OB condition
isBearishOB = (close < open ) and (close < close ) and (open > close ) // Bearish OB condition
// Plot Order Blocks
if (isBullishOB)
box.new(left=bar_index , right=bar_index, top=high , bottom=low , bgcolor=obBullishColor, border_color=color.green, border_width=1)
if (isBearishOB)
box.new(left=bar_index , right=bar_index, top=high , bottom=low , bgcolor=obBearishColor, border_color=color.red, border_width=1)
trendtrap mkDer Trendline MK ist ein leistungsstarker Indikator zur Identifizierung und Bestätigung langfristiger Markttrends. Er dient als zuverlässige Orientierungshilfe für Trader und Investoren, um die vorherrschende Marktrichtung klar zu erkennen und fundierte Entscheidungen zu treffen.
Durch seine dynamische Anpassungsfähigkeit an Kursbewegungen bietet der Trendline MK eine solide Grundlage für das Timing von Ein- und Ausstiegen. Er hilft dabei, trendstarke Phasen von potenziellen Umkehrpunkten zu unterscheiden und unterstützt so eine nachhaltige Strategie in verschiedensten Marktumfeldern.
Trend & ADX by Gideon for Indian MarketsThis indicator is designed to help traders **identify strong trends** using the **Kalman Filter** and **ADX** (Average Directional Index). It provides **Buy/Sell signals** based on trend direction and ADX strength. I wanted to create something for Indian markets since there are not much available.
In a nut-shell:
✅ **Buy when the Kalman Filter turns green, and ADX is strong.
❌ **Sell when the Kalman Filter turns red, and ADX is strong.
📌 **Ignore signals if ADX is weak (below threshold).
📊 Use on 5-minute timeframes for intraday trading.
------------------------------------------------------------------------
1. Understanding the Indicator Components**
- **Green Line:** Indicates an **uptrend**.
- **Red Line:** Indicates a **downtrend**.
- The **line color change** signals a potential **trend reversal**.
**ADX Strength Filter**
- The **ADX (orange line)** measures trend strength.
- The **blue horizontal line** marks the **ADX threshold** (default: 20).
- A **Buy/Sell signal is only valid if ADX is above the threshold**, ensuring a strong trend.
**Buy & Sell Signals**
- **Buy Signal (Green Up Arrow)**
- Appears **one candle before** the Kalman line turns green.
- ADX must be **above the threshold** (default: 20).
- Suggests entering a **long position**.
- **Sell Signal (Red Down Arrow)**
- Appears **one candle before** the Kalman line turns red.
- ADX must be **above the threshold** (default: 20).
- Suggests entering a **short position**.
2. Best Settings for 5-Minute Timeframe**
For day trading on the **5-minute chart**, the following settings work best:
- **Kalman Filter Length:** `50`
- **Process Noise (Q):** `0.1`
- **Measurement Noise (R):** `0.01`
- **ADX Length:** `14`
- **ADX Threshold:** `20`
- **(Increase to 25-30 for more reliable signals in volatile markets)**
3. How to Trade with This Indicator**
**Entry Rules**
✅ **Buy Entry**
- Wait for a **green arrow (Buy Signal).
- Kalman Line must **turn green**.
- ADX must be **above the threshold** (strong trend confirmed).
- Enter a **long position** on the next candle.
❌ **Sell Entry**
- Wait for a **red arrow (Sell Signal).
- Kalman Line must **turn red**.
- ADX must be **above the threshold** (strong trend confirmed).
- Enter a **short position** on the next candle.
**Exit & Risk Management**
📌 **Stop Loss**:
- Place stop-loss **below the previous swing low** (for buys) or **above the previous swing high** (for sells).
📌 **Take Profit:
- Use a **Risk:Reward Ratio of 1:2 or 1:3.
- Exit when the **Kalman Filter color changes** (opposite trend signal).
📌 **Avoid Weak Trends**:
- **No trades when ADX is below the threshold** (low trend strength).
4. Additional Tips
- Works best on **liquid assets** like **Bank Nifty, Nifty 50, and large-cap stocks**.
- **Avoid ranging markets** with low ADX values (<20).
- Use alongside **volume analysis and support/resistance levels** for confirmation.
- Experiment with **ADX Threshold (increase for stronger signals, decrease for more trades).**
Best of Luck traders ! 🚀
ICT-Yasir Macro TimesICT MACRO TIMES
8:50 to 9:10
9:50 to 10:10
10:50 to 11:10
12:50 to 1:10
1:50 to 2:10
2:50 to 3:10
3:15 to 3:45
3:45 to 4:00
SAJJAD JAMSHIDI Channel with Stochastic RSI StrategyThe Stochastic RSI is a momentum oscillator that applies the stochastic formula to the RSI, identifying overbought (>0.8) and oversold (<0.2) conditions. Traders use it to spot potential reversals by waiting for crossovers back into the normal range. Combining it with other indicators improves accuracy for better trading decisions
50% Fibonacci with Engulfing Candles and Take Profit T+K 4LFThis 50% fib will be like a ema but better and stronger will tell you when to buy and sell. works well with FVG and order blocks for double or triple your win try now.
BTC/USD Enhanced High-Growth Impulse Strategy for 30-Min ChartOverview:
This script combines trend-following and momentum-based entry/exit signals, optimized for BTC/USD on a 30-minute timeframe. It integrates Exponential Moving Averages (EMAs), Supertrend, and Average True Range (ATR) to identify potential trade opportunities with volatility-adjusted risk management.
Indicators Explained:
Exponential Moving Averages (EMAs):
21 EMA (Short-term): Identifies fast-moving price trends.
50 EMA (Medium-term): Captures broader momentum.
200 EMA (Long-term): Filters major market direction.
These EMAs work together to signal trend crossovers, indicating shifts between bullish and bearish phases.
Supertrend:
This indicator highlights momentum and volatility. A positive Supertrend indicates strong upward momentum, while a negative Supertrend signals bearish momentum.
Average True Range (ATR):
ATR helps calculate dynamic stop loss and take profit levels. By adjusting exits to match market volatility, the strategy can respond to both fast-moving and consolidating conditions.
Entry & Exit Conditions:
Long Entry:
The 21 EMA crosses above the 50 EMA.
The price is above the Supertrend line, confirming bullish momentum.
ATR volatility is above its 50-period moving average to filter out low-volatility conditions.
Trade Exit:
A stop loss is set at 2 ATR below the entry price, and the take profit is set at 6 ATR above.
Short Entry:
The 21 EMA crosses below the 50 EMA.
The price is below the Supertrend line, confirming bearish momentum.
ATR volatility exceeds the 50-period moving average.
Trade Exit:
A stop loss is set at 2 ATR above the entry price, and take profit at 6 ATR below.
Default Strategy Settings:
Position Size: 2% of equity per trade (configurable)
Risk Management: Dynamic ATR-based stop loss and take profit
Indicators:
EMA 21, 50, and 200 for trend detection
Supertrend (factor: 3, ATR period: 10) for momentum confirmation
ATR for volatility-based risk control
Performance Metrics:
Optimal Timeframe: 30-minute chart
Backtesting Results:
Percent Profitable: 62%
Profit Factor: 1.136
Average Trade Return: 0.14%
Max Drawdown: 0.58% of equity
Total Trades: 35
The strategy demonstrates stable performance across both trending and volatile market conditions. Keep in mind that past performance does not guarantee future results.
Notes for Traders:
Test this strategy with realistic commission and slippage to ensure results are accurate for your trading environment.
While the strategy is designed for BTC/USD on the 30-minute timeframe, it may also perform well on other high-liquidity cryptocurrencies and timeframes with additional optimization.
Avoid over-leveraging. We recommend allocating 1-2% equity per trade for risk control.
Plot Information:
The script visualizes key indicators:
EMA 21 (blue), EMA 50 (red), EMA 200 (green)
Supertrend (orange)
Green/red background shading highlights bullish and bearish entry conditions.
Disclaimer:
This script is for educational purposes only. Use it as part of a comprehensive trading plan that includes proper risk management. Trading involves significant risk, and no strategy can predict future price movements with certainty.
Gaussian Channel Strategy v3.0- Open long position as soon as the gaussian channel is green, the close price is above the high gaussian channel band and when the Stochastic RSI is above 80 or below 20.
- Close long positions when the close price crosses the high gaussian channel band to the downside.
Date range can be adjusted in settings
Multi Stochastic AlertHello Everyone,
I have created a Multi Stochastic Alert based on Scalping Strategy
The Strategy uses below 4 Stochastic indicator:
1. Stochastic (9,3)
2. Stochastic (14,3)
3. Stochastic (40,4)
4. Stochastic (60,10)
Trade entry become active when all of these goes below 20 or above 80, In this indicator you don't need to use all 4, this will show red and green background whenever all of them goes below 20 or above 80.
As shown in picture below, it works better when script is making a channel, Our indicator shows green or red signal, we wait for RSI Divergence and we enter. We book when blue line (9,3) goes above 80, as shown by arrow, and trail rest at breakeven or your own trailing method
Same Situation shown for Short side. We book 50% when Blue line (9,3) Goes below 20 and trail rest at breakeven or your own trailing method
Happy trading, Let me know if any improvements required.
Cloud-Optimized MomentumThis strategy is based on the Ichimoku Cloud indicator, designed to identify potential buy and sell signals in a market (like HWM stock). Here's a breakdown of the components and logic behind it:
Ichimoku Cloud Components:
Tenkan-sen: The moving average of the highest high and lowest low. It is used as a short-term trend indicator.
Kijun-sen: The moving average of the highest high and lowest low. It is considered the medium-term trend line.
Senkou Span A: The average of Tenkan-sen and Kijun-sen, shifted forward. It forms the leading edge of the cloud (Kumo).
Senkou Span B: The moving average of the highest high and lowest low, shifted forward. It forms the trailing edge of the cloud.
Chikou Span: The closing price shifted backward. It is used to confirm the trend.
skalping tool Sure! To create a custom trading indicator based on the strategy you mentioned, where you buy when the EMA (Exponential Moving Average) 9 crosses above EMA 21 and sell when it crosses below, here's a simple script that can be used in Pine Script (for TradingView).
```pinescript
//@version=5
indicator("EMA 9 and EMA 21 Crossover", overlay=true)
// Define the EMAs
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
// Plot the EMAs
plot(ema9, color=color.blue, linewidth=2, title="EMA 9")
plot(ema21, color=color.orange, linewidth=2, title="EMA 21")
// Buy condition: EMA 9 crosses above EMA 21
buyCondition = ta.crossover(ema9, ema21)
// Sell condition: EMA 9 crosses below EMA 21
sellCondition = ta.crossunder(ema9, ema21)
// Plot buy and sell signals
plotshape(series=buyCondition, color=color.green, style=shape.labelup, location=location.belowbar, text="BUY", textcolor=color.white, size=size.small)
plotshape(series=sellCondition, color=color.red, style=shape.labeldown, location=location.abovebar, text="SELL", textcolor=color.white, size=size.small)
// Generate alerts
alertcondition(buyCondition, title="Buy Alert", message="EMA 9 crossed above EMA 21")
alertcondition(sellCondition, title="Sell Alert", message="EMA 9 crossed below EMA 21")
```
### Explanation:
1. **EMA 9 and EMA 21**: This script calculates the Exponential Moving Averages for the periods 9 and 21.
2. **Buy Signal**: The script will detect when the EMA 9 crosses above the EMA 21 and mark it with a green "BUY" label below the price bar.
3. **Sell Signal**: The script will detect when the EMA 9 crosses below the EMA 21 and mark it with a red "SELL" label above the price bar.
4. **Alert Conditions**: Alerts are also set up for when these crossovers happen, so you can get notified.
You can copy this script into TradingView's Pine Script editor, and it will display the signals on your chart.
Let me know if you'd like any adjustments!