Buy/Sell Ei - Premium Edition (Fixed Momentum)**📈 Buy/Sell Ei Indicator - Smart Trading System with Price Pattern Detection 📉**
**🔍 What is it?**
The **Buy/Sell Ei** indicator is a professional tool designed to identify **buy and sell signals** based on a combination of **candlestick patterns** and **moving averages**. With high accuracy, it pinpoints optimal entry and exit points in **both bullish and bearish trends**, making it suitable for forex pairs, stocks, and cryptocurrencies.
---
### **🌟 Key Features:**
✅ **Advanced Candlestick Pattern Detection**
✅ **Momentum Filter (Customizable consecutive candle count)**
✅ **Live Trade Mode (Instant signals for active trading)**
✅ **Dual MA Support (Fast & Slow MA with multiple types: SMA, EMA, WMA, VWMA)**
✅ **Date Filter (Focus on specific trading periods)**
✅ **Win/Loss Tracking (Performance analytics with success rate)**
---
### **🚀 Why Choose Buy/Sell Ei?**
✔ **Precision:** Reduces false signals with strict pattern rules.
✔ **Flexibility:** Works in both live trading and backtesting modes.
✔ **User-Friendly:** Clear labels and alerts for easy decision-making.
✔ **Adaptive:** Compatible with all timeframes (M1 to Monthly).
---
### **🛠 How It Works:**
1. **Trend Confirmation:** Uses MAs to filter trades in the trend’s direction.
2. **Pattern Recognition:** Detects "Ready to Buy/Sell" and confirmed signals.
3. **Momentum Check:** Optional filter for consecutive bullish/bearish candles.
4. **Live Alerts:** Labels appear instantly in Live Trade Mode.
---
### **📊 Ideal For:**
- **Day Traders** (Scalping & Intraday)
- **Swing Traders** (Medium-term setups)
- **Technical Analysts** (Backtesting strategies)
**🔧 Designed by Sahar Chadri | Optimized for TradingView**
**🎯 Trade Smarter, Not Harder!**
Exponential Moving Average (EMA)
Huntwood PVSRA Candles with 34 EMA WavePVSRA + Wave Indicator (Volume + Structure + Momentum)
This custom indicator blends PVSRA (Price, Volume, S&R Analysis) with wave-based structure tracking to help identify smart money activity, volume surges, and wave patterns in real time.
It highlights:
Volume spikes at key zones
Wave counts & structure shifts
Potential market maker traps & trend setups
Ideal for traders who want a visual edge combining volume-based clues with wave rhythm for better entry/exit decisions.
Vegas Tunnel — Open SourceWhat it does – Plots the classic Vegas tunnel using the 144- and 169-period EMAs and colours the zone blue when price is above, pink when below.
How to use – Long bias when candles close above the upper band, short/flat when below. No built-in alerts or position sizing; this is a visual aid only.
Why open? – These EMAs are public-domain; the paid OneTrend Pro script adds proprietary filter, risk engine and live-broker alerts.
4 EMA Modified [Ryu_xp] - Enhanced4 EMA Modified – Enhanced (Pine v6)
A highly configurable, four-line exponential moving average (EMA) overlay built in Pine Script v6. This indicator empowers traders to monitor short- and long-term trends simultaneously, with the ability to toggle each EMA on or off and adjust its period and data source—all from a single, inline control panel.
Key Features:
Pine Script v6: updated to leverage the latest performance improvements and language features.
Four EMAs:
EMA 3 for ultra-short momentum (white, medium line)
EMA 10 for short-term trend (light blue, thin line)
EMA 55 for intermediate trend (orange, thicker line)
EMA 200 for long-term trend (dynamic green/red, thickest line)
Inline Controls: Each EMA has its own checkbox, length input, and source selector arranged on a single line for fast configuration.
Dynamic Coloring: EMA 200 switches to green when price is above it (bullish) and red when price is below it (bearish).
Toggle Visibility: Enable or disable any EMA instantly without removing it from your chart.
Clean Overlay: All EMAs plotted in one pane; ideal for multi-timeframe trend confluence and crossover strategies.
Inputs:
Show/Hide each EMA
EMA Length and Source for periods 3, 10, 55, and 200
Usage:
Add the script to any price chart.
Use the inline checkboxes to show only the EMAs you need.
Adjust lengths and sources to fit your instrument and timeframe.
Watch for crossovers between EMAs or price interactions with EMA 200 to confirm trend shifts.
This open-source script offers maximum flexibility for traders seeking a customizable EMA toolkit in one simple overlay.
Buy/Sell Signals (Dynamic v2)//@version=5
indicator(title="Buy/Sell Signals (Dynamic v2)", shorttitle="Buy/Sell Dyn v2", overlay=true)
// Input for moving average lengths
lengthMA = input.int(20, title="Moving Average Length")
lengthEMA = input.int(5, title="Exponential Moving Average Length")
// Calculate Moving Averages
ma = ta.sma(close, lengthMA)
ema = ta.ema(close, lengthEMA)
// --- Buy Signal Conditions ---
buyMarketBelowMA = close < ma
buyMarketBelowEMA = close < ema
buyEMABelowMA = ema < ma
buyMarketCondition = buyMarketBelowMA and buyMarketBelowEMA and buyEMABelowMA
buyFollowingHighNotTouchedEMA = high < ema
buyCurrentCrossCloseAboveFollowingHigh = high > high and close > high
buySignalCondition = buyMarketCondition and buyFollowingHighNotTouchedEMA and buyCurrentCrossCloseAboveFollowingHigh
// Plot Buy Signal
plotshape(buySignalCondition, title="Buy Signal", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
// --- Sell Signal Conditions (Occurring After a Buy Signal Sequence) ---
sellMarketAboveMA = close > ma
sellMarketAboveEMA = close > ema
sellEMAAboveMA = ema > ma
sellMarketConditionSell = sellMarketAboveMA and sellMarketAboveEMA and sellEMAAboveMA
var bool buySignalOccurredRecently = false
if buySignalCondition
buySignalOccurredRecently := true
sellSignalCondition = buySignalOccurredRecently and sellMarketConditionSell and close < close
// Plot Sell Signal
plotshape(sellSignalCondition, title="Sell Signal", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Reset the buySignalOccurredRecently only after a sell signal
if sellSignalCondition
buySignalOccurredRecently := false
// Plot the Moving Averages for visual reference
plot(ma, color=color.blue, title="MA")
plot(ema, color=color.red, title="EMA")
Why EMA Isn't What You Think It IsMany new traders adopt the Exponential Moving Average (EMA) believing it's simply a "better Simple Moving Average (SMA)". This common misconception leads to fundamental misunderstandings about how EMA works and when to use it.
EMA and SMA differ at their core. SMA use a window of finite number of data points, giving equal weight to each data point in the calculation period. This makes SMA a Finite Impulse Response (FIR) filter in signal processing terms. Remember that FIR means that "all that we need is the 'period' number of data points" to calculate the filter value. Anything beyond the given period is not relevant to FIR filters – much like how a security camera with 14-day storage automatically overwrites older footage, making last month's activity completely invisible regardless of how important it might have been.
EMA, however, is an Infinite Impulse Response (IIR) filter. It uses ALL historical data, with each past price having a diminishing - but never zero - influence on the calculated value. This creates an EMA response that extends infinitely into the past—not just for the last N periods. IIR filters cannot be precise if we give them only a 'period' number of data to work on - they will be off-target significantly due to lack of context, like trying to understand Game of Thrones by watching only the final season and wondering why everyone's so upset about that dragon lady going full pyromaniac.
If we only consider a number of data points equal to the EMA's period, we are capturing no more than 86.5% of the total weight of the EMA calculation. Relying on he period window alone (the warm-up period) will provide only 1 - (1 / e^2) weights, which is approximately 1−0.1353 = 0.8647 = 86.5%. That's like claiming you've read a book when you've skipped the first few chapters – technically, you got most of it, but you probably miss some crucial early context.
▶️ What is period in EMA used for?
What does a period parameter really mean for EMA? When we select a 15-period EMA, we're not selecting a window of 15 data points as with an SMA. Instead, we are using that number to calculate a decay factor (α) that determines how quickly older data loses influence in EMA result. Every trader knows EMA calculation: α = 1 / (1+period) – or at least every trader claims to know this while secretly checking the formula when they need it.
Thinking in terms of "period" seriously restricts EMA. The α parameter can be - should be! - any value between 0.0 and 1.0, offering infinite tuning possibilities of the indicator. When we limit ourselves to whole-number periods that we use in FIR indicators, we can only access a small subset of possible IIR calculations – it's like having access to the entire RGB color spectrum with 16.7 million possible colors but stubbornly sticking to the 8 basic crayons in a child's first art set because the coloring book only mentioned those by name.
For example:
Period 10 → alpha = 0.1818
Period 11 → alpha = 0.1667
What about wanting an alpha of 0.17, which might yield superior returns in your strategy that uses EMA? No whole-number period can provide this! Direct α parameterization offers more precision, much like how an analog tuner lets you find the perfect radio frequency while digital presets force you to choose only from predetermined stations, potentially missing the clearest signal sitting right between channels.
Sidenote: the choice of α = 1 / (1+period) is just a convention from 1970s, probably started by J. Welles Wilder, who popularized the use of the 14-day EMA. It was designed to create an approximate equivalence between EMA and SMA over the same number of periods, even thought SMA needs a period window (as it is FIR filter) and EMA doesn't. In reality, the decay factor α in EMA should be allowed any valye between 0.0 and 1.0, not just some discrete values derived from an integer-based period! Algorithmic systems should find the best α decay for EMA directly, allowing the system to fine-tune at will and not through conversion of integer period to float α decay – though this might put a few traditionalist traders into early retirement. Well, to prevent that, most traditionalist implementations of EMA only use period and no alpha at all. Heaven forbid we disturb people who print their charts on paper, draw trendlines with rulers, and insist the market "feels different" since computers do algotrading!
▶️ Calculating EMAs Efficiently
The standard textbook formula for EMA is:
EMA = CurrentPrice × alpha + PreviousEMA × (1 - alpha)
But did you know that a more efficient version exists, once you apply a tiny bit of high school algebra:
EMA = alpha × (CurrentPrice - PreviousEMA) + PreviousEMA
The first one requires three operations: 2 multiplications + 1 addition. The second one also requires three ops: 1 multiplication + 1 addition + 1 subtraction.
That's pathetic, you say? Not worth implementing? In most computational models, multiplications cost much more than additions/subtractions – much like how ordering dessert costs more than asking for a water refill at restaurants.
Relative CPU cost of float operations :
Addition/Subtraction: ~1 cycle
Multiplication: ~5 cycles (depending on precision and architecture)
Now you see the difference? 2 * 5 + 1 = 11 against 5 + 1 + 1 = 7. That is ≈ 36.36% efficiency gain just by swapping formulas around! And making your high school math teacher proud enough to finally put your test on the refrigerator.
▶️ The Warmup Problem: how to start the EMA sequence right
How do we calculate the first EMA value when there's no previous EMA available? Let's see some possible options used throughout the history:
Start with zero : EMA(0) = 0. This creates stupidly large distortion until enough bars pass for the horrible effect to diminish – like starting a trading account with zero balance but backdating a year of missed trades, then watching your balance struggle to climb out of a phantom debt for months.
Start with first price : EMA(0) = first price. This is better than starting with zero, but still causes initial distortion that will be extra-bad if the first price is an outlier – like forming your entire opinion of a stock based solely on its IPO day price, then wondering why your model is tanking for weeks afterward.
Use SMA for warmup : This is the tradition from the pencil-and-paper era of technical analysis – when calculators were luxury items and "algorithmic trading" meant your broker had neat handwriting. We first calculate an SMA over the initial period, then kickstart the EMA with this average value. It's widely used due to tradition, not merit, creating a mathematical Frankenstein that uses an FIR filter (SMA) during the initial period before abruptly switching to an IIR filter (EMA). This methodology is so aesthetically offensive (abrupt kink on the transition from SMA to EMA) that charting platforms hide these early values entirely, pretending EMA simply doesn't exist until the warmup period passes – the technical analysis equivalent of sweeping dust under the rug.
Use WMA for warmup : This one was never popular because it is harder to calculate with a pencil - compared to using simple SMA for warmup. Weighted Moving Average provides a much better approximation of a starting value as its linear descending profile is much closer to the EMA's decay profile.
These methods all share one problem: they produce inaccurate initial values that traders often hide or discard, much like how hedge funds conveniently report awesome performance "since strategy inception" only after their disastrous first quarter has been surgically removed from the track record.
▶️ A Better Way to start EMA: Decaying compensation
Think of it this way: An ideal EMA uses an infinite history of prices, but we only have data starting from a specific point. This creates a problem - our EMA starts with an incorrect assumption that all previous prices were all zero, all close, or all average – like trying to write someone's biography but only having information about their life since last Tuesday.
But there is a better way. It requires more than high school math comprehension and is more computationally intensive, but is mathematically correct and numerically stable. This approach involves compensating calculated EMA values for the "phantom data" that would have existed before our first price point.
Here's how phantom data compensation works:
We start our normal EMA calculation:
EMA_today = EMA_yesterday + α × (Price_today - EMA_yesterday)
But we add a correction factor that adjusts for the missing history:
Correction = 1 at the start
Correction = Correction × (1-α) after each calculation
We then apply this correction:
True_EMA = Raw_EMA / (1-Correction)
This correction factor starts at 1 (full compensation effect) and gets exponentially smaller with each new price bar. After enough data points, the correction becomes so small (i.e., below 0.0000000001) that we can stop applying it as it is no longer relevant.
Let's see how this works in practice:
For the first price bar:
Raw_EMA = 0
Correction = 1
True_EMA = Price (since 0 ÷ (1-1) is undefined, we use the first price)
For the second price bar:
Raw_EMA = α × (Price_2 - 0) + 0 = α × Price_2
Correction = 1 × (1-α) = (1-α)
True_EMA = α × Price_2 ÷ (1-(1-α)) = Price_2
For the third price bar:
Raw_EMA updates using the standard formula
Correction = (1-α) × (1-α) = (1-α)²
True_EMA = Raw_EMA ÷ (1-(1-α)²)
With each new price, the correction factor shrinks exponentially. After about -log₁₀(1e-10)/log₁₀(1-α) bars, the correction becomes negligible, and our EMA calculation matches what we would get if we had infinite historical data.
This approach provides accurate EMA values from the very first calculation. There's no need to use SMA for warmup or discard early values before output converges - EMA is mathematically correct from first value, ready to party without the awkward warmup phase.
Here is Pine Script 6 implementation of EMA that can take alpha parameter directly (or period if desired), returns valid values from the start, is resilient to dirty input values, uses decaying compensator instead of SMA, and uses the least amount of computational cycles possible.
// Enhanced EMA function with proper initialization and efficient calculation
ema(series float source, simple int period=0, simple float alpha=0)=>
// Input validation - one of alpha or period must be provided
if alpha<=0 and period<=0
runtime.error("Alpha or period must be provided")
// Calculate alpha from period if alpha not directly specified
float a = alpha > 0 ? alpha : 2.0 / math.max(period, 1)
// Initialize variables for EMA calculation
var float ema = na // Stores raw EMA value
var float result = na // Stores final corrected EMA
var float e = 1.0 // Decay compensation factor
var bool warmup = true // Flag for warmup phase
if not na(source)
if na(ema)
// First value case - initialize EMA to zero
// (we'll correct this immediately with the compensation)
ema := 0
result := source
else
// Standard EMA calculation (optimized formula)
ema := a * (source - ema) + ema
if warmup
// During warmup phase, apply decay compensation
e *= (1-a) // Update decay factor
float c = 1.0 / (1.0 - e) // Calculate correction multiplier
result := c * ema // Apply correction
// Stop warmup phase when correction becomes negligible
if e <= 1e-10
warmup := false
else
// After warmup, EMA operates without correction
result := ema
result // Return the properly compensated EMA value
▶️ CONCLUSION
EMA isn't just a "better SMA"—it is a fundamentally different tool, like how a submarine differs from a sailboat – both float, but the similarities end there. EMA responds to inputs differently, weighs historical data differently, and requires different initialization techniques.
By understanding these differences, traders can make more informed decisions about when and how to use EMA in trading strategies. And as EMA is embedded in so many other complex and compound indicators and strategies, if system uses tainted and inferior EMA calculatiomn, it is doing a disservice to all derivative indicators too – like building a skyscraper on a foundation of Jell-O.
The next time you add an EMA to your chart, remember: you're not just looking at a "faster moving average." You're using an INFINITE IMPULSE RESPONSE filter that carries the echo of all previous price actions, properly weighted to help make better trading decisions.
EMA done right might significantly improve the quality of all signals, strategies, and trades that rely on EMA somewhere deep in its algorithmic bowels – proving once again that math skills are indeed useful after high school, no matter what your guidance counselor told you.
P.F.Algo_V63 09051. Purpose & Original Edge
All-in-one pipeline combining:
6 independent entry logics (volatility breakout, fractals, Bollinger + SMA pullback, linear spread, Opening Range Breakout, Donchian + Chikou confirmation).
11 stackable filters (from short-term MA direction to macro relative-strength).
A parametric risk-management module (static / dynamic SL-TP, break-even, fractal trailing, losing-bar cutoff).
An MT5 connector (via PineConnector) that pushes every order with pre-calculated SL/TP from TradingView.
What makes V63 unique? Inter-market filters (ETF/ratio-based), ATR regime control, and dynamic Fibonacci windows—features not found in public scripts.
2. How It Works – source remains private
Block Logic Key Conditions (excerpt)
Entries • Delta: fixed limit around price.
• Fractal: break of N = 2 fractal.
• Boll + SMA: return to band / MA-50.
• Linear: Instrument / Benchmark spread & regression slope.
• ORB: breakout of first X minutes.
• Donchian + Chikou: channel break + Ichimoku validation. One trade per eligible signal.
“Allowed” Filter Sessions, dynamic Fib-265-day zones on HTF closes, ATR regime (EMA10 < EMA20), max signal age. Ensures a tradable context.
Technical Filters 1-11 MA direction, HTF PMax, adaptive QQE, price vs. “Red Line”, RSI > EMA, WMA/SMA cross on external asset, Macro RS on 10-20 instruments. Cuts noise & over-trading.
Risk Engine 3 SL modes, 4 TP modes, 4 BE/TSL modes, multi-TF fractal trailing, auto-stop after N losing bars. Protects capital and trader psychology.
MT5 Alerts Format: LicenseID,buy/sell,Symbol,sl=?,tp=?,risk=? Enables live execution without extra scripting.
3. Default Back-test Settings
Assumption Value
Starting balance € 10 000
Risk per trade 1 % (percent-of-equity)
Commission 0.05 %
Slippage 0.5 pip
Sample size 360 + trades over ~6 years (DAX40 & BTC presets)
These defaults suit an average retail trader. Adapt to your own market and cost structure.
4. Quick-Start Guide
Select “Entry Type” in Inputs, then enable/disable desired filters.
Confirm “Entry Allowed” label is 🟢 before arming alerts.
Configure Risk Management:
SL Mode: %, Red Line (PMax) or off.
TP Mode: fixed, ratio, or tied to Red Line.
Enter LicenseID & MT5 Symbol so the connector can receive orders.
Run a full back-test (200 + trades recommended), then switch to Paper before going live.
5. Limitations & Risk Warning
No guarantee of future performance. Historical results do not predict future returns.
Market conditions and transaction costs may differ from the assumptions above.
Educational use only; you remain fully responsible for any financial loss incurred.
No advertising, external links or solicitations included (complies with House Rule #2).
6. Changelog — V63 vs V62
New Feature Expected Impact
Dynamic Fibonacci Range Filter Blocks entries at extreme range edges.
ATR-EMA Regime Control Suspends trading in compressed volatility.
Losing-Bar Counter Prevents late-cycle entries; limits “late-entry bias”.
Enhanced MT5 Connector Adds risk parameter to each alert payload.
“One block at a time, one edge at a time.” – P.F.Algo V63
#AlgoTrading #TradingViewStrategy #PineScript #ClosedSource #RiskManagement #VolatilityBreakout #FractalTrading #DonchianChannel #OpeningRangeBreakout #IntermarketAnalysis #RelativeStrength #ATRRegime #Fibonacci #MT5Connector #Backtesting #Automation #QuantitativeTrading
EMA Crossover with Shading
A Pine Script indicator that shows a crossover between a short EMA and a long EMA, with green shading when the short EMA is above the long EMA and red shading when it's below.
10/20MA pullback by Black200000Original Multi-Timeframe Pullback Indicator with Real-Time Alerts (Closed Source)
This script is a unique, practical tool for identifying and visualizing pullback opportunities on stocks.
It’s specifically engineered to generate pullback alerts in real time even while you are viewing other timeframes—a feature rarely available in open-source alternatives.
• What makes this script unique?
- Specialized Pullback Logic (10/20 EMA):
The indicator detects valid pullbacks based on price interaction with the 10 or 20 EMA, with advanced logic that differentiates between:
1. Touch and close above the EMA
2. Touch and close below the EMA
3. Touch one EMA and close above the other (for advanced filtering)
- Multi-Timeframe Engine:
The script is optimized for both standard and non-standard timeframes (including 6m), and is capable of generating pullback alerts even if you are currently viewing a different timeframe chart (such as 1m, 15m, H1, or daily).
You will never miss a pullback signal just because you are on another chart timeframe.
- Clean, Non-Repetitive Visuals:
All signals are displayed on a single, dedicated reference line below price—never on every price bar—so your chart remains easy to read even when tracking multiple stocks.
- True Originality:
The logic, signal timing, and alert functionality are not adapted from any open-source code.
Real-time multi-timeframe pullback alerting is unique to this indicator.
• How the indicator works
- On every new bar, the script checks for custom pullback conditions using 10 and 20 EMA interactions, regardless of your current viewing timeframe.
- When your criteria are met, a visual marker is plotted and an alert is triggered in real time, ensuring you can act immediately—even if you’re reviewing the market from a different angle.
• Why closed source?
- The script’s logic, visual engine, and especially the cross-timeframe alerting mechanism are original, developed independently for active intraday traders.
- No part of the code is copied or replicated from open-source repositories.
- To maintain the uniqueness and effectiveness of the strategy, the script is published as closed source, in full compliance with TradingView’s House Rules.
• How to use
1. Add the indicator to any chart.
2. The script automatically monitors all interactions with the 10 and 20 EMA using advanced pullback logic.
3. Set your alert for pullback signals.
4. Trade or scan other timeframes with confidence, knowing you’ll be notified as soon as a pullback forms on your chosen anchor timeframe.
If you have questions about the logic or features, contact me via TradingView DM.
Scalping IndicatorAn attempt to create a signal for intraday scalping. This indicator factoring short EMA cross, supertrend, fib retracement, and market structure for the signal condition.
Adaptive Strength MACD [UM]Indicator Description
Adaptive Strength MACD is an adaptive variant of the classic MACD that uses a customized Strength Momentum moving average for both its oscillator and signal lines. This makes the indicator more responsive in trending conditions and more stable in sideways markets.
Key Features
1. Adaptive Strength Momentum MA
Leverages the Adaptive Momentum Oscillator to scale smoothing coefficients dynamically.
2. Trend-Validity Filters
Optional ADX filter ensures signals only fire when trend strength (ADX) exceeds a user threshold.
3. Directional Filter (DI+) confirms bullish or bearish momentum.
4. Color-Coded Histogram
5. Bars turn bright when momentum accelerates, faded when slowing.
6. Grayed out when trend filters disqualify signals.
7. Alerts
Bullish crossover (histogram from negative to positive) and bearish crossover (positive to negative) only when filters validate trend.
Comparison with Regular MACD
1. Moving Averages
Classic MACD uses fixed exponential moving averages (EMAs) for its fast and slow lines, so the smoothing factor is constant regardless of how strong or weak price momentum is.
Adaptive Strength MACD replaces those EMAs with a dynamic “Strength Momentum” MA that speeds up when momentum is strong and slows down in quiet or choppy markets.
2. Signal Line Smoothing
In the classic MACD, the signal is simply an EMA of the MACD line, with one user-selected period.
In the Adaptive Strength MACD , the signal line also uses the Strength Momentum MA on the MACD series—so both oscillator and signal adapt together to the underlying momentum strength.
3. Responsiveness to Momentum
A static EMA reacts the same way whether momentum is surging or fading; you either get too-slow entries when momentum spikes or too-fast whipsaws in noise.
The adaptive MA in your indicator automatically gives you quicker crossovers when there’s a trending burst, while damping down during low-momentum chop.
4. Trend Validation Filters
The classic MACD has no built-in mechanism to know whether price is actually trending versus ranging—you’ll see crossovers in both regimes.
Adaptive Strength MACD includes optional ADX filtering (to require a minimum trend strength) and a DI filter (to confirm bullish vs. bearish directional pressure). When those filters aren’t met, the histogram grays out to warn you.
5. Histogram Coloring & Clarity
Typical MACD histograms often use two colors (above/below zero) or a simple ramp but don’t distinguish accelerating vs. decelerating moves.
Your version employs four distinct states—accelerating bulls, decelerating bulls, accelerating bears, decelerating bears—plus a gray “no-signal” state when filters fail. This makes it easy at a glance to see not just direction but the quality of the move.
6. False-Signal Reduction
Because the classic MACD fires on every crossover, it can generate whipsaws in ranging markets.
The adaptive MA smoothing combined with ADX/DI gating in your script helps suppress those false breaks and keeps you focused on higher-quality entries.
7. Ideal Use Cases
Use the classic MACD when you need a reliable, well-understood trend-following oscillator and you’re comfortable manually filtering choppy signals.
Choose Adaptive Strength MACD \ when you want an all-in-one, automated way to speed up in strong trends, filter out noise, and receive clearer visual cues and alerts only when conditions align.
How to Use
1. Setup
- Adjust Fast and Slow Length to tune sensitivity.
- Change Signal Smoothing to smooth the histogram reaction.
- Enable ADX/DI filters and set ADX Threshold to suit your preferred trend strength (default = 20).
2. Interpretation
- Histogram > 0: Short‐term momentum above long‐term → bullish.
- Histogram < 0: Short‐term below long‐term → bearish.
- Faded greyed bars indicate a weakening move; gray bars show filter invalidation.
How to Trade
Buy Setup:
- Histogram crosses from negative to positive.
- ADX ≥ threshold and DI+ > DI–.
- Look for confirmation (bullish candlestick patterns or support zone).
Sell Setup:
- Histogram crosses from positive to negative.
- ADX ≥ threshold and DI– > DI+.
- Confirm with bearish price action (resistance test or bearish pattern).
Stop & Target
- Place stop just below recent swing low (long) or above recent swing high (short).
- Target risk–reward of at least 1:2, or trail with a shorter‐period adaptive MA.
Consecutive Candles Above/Below EMADescription:
This indicator identifies and highlights periods where the price remains consistently above or below an Exponential Moving Average (EMA) for a user-defined number of consecutive candles. It visually marks these sustained trends with background colors and labels, helping traders spot strong bullish or bearish market conditions. Ideal for trend-following strategies or identifying potential trend exhaustion points, this tool provides clear visual cues for price behavior relative to the EMA.
How It Works:
EMA Calculation: The indicator calculates an EMA based on the user-specified period (default: 100). The EMA is plotted as a blue line on the chart for reference.
Consecutive Candle Tracking: It counts how many consecutive candles close above or below the EMA:
If a candle closes below the EMA, the "below" counter increments; any candle closing above resets it to zero.
If a candle closes above the EMA, the "above" counter increments; any candle closing below resets it to zero.
Highlighting Trends: When the number of consecutive candles above or below the EMA meets or exceeds the user-defined threshold (default: 200 candles):
A translucent red background highlights periods where the price has been below the EMA.
A translucent green background highlights periods where the price has been above the EMA.
Labeling: When the required number of consecutive candles is first reached:
A red downward arrow label with the text "↓ Below" appears for below-EMA streaks.
A green upward arrow label with the text "↑ Above" appears for above-EMA streaks.
Usage:
Trend Confirmation: Use the highlights and labels to confirm strong trends. For example, 200 candles above the EMA may indicate a robust uptrend.
Reversal Signals: Prolonged streaks (e.g., 200+ candles) might suggest overextension, potentially signaling reversals.
Customization: Adjust the EMA period to make it faster or slower, and modify the candle count to make the indicator more or less sensitive to trends.
Settings:
EMA Length: Set the period for the EMA calculation (default: 100).
Candles Count: Define the minimum number of consecutive candles required to trigger highlights and labels (default: 200).
Visuals:
Blue EMA line for tracking the moving average.
Red background for sustained below-EMA periods.
Green background for sustained above-EMA periods.
Labeled arrows to mark when the streak threshold is met.
This indicator is a powerful tool for traders looking to visualize and capitalize on persistent price trends relative to the EMA, with clear, customizable signals for market analysis.
Explain EMA calculation
Other trend indicators
Make description shorter
50/200 EMA Crossover with Visual Signals50/200 EMA Crossover with Enhanced Visual Signals
This indicator detects crossovers between the 50-period and 200-period Exponential Moving Averages (EMAs), commonly known as the “Golden Cross” (bullish) and “Death Cross” (bearish), which are widely used to identify long-term trend changes in financial markets. It enhances these signals with clear visual markers, helping traders spot significant crossover events without chart clutter.
Key Features
EMA Calculation: Computes the 50-period and 200-period EMAs on the closing price, plotted with distinct colors (cyan for 50 EMA, purple for 200 EMA) and 75% opacity for better visibility.
Crossover Detection: Identifies when the 50 EMA crosses above (bullish) or below (bearish) the 200 EMA, signaling potential major trend reversals.
Visual Cues: Plots a yellow circle above the candle at the crossover point and uses stacked labels to create a styled marker (orange outline with a semi-transparent yellow fill) at the average price of the two EMAs, making signals easy to identify.
How It Works
The indicator calculates the 50 and 200 EMAs using the ta.ema() function in Pine Script v5. Crossovers are detected with ta.crossover() (bullish) and ta.crossunder() (bearish). To enhance signal visibility:
A small yellow circle appears above the candle where the crossover occurs.
Two labels mark the crossover price (average of the two EMAs): an outer orange label for the border and an inner yellow label for the fill, both with controlled opacity to maintain chart clarity.
Usage
This indicator is designed for traders focusing on long-term trend changes, particularly swing or position traders. It performs best on higher timeframes, such as:
Daily or 4-hour charts for stocks, forex, or cryptocurrencies to capture major trends.
Weekly charts for long-term investment decisions.
To use it effectively:
Apply the indicator to a chart and verify the 50 and 200 EMAs are visible.
Watch for yellow circles and styled markers to identify crossover points.
Confirm signals with additional tools (e.g., volume, support/resistance, or fundamental analysis), as EMA crossovers can produce false signals in sideways markets.
Use the bullish “Golden Cross” (50 EMA above 200 EMA) to consider long positions and the bearish “Death Cross” (50 EMA below 200 EMA) for potential short positions or exits.
Limitations
The 50/200 EMA crossover is a lagging indicator, which may delay signals in fast-moving markets.
False signals can occur in range-bound or low-volatility conditions. Additional confirmation is recommended.
The visual markers are based on historical data and do not predict future price movements.
This indicator is less suited for short-term scalping due to the longer EMA periods.
Why This Indicator?
The 50/200 EMA crossover is a cornerstone of trend-following strategies, distinct from shorter-term setups like the 21/200 EMA due to its focus on major market trends. This script enhances the standard approach with unique visual signals—yellow circles and styled labels—not typically found in basic EMA indicators, providing a clear and professional way to track Golden and Death Cross events. It adds value to the TradingView community by offering a reliable, visually intuitive tool for long-term trend analysis.
Triple Moving Average by XeodiacThis script, "Triple Moving Average Indicator", is a simple yet powerful tool designed to help traders track trends and detect potential market reversals. Here’s what it does:
What It Does:
Plots three moving averages on your chart.
Customizable to suit your trading style with options for the type of moving average, the period, color, and thickness of the lines.
Alerts you when important crossovers occur, helping you stay on top of potential trading opportunities.
Features:
Customizable Moving Averages (MAs):
Choose from four types of MAs:
Simple Moving Average (SMA)
Exponential Moving Average (EMA)
Smoothed Moving Average (SMMA)
Weighted Moving Average (WMA)
Set individual periods, colors, and line thickness for each moving average.
Alerts:
Notifies you when:
The price crosses above or below any moving average.
One moving average crosses another (e.g., short-term crosses above long-term).
Visual Clarity:
Plots three distinct lines on the chart for easy comparison and interpretation.
Why Use It?
Track Trends: See the direction of short, medium, and long-term trends at a glance.
Spot Crossovers: Identify golden crosses (bullish) or death crosses (bearish) to refine entry and exit points.
Stay Informed: With alerts, you’ll never miss a key market movement.
21/200 EMA Crossover with Visual Signals21/200 EMA Crossover with Enhanced Visual Signals
This indicator identifies crossovers between the 21-period and 200-period Exponential Moving Averages (EMAs), a widely used method for detecting potential trend changes in financial markets. It enhances the standard EMA crossover strategy by providing clear visual cues, making it easier for traders to spot critical crossover points without cluttering the chart.
Key Features
EMA Calculation: Computes the 21-period and 200-period EMAs on the closing price, plotted with distinct colors (cyan for 21 EMA, purple for 200 EMA) and 75% opacity for better chart visibility.
Crossover Detection: Identifies when the 21 EMA crosses above (bullish) or below (bearish) the 200 EMA, signaling potential trend reversals or continuations.
Visual Cues: Displays a yellow circle above the candle at the crossover point and uses stacked labels to simulate a styled marker (orange outline with a semi-transparent yellow fill) at the average price of the two EMAs, ensuring the signal is easy to spot.
How It Works
The indicator calculates the 21 and 200 EMAs using the ta.ema() function in Pine Script v5. Crossovers are detected using ta.crossover() and ta.crossunder() to identify bullish and bearish signals, respectively. To enhance visibility:
A small yellow circle is plotted above the candle where the crossover occurs.
Two labels are used to create a visually distinct marker at the crossover price (average of the two EMAs): an outer orange label for the border and an inner yellow label for the fill, both with controlled opacity for clarity.
Usage
This indicator is designed for traders seeking to confirm trend changes or continuations. It is particularly useful on lower timeframes (e.g., 3-minute for scalping) but can also be applied to higher timeframes (e.g., 1-hour or daily) for swing trading. To use it effectively:
Add the indicator to your chart and ensure the 21 and 200 EMAs are visible.
Look for yellow circles and styled markers to identify crossover points.
Combine with other technical analysis tools (e.g., support/resistance levels or volume) to validate signals, as EMA crossovers alone may produce false signals in choppy markets.
Adjust timeframe based on your trading style (lower for scalping, higher for swing trading).
Limitations
EMA crossovers can lag in fast-moving markets, potentially delaying signals.
The indicator may generate false signals in ranging or low-volatility conditions. Traders should use additional confirmation tools.
The visual markers rely on historical data and do not predict future price movements.
Why This Indicator?
While EMA crossovers are a standard technique, this script stands out by offering customizable visual signals that reduce chart noise, making it easier to act on crossover events. The use of styled labels to mark crossover prices is a unique feature not commonly found in basic EMA indicators, providing a clear and professional presentation of signals.
EMA 12/26 With ATR Volatility StoplossThe EMA 12/26 With ATR Volatility Stoploss
The EMA 12/26 With ATR Volatility Stoploss strategy is a meticulously designed systematic trading approach tailored for navigating financial markets through technical analysis. By integrating the Exponential Moving Average (EMA) and Average True Range (ATR) indicators, the strategy aims to identify optimal entry and exit points for trades while prioritizing disciplined risk management. At its core, it is a trend-following system that seeks to capitalize on price momentum, employing volatility-adjusted stop-loss mechanisms and dynamic position sizing to align with predefined risk parameters. Additionally, it offers traders the flexibility to manage profits either by compounding returns or preserving initial capital, making it adaptable to diverse trading philosophies. This essay provides a comprehensive exploration of the strategy’s underlying concepts, key components, strengths, limitations, and practical applications, without delving into its technical code.
=====
Core Philosophy and Objectives
The EMA 12/26 With ATR Volatility Stoploss strategy is built on the premise of capturing short- to medium-term price trends with a high degree of automation and consistency. It leverages the crossover of two EMAs—a fast EMA (12-period) and a slow EMA (26-period)—to generate buy and sell signals, which indicate potential trend reversals or continuations. To mitigate the inherent risks of trading, the strategy incorporates the ATR indicator to set stop-loss levels that adapt to market volatility, ensuring that losses remain within acceptable bounds. Furthermore, it calculates position sizes based on a user-defined risk percentage, safeguarding capital while optimizing trade exposure.
A distinctive feature of the strategy is its dual profit management modes:
SnowBall (Compound Profit): Profits from successful trades are reinvested into the capital base, allowing for progressively larger position sizes and potential exponential portfolio growth.
ZeroRisk (Fixed Equity): Profits are withdrawn, and trades are executed using only the initial capital, prioritizing capital preservation and minimizing exposure to market downturns.
This duality caters to both aggressive traders seeking growth and conservative traders focused on stability, positioning the strategy as a versatile tool for various market environments.
=====
Key Components of the Strategy
1. EMA-Based Signal Generation
The strategy’s trend-following mechanism hinges on the interaction between the Fast EMA (12-period) and Slow EMA (26-period). EMAs are preferred over simple moving averages because they assign greater weight to recent price data, enabling quicker responses to market shifts. The key signals are:
Buy Signal: Triggered when the Fast EMA crosses above the Slow EMA, suggesting the onset of an uptrend or bullish momentum.
Sell Signal: Occurs when the Fast EMA crosses below the Slow EMA, indicating a potential downtrend or the end of a bullish phase.
To enhance signal reliability, the strategy employs an Anchor Point EMA (AP EMA), a short-period EMA (e.g., 2 days) that smooths the input price data before calculating the primary EMAs. This preprocessing reduces noise from short-term price fluctuations, improving the accuracy of trend detection. Additionally, users can opt for a Consolidated EMA (e.g., 18-period) to display a single trend line instead of both EMAs, simplifying chart analysis while retaining trend insights.
=====
2. Volatility-Adjusted Risk Management with ATR
Risk management is a cornerstone of the strategy, achieved through the use of the Average True Range (ATR), which quantifies market volatility by measuring the average price range over a specified period (e.g., 10 days). The ATR informs the placement of stop-loss levels, which are set at a multiple of the ATR (e.g., 2x ATR) below the entry price for long positions. This approach ensures that stop losses are proportionate to current market conditions—wider during high volatility to avoid premature exits, and narrower during low volatility to protect profits.
For example, if a stock’s ATR is $1 and the multiplier is 2, the stop loss for a buy at $100 would be set at $98. This dynamic adjustment enhances the strategy’s adaptability, preventing stop-outs from normal market noise while capping potential losses.
=====
3. Dynamic Position Sizing
The strategy calculates position sizes to align with a user-defined Risk Per Trade, typically expressed as a percentage of capital (e.g., 2%). The position size is determined by:
The available capital, which varies depending on whether SnowBall or ZeroRisk mode is selected.
The distance between the entry price and the ATR-based stop-loss level, which represents the per-unit risk.
The desired risk percentage, ensuring that the maximum loss per trade does not exceed the specified threshold.
For instance, with a $1,000 capital, a 2% risk per trade ($20), and a stop-loss distance equivalent to 5% of the entry price, the strategy computes the number of units (shares or contracts) to ensure the total loss, if the stop loss is hit, equals $20. To prevent over-leveraging, the strategy includes checks to ensure that the position’s dollar value does not exceed available capital. If it does, the position size is scaled down to fit within the capital constraints, maintaining financial discipline.
=====
4. Flexible Capital Management
The strategy’s dual profit management modes—SnowBall and ZeroRisk—offer traders strategic flexibility:
SnowBall Mode: By compounding profits, traders can increase their capital base, leading to larger position sizes over time. This is ideal for those with a long-term growth mindset, as it harnesses the power of exponential returns.
ZeroRisk Mode: By withdrawing profits and trading solely with the initial capital, traders protect their gains and limit exposure to market volatility. This conservative approach suits those prioritizing stability over aggressive growth.
These options allow traders to tailor the strategy to their risk tolerance, financial goals, and market outlook, enhancing its applicability across different trading styles.
=====
5. Time-Based Trade Filtering
To optimize performance and relevance, the strategy includes an option to restrict trading to a specific time range (e.g., from 2018 onward). This feature enables traders to focus on periods with favorable market conditions, avoid historically volatile or unreliable data, or align the strategy with their backtesting objectives. By confining trades to a defined timeframe, the strategy ensures that performance metrics reflect the intended market context.
=====
Strengths of the Strategy
The EMA 12/26 With ATR Volatility Stoploss strategy offers several compelling advantages:
Systematic and Objective: By adhering to predefined rules, the strategy eliminates emotional biases, ensuring consistent execution across market conditions.
Robust Risk Controls: The combination of ATR-based stop losses and risk-based position sizing caps losses at user-defined levels, fostering capital preservation.
Customizability: Traders can adjust parameters such as EMA periods, ATR multipliers, and risk percentages, tailoring the strategy to specific markets or preferences.
Volatility Adaptation: Stop losses that scale with market volatility enhance the strategy’s resilience, accommodating both calm and turbulent market phases.
Enhanced Visualization: The use of color-coded EMAs (green for bullish, red for bearish) and background shading provides intuitive visual cues, simplifying trend and trade status identification.
=====
Limitations and Considerations
Despite its strengths, the strategy has inherent limitations that traders must address:
False Signals in Range-Bound Markets: EMA crossovers may generate misleading signals in sideways or choppy markets, leading to whipsaws and unprofitable trades.
Signal Lag: As lagging indicators, EMAs may delay entry or exit signals, causing traders to miss rapid trend shifts or enter trades late.
Overfitting Risk: Excessive optimization of parameters to fit historical data can impair the strategy’s performance in live markets, as past patterns may not persist.
Impact of High Volatility: In extremely volatile markets, wider stop losses may result in larger losses than anticipated, challenging risk management assumptions.
Data Reliability: The strategy’s effectiveness depends on accurate, continuous price data, and discrepancies or gaps can undermine signal accuracy.
=====
Practical Applications
The EMA 12/26 With ATR Volatility Stoploss strategy is versatile, applicable to diverse markets such as stocks, forex, commodities, and cryptocurrencies, particularly in trending environments. To maximize its potential, traders should adopt a rigorous implementation process:
Backtesting: Evaluate the strategy’s historical performance across various market conditions to assess its robustness and identify optimal parameter settings.
Forward Testing: Deploy the strategy in a demo account to validate its real-time performance, ensuring it aligns with live market dynamics before risking capital.
Ongoing Monitoring: Continuously track trade outcomes, analyze performance metrics, and refine parameters to adapt to evolving market conditions.
Additionally, traders should consider market-specific factors, such as liquidity and volatility, when applying the strategy. For instance, highly liquid markets like forex may require tighter ATR multipliers, while less liquid markets like small-cap stocks may benefit from wider stop losses.
=====
Conclusion
The EMA 12/26 With ATR Volatility Stoploss strategy is a sophisticated, systematic trading framework that blends trend-following precision with disciplined risk management. By leveraging EMA crossovers for signal generation, ATR-based stop losses for volatility adjustment, and dynamic position sizing for risk control, it offers a balanced approach to capturing market trends while safeguarding capital. Its flexibility—evident in customizable parameters and dual profit management modes—makes it suitable for traders with varying risk appetites and objectives. However, its limitations, such as susceptibility to false signals and signal lag, necessitate thorough testing and prudent application. Through rigorous backtesting, forward testing, and continuous refinement, traders can harness this strategy to achieve consistent, risk-adjusted returns in trending markets, establishing it as a valuable tool in the arsenal of systematic trading.
ADX EMA's DistanceIt is well known to technical analysts that the price of the most volatile and traded assets do not tend to stay in the same place for long. A notable observation is the recurring pattern of moving averages that tend to move closer together prior to a strong move in some direction to initiate the trend, it is precisely that distance that is measured by the blue ADX EMA's Distance lines on the chart, normalized and each line being the distance between 2, 3 or all 4 moving averages, with the zero line being the point where the distance between them is zero, but it is also necessary to know the direction of the movement, and that is where the modified ADX will be useful.
This is the well known Directional Movement Indicator (DMI), where the +DI and -DI lines of the ADX will serve to determine the direction of the trend.
MTF RSI Fibonacci Levels & MTF Moving Avreages (EMA-SMA-WMA)Thanks for Kadir Türok Özdamar. @kadirturokozdmr
Formula Purpose of Use
This formula combines the traditional RSI indicator with Fibonacci levels to create a special technical indicator that aims to identify potential support and resistance points:
Thanks for Kadir Türok Özdamar. @kadirturokozdmr
Formula Purpose of Use
This formula combines the traditional RSI indicator with Fibonacci levels to create a special technical indicator that aims to identify potential support and resistance points:
Determines the historical RSI range of 144 periods (PEAK and DIP)
Calculates Fibonacci retracement levels within this range, and shows the direction of momentum by calculating the moving average of the RSI
This indicator can be used to identify potential reversal points, especially when the RSI is not in overbought (70+) or oversold (30-) areas.
Practical Use
Investors can use this indicator as follows:
1⃣When the RSI approaches one of the determined Fibonacci levels, it is considered a potential support/resistance area.
2⃣When the RSI approaches the DIP level, it can be interpreted as oversold, and when it approaches the PEAK level, it can be interpreted as overbought.
3⃣When the RSI crosses the SM (moving average) line upwards or downwards, it can be evaluated as a momentum change signal.
4⃣Fibonacci levels (especially M386, M500 and M618) can be monitored as important transition zones for the RSI.
--------------------------------------------
In this version, some features and a multi-timeframe averages (SMA-EMA-WMA) were added to the script. It was made possible for the user to enter multi-timeframe RSI and multi-timeframe Fibo lengths.
Сига EMA-RSIConditions
- The signal is formed only when the EMA9 and EMA20 intersect and the RSI conditions are met
The precondition is that the RSI should break through the 55 level from top to bottom for long and 45 from bottom to top for short
- The signal is formed when EMA9 and EMA20 intersect and the RSI condition is met
This combination works perfectly on trend reversals.Patterns.
Сига EMA-RSIConditions
- The signal is formed only when the EMA9 and EMA20 intersect and the RSI conditions are met
The precondition is that the RSI should break through the 55 level from top to bottom for long and 45 from bottom to top for short
- The signal is formed when EMA9 and EMA20 intersect and the RSI condition is met
This combination works perfectly on trend reversals.Patterns.
EMA 20/50/100/200 Color-Coded20/50/100/200 EMA indicator with a color-coding option that changes the color of an EMA line to green every time the price is above the EMA and red every time the price is below the EMA.
mpa ai.v3**mpa ai.v3** is a professional, closed-source Invite-Only strategy developed by the MPA team. It is designed to detect high-probability trade opportunities using a hybrid system of market structure analysis and adaptive volatility-based filtering.
---
**🔍 Strategy Logic:**
This script combines several proven trading concepts to ensure reliable entry and exit signals:
• **Smart Money Concepts:**
- Break of Structure (BoS)
- Liquidity Zones & Fair Value Gaps (FVG)
- Trend-based liquidity traps
• **Market Structure Engine:**
- Automatic recognition of HH/HL and LL/LH transitions
- Real-time directional bias detection
• **Adaptive Trend Filtering:**
- Dynamic ADX and EMA slope confirmation
- Adjusts thresholds based on current market volatility
• **Volatility-Aware Risk Management:**
- TP and SL are calculated from a combination of Fibonacci extension and ATR projection
- Risk/Reward ratios are adjusted based on live volatility regimes
---
**🧠 Core Features:**
• Trend-confirmed signals only (no trades in range/noise)
• One position per signal to reduce noise and overtrading
• Backtest range fully configurable with calendar inputs
• TP/SL levels shown on the chart with real-time % labels
• Position auto-closes after 24 hours if target not reached
• Clean EMA overlays for visual clarity
• Full chart UI in English, script logic is obfuscated
• Optimized for 15-minute charts but adaptable to other timeframes
---
**📊 Backtest Parameters:**
• Capital: `$10,000`
• Order Size: `$25,000` (Assumes 10x leverage)
• Slippage: `2 ticks`
• Commission: `0.05%`
• Margin Requirement: `10%` for long and short positions
• Backtest Duration: `3 months` (from Mar 15 to May 15, 2025)
• Trade size and stop loss ensure risk per trade is <2% of capital
These settings aim to replicate realistic conditions for leveraged accounts while maintaining statistical robustness.
EMAsThe TradingView Multiple EMA Indicator is a powerful and versatile tool designed to provide traders with a comprehensive view of market trends across multiple timeframes. By incorporating SIX Exponential Moving Averages (EMAs) with customizable lengths and sources, this indicator offers a nuanced approach to trend analysis, suitable for both novice and experienced traders.
Key Features:
SIX customizable EMAs for multi-timeframe analysis
Flexible source inputs for each EMA
Color-coded plots for easy visual interpretation
Overlay functionality for direct price action comparison