Smooth Fibonacci BandsSmooth Fibonacci Bands
This indicator overlays adaptive Fibonacci bands on your chart, creating dynamic support and resistance zones based on price volatility. It combines a simple moving average with ATR-based Fibonacci levels to generate multiple bands that expand and contract with market conditions.
## Features
- Creates three pairs of upper and lower Fibonacci bands
- Smoothing option for cleaner, less noisy bands
- Fully customizable colors and line thickness
- Adapts automatically to changing market volatility
## Settings
Adjust the SMA and ATR lengths to match your trading timeframe. For short-term trading, try lower values; for longer-term analysis, use higher values. The Fibonacci factors determine how far each band extends from the center line - standard Fibonacci ratios (1.618, 2.618, and 4.236) are provided as defaults.
## Trading Applications
- Use band crossovers as potential entry and exit signals
- Look for price bouncing off bands as reversal opportunities
- Watch for price breaking through multiple bands as strong trend confirmation
- Identify potential support/resistance zones for placing stop losses or take profits
Fibonacci Bands combines the reliability of moving averages with the adaptability of ATR and the natural market harmony of Fibonacci ratios, offering a robust framework for both trend and range analysis.
Moving Averages
Precise EMA Cross Strategy (20, 50, 200)Precise EMA Cross Strategy (20, 50, 200)
🧠 Core Concept:
This strategy is designed to capture major trend reversals using Exponential Moving Averages (EMAs) and avoid false signals by requiring:
A confirmed EMA crossover (Golden/Death Cross).
Confirmation from the trend direction (slope) of the 200 EMA.
The price to be aligned with the direction of the signal (above or below EMAs).
📊 Components:
EMA 20 (Green): Short-term price momentum.
EMA 50 (Red): Medium-term trend reference.
EMA 200 (Yellow): Long-term trend foundation.
✅ Trade Entry Rules:
🔼 Buy Signal (Golden Cross):
Occurs when:
EMA 50 crosses above EMA 200.
The slope of EMA 200 is upward, confirming long-term uptrend.
Price is above both EMA 50 and EMA 200, showing bullish market strength.
🔔 You'll see a green "BUY" marker below the candle.
This is a high-probability long entry setup.
🔽 Sell Signal (Death Cross):
Occurs when:
EMA 50 crosses below EMA 200.
The slope of EMA 200 is downward, confirming a bearish trend.
Price is below both EMA 50 and EMA 200, confirming weakness.
🔔 You'll see a red "SELL" marker above the candle.
This is a high-probability short entry setup.
📅 Best Timeframes to Use:
Swing trading: 1H, 4H, Daily
Position trading: Daily, Weekly
Not suitable for scalping on low timeframes (e.g. 1min or 5min) due to EMA smoothing delay
🧪 Backtesting Tips:
Look for confirmation on higher timeframes (e.g., 4H or 1D).
Combine this strategy with:
RSI divergence
Volume spikes
Support/resistance zones
⚠️ Avoid False Signals:
Do not trade if the slope of EMA 200 is flat or conflicting with the crossover.
Avoid trading in sideways markets or low-volatility environments.
🔔 Alerts:
The script includes built-in alert conditions:
Golden Cross Alert
Death Cross Alert
Set them in TradingView’s alert panel to get notified when a valid trade setup forms.
💡 Example Trade Flow:
BUY Example:
1H chart: EMA 50 crosses above EMA 200 ✅
Slope of EMA 200 is rising ✅
Price is above both EMAs ✅
➡️ Enter a long position
🎯 Set take profit at previous resistance or use trailing stop
🛑 Stop loss just below recent swing low or EMA 200
SELL Example:
4H chart: EMA 50 crosses below EMA 200 ✅
Slope of EMA 200 is falling ✅
Price is below both EMAs ✅
➡️ Enter a short position
🎯 Set TP at support or use trailing
🛑 SL above recent swing high or EMA 200
🧩 Combine With:
Candlestick patterns (e.g., engulfing, pin bar)
Breakout levels
Fibonacci retracement zones
Futures Strategy: EMA + CPR + RSI + Volume + AlertsBuy when:
20 EMA crosses above 50 EMA
Price is above CPR
RSI is in acceptable zone (optional)
Volume is above average
📉 Sell when:
20 EMA crosses below 50 EMA
Price is below CPR
RSI is in acceptable zone (optional)
Volume is above average
WaveTrend Filtered Signals (LazyBear Style)WaveTrend Filtered Signals (LazyBear Style)
This indicator is based on the popular WaveTrend oscillator (LazyBear) and adds several optional filters to improve signal quality:
✅ Available filters:
WT oversold/overbought zones – enabled by default. Signals are shown only if WT was previously in the specified zone (e.g., < -60 for longs, > 60 for shorts).
SMA trend filter – allows filtering signals in the direction of the moving average trend.
SMA position filter – signals appear only when price is above (for long) or below (for short) the moving average.
Consolidation filter – ignores signals during low-volatility sideways price movement.
💡 All filters are optional and can be enabled or disabled in the settings.
The default setup focuses on a clean approach: WaveTrend + oversold/overbought zones, with other filters left for customization.
Gold Strategy with Buy/Sell Signals//@version=5
indicator("Gold Analysis Setup", overlay=true)
// === Moving Averages ===
ma20 = ta.sma(close, 20)
ma50 = ta.sma(close, 50)
plot(ma20, title="MA 20", color=color.red, linewidth=2)
plot(ma50, title="MA 50", color=color.blue, linewidth=2)
// === Bollinger Bands (20, 2) ===
basis = ta.sma(close, 20)
dev = 2 * ta.stdev(close, 20)
upperBB = basis + dev
lowerBB = basis - dev
p1 = plot(upperBB, "Upper BB", color=color.red, linewidth=1, transp=70)
p2 = plot(lowerBB, "Lower BB", color=color.red, linewidth=1, transp=70)
fill(p1, p2, color=color.red, transp=90)
// === RSI and RSI 9MA (in separate pane) ===
rsi = ta.rsi(close, 14)
rsi_ma9 = ta.sma(rsi, 9)
rsiPlot = plot(rsi, title="RSI", color=color.blue)
rsiMAPlot = plot(rsi_ma9, title="RSI 9MA", color=color.red)
hline(70, "Overbought", color=color.gray)
hline(30, "Oversold", color=color.gray)
hline(50, "Midline", color=color.gray, linestyle=hline.style_dotted)
// === Plot Key Price Levels (optional) ===
plot(3285, title="Target 2", color=color.green, linewidth=1, style=plot.style_linebr)
plot(3260, title="Target 1", color=color.green, linewidth=1, style=plot.style_linebr)
plot(3230.05, title="Current Price", color=color.gray, linewidth=1, style=plot.style_linebr)
plot(3200, title="Support 1", color=color.blue, linewidth=1, style=plot.style_linebr)
plot(3182, title="Support 2", color=color.red, linewidth=1, style=plot.style_linebr)
plot(3154, title="Support 3", color=color.red, linewidth=1, style=plot.style_linebr)
Z-Score Spread IndicatorVanilla Z-Score Indicator. Basic formula calculating the z score against rolling MA and STD.
Futures Strategy: EMA + CPR + RSI (No OI)Strategy Logic:
✅ 20 EMA / 50 EMA crossover for trend direction
✅ CPR (Central Pivot Range) for support/resistance context
✅ Optional enhancements:
RSI filter to avoid overbought/oversold zones
Volume filter to avoid weak signals
Multiple Moving AverageSeven moving averages, to assess momentum in short term, medium term and long term, with ability to change periods, color and moving average type. Useful in pullback trading
Bull Market Support Band20 Week SMA & 21 Week EMA band, indicator of rough overall sentiment for the market.
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.
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")
Wave Trend + Fearzone + Signal Combo with ReversalIn this example, you need to replace variables like wt1, wt2, fearZoneTop, fearZoneBottom with the actual WaveTrend and FearZone calculations.
You can place and use your full WaveTrend and FearZone code in the code above.
If you want, I can add this logic to the WaveTrend + FearZone code you gave me, complete and working, and give it to you. If you want, I can do that right away.
ST + Multi-EMASuperTrend with multiple EMAs.
The indicator includes Supertrend and 10 EMAs. Hope it helps those who are looking for multiple EMAs in one indicator.
Redwire's ALMA Bands with Alerts This script is basically an extension of Redwire's Alma bands developed by (in.tradingview.com). A big thanks to him
This is a script I like a lot as it has Alma bands based on Fibonacci numbers and price tends to respect these very often.
All I have done with AI help is create a code with more Alma Fib MA's + Alarms incorporated, such that there is a trigger when a certain condition is met(for ex -price crossing Alma-55 or Alma 89)
If the ALMA MA's are all inter-twined/criss-crossing each other, price tends to be range bound. If the ALMA bands are all neatly stacked up/down, it tends to indicate a breakout/breakdown
Hope this is of help to fellow traders. Pls note that I am not a coder nor any analyst of any sort. Pls backtest and research accordingly before trading. Best wishes
Buy Setup with TP/SL5 EMA entry and Stoploss only. you need to take decision of where to take profit. some time trade can continue in your favour for 2 to 3 days.
Elder Envelope V2Based on the public script by idu. (Elder Impulse System with AutoEnvelope combined by idu)
I enhanced it by adding:
- second set of envelope bands
-alerts for Short and Center EMAs cross
- fill between EMAs
I find this strategy good for swing trading on daily timeframes to determine overbought/oversold conditions. When stock is near 2nd upper band - take profits/short, when near lower -2nd band cover short/buy longs. Bull bear trend is determined by the short and long(center) emas cross. In rangebound flat trends gives false signals. Best edge is when near extremes of the bands.
ORB-5Min with VWAP & EMAFirst 5-min ORB: Accurately captured from 09:15–09:20.
VWAP: Plotted live for the session, colored green.
EMA: Customizable period, plotted as a separate signal line.
Fill: Visual white fill between high and low range.
VWMA/EMA Crossover with Volume SignalVWMA Cross over EMA with buy sell signals and Strong buy sell signals. Works well with short term charts.
Multi EMADescription – Multi-EMA Indicator (10/21/66/110/200 EMA)
This indicator combines five essential Exponential Moving Averages (EMAs) into one tool: the 10, 21, 66, 110, and 200 EMA. It's designed for traders who want a clear view of short-, medium-, and long-term trends all in one place.
With this indicator, you can:
Quickly assess trend direction across multiple timeframes
Identify dynamic support and resistance levels
Spot EMA crossovers that may signal potential trade entries or exits
Each EMA is color-coded and can be toggled on or off individually, giving you full control over your chart setup.
Moving Average Ribbon7 multiple moving averages, with options to change period, colour and moving average type. This is helpful while taking pullback trades
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.