Anchored VWAP by Time (Math by Thomas)📄 Description
This tool lets you plot an Anchored Volume Weighted Average Price (VWAP) starting from any specific date and time you choose. Unlike standard VWAPs that reset daily or weekly, this version gives you full control to track institutional pricing zones from precise anchor points—such as key swing highs/lows, market open, or news-driven candles.
It’s especially useful for price action and Smart Money Concepts (SMC) traders who track liquidity, fair value gaps (FVGs), and institutional zones.
🇮🇳 For NSE India Traders
You can anchor VWAP to Indian market open (e.g., 9:15 AM IST) or major events like RBI policy, earnings, or breakout candles.
The time input uses UTC by default, so for Indian Standard Time (IST), remember:
9:15 AM IST = 3:45 AM UTC
3:30 PM IST = 10:00 AM UTC
⚙️ How to Use
Add the indicator to your chart.
Open the settings panel.
Under “Anchor Start Time”, choose the date & time to begin the VWAP.
Use UTC format (adjust from IST if needed).
Customize the line color and thickness to suit your chart style.
The VWAP will begin plotting from that time forward.
🔎 Best Use Cases
Track VWAP from intraday range breakouts
Anchor from swing highs/lows to identify mean reversion zones
Combine with your FVGs, Order Blocks, or CHoCHs
Monitor VWAP reactions during key macro events or expiry days
🔧 Clean Design
No labels are used, keeping your chart clean.
Works on all timeframes (1min to Daily).
Designed for serious intraday & positional traders.
ממוצעים נעים
Intraday Multi-Indicator StrategyBuys when trend, momentum, volume, and pattern align.
Sells when downtrend, weak momentum, volume, and bearish pattern align.
Exits based on RSI or MACD reversal.
Uses labels and shapes to clearly show what happened and why.
Works best on 15 mins TF.
SuperBuy/TrendFollowingThis indicator can mark buy and sell points. There are comments in the code, and you can enable the secondary buy and sell point function yourself.
POC + VWAP Strategy w/ Time Filter & Trailing StopPoint of control from fixed range volume profile is determined on a 15 min chart. When price touches the point of control and price is below VWAP, it is a sell. When price is above vwap a buy happens. Only one trade at at time and there are trailing stop and take profit parameters.
magic wand STSM🔮 Magic Wand STSM | Multi-Timeframe ATR SuperTrend Strategy
This strategy is designed for backtesting purposes only. It includes:
- ATR-based SuperTrend trend detection
- Multi-timeframe confirmation (1H and 30min logic)
- EMA and SMA filters to avoid trading against major trends
- Dynamic lot sizing based on risk % and user-defined equity
- Daily and monthly performance tracking (win/loss filtering)
- Risk management via optional trading halts after poor performance
- Session-based and time-based filters to avoid low-liquidity periods
🔎 Visual performance tracking with summary tables for wins, losses, and net profit.
**Important:**
This strategy does **not place real trades** and is only intended for backtesting and educational use.
Performance metrics are historical and do **not guarantee future results**.
Please use responsibly and adjust to your risk tolerance.
✅ Compliant with TradingView’s policies.
StockTrend_VolThe MACD is computed as normal: EMA(fast) - EMA(slow).
It’s then scaled by volume, normalized over a moving average of volume.
The signal line is the EMA of this volume-weighted MACD.
A histogram shows the difference, as with standard MACD.
Distance % from SMAMeasures distance from the moving average. You can tune it for length and visuals.
EMA Pullback Speed Strategy 📌 **Overview**
The **EMA Pullback Speed Strategy** is a trend-following approach that combines **price momentum** and **Exponential Moving Averages (EMA)**.
It aims to identify high-probability entry points during brief pullbacks within ongoing uptrends or downtrends.
The strategy evaluates **speed of price movement**, **relative position to dynamic EMA**, and **candlestick patterns** to determine ideal timing for entries.
One of the key concepts is checking whether the price has **“not pulled back too much”**, helping focus only on situations where the trend is likely to continue.
⚠️ This strategy is designed for educational and research purposes only. It does not guarantee future profits.
🧭 **Purpose**
This strategy addresses the common issue of **"jumping in too late during trends and taking unnecessary losses."**
By waiting for a healthy pullback and confirming signs of **trend resumption**, traders can enter with greater confidence and reduce false entries.
🎯 **Strategy Objectives**
* Enter in the direction of the prevailing trend to increase win rate
* Filter out false signals using pullback depth, speed, and candlestick confirmations
* Predefine Take-Profit (TP) and Stop-Loss (SL) levels for safer, rule-based trading
✨ **Key Features**
* **Dynamic EMA**: Reacts faster when price moves quickly, slower when market is calm – adapting to current momentum
* **Pullback Filter**: Avoids trades when price pulls back too far (e.g., more than 5%), indicating a trend may be weakening
* **Speed Check**: Measures how strongly the price returns to the trend using candlestick body speed (open-to-close range in ticks)
📊 **Trading Rules**
**■ Long Entry Conditions:**
* Current price is above the dynamic EMA (indicating uptrend)
* Price has pulled back toward the EMA (a "buy the dip" situation)
* Pullback depth is within the threshold (not excessive)
* Candlesticks show consecutive bullish closes and break the previous high
* Price speed is strong (positive movement with momentum)
**■ Short Entry Conditions:**
* Current price is below the dynamic EMA (indicating downtrend)
* Price has pulled back up toward the EMA (a "sell the rally" setup)
* Pullback is within range (not too deep)
* Candlesticks show consecutive bearish closes and break the previous low
* Price speed is negative (downward momentum confirmed)
**■ Exit Conditions (TP/SL):**
* **Take-Profit (TP):** Fixed 1.5% target above/below entry price
* **Stop-Loss (SL):** Based on recent price volatility, calculated using ATR × 4
💰 **Risk Management Parameters**
* Symbol & Timeframe: BTCUSD on 1-hour chart (H1)
* Test Capital: \$3000 (simulated account)
* Commission: 0.02%
* Slippage: 2 ticks (minimal execution lag)
* Max risk per trade: 5% of account balance
* Backtest Period: Aug 30, 2023 – May 9, 2025
* Profit Factor (PF): 1.965 (Net profit ÷ Net loss, including spreads & fees)
⚙️ **Trading Parameters & Indicator Settings**
* Maximum EMA Length: 50
* Accelerator Multiplier: 3.0
* Pullback Threshold: 5.0%
* ATR Period: 14
* ATR Multiplier (SL distance): 4.0
* Fixed TP: 1.5%
* Short-term EMA: 21
* Long-term EMA: 50
* Long Speed Threshold: ≥ 1000.0 (ticks)
* Short Speed Threshold: ≤ -1000.0 (ticks)
⚠️Adjustments are based on BTCUSD.
⚠️Forex and other currency pairs require separate adjustments.
🔧 **Strategy Improvements & Uniqueness**
Unlike basic moving average crossovers or RSI triggers, this strategy emphasizes **"momentum-supported pullbacks"**.
By combining dynamic EMA, speed checks, and candlestick signals, it captures trades **as if surfing the wave of a trend.**
Its built-in filters help **avoid overextended pullbacks**, which often signal the trend is ending – making it more robust than traditional trend-following systems.
✅ **Summary**
The **EMA Pullback Speed Strategy** is easy to understand, rule-based, and highly reproducible – ideal for both beginners and intermediate traders.
Because it shows **clear visual entry/exit points** on the chart, it’s also a great tool for practicing discretionary trading decisions.
⚠️ Past performance is not a guarantee of future results.
Always respect your Stop-Loss levels and manage your position size according to your risk tolerance.
SMA Backtest Optimizer [Mr_Rakun]The SMA Backtest Optimizer is a powerful Pine Script tool designed to systematically analyze and compare various Simple Moving Average (SMA) periods to identify the most profitable configuration for trading strategies. This indicator tests multiple SMA periods (from 10 to 100) using a crossover strategy where buys occur when price crosses above the SMA and sells when price crosses below it.
Key Features:
Tests 10 different SMA periods to determine optimal settings
Calculates profit/loss based on a defined starting capital
Tracks total profit and number of trades for each period
Visually highlights the best performing SMA on your chart
Displays comprehensive results in an easy-to-read table
Labels the chart with key performance metrics
This code serves as a core framework that traders can customize for their specific needs. You can easily modify the strategy parameters, test different technical indicators, adjust capital settings, or implement more complex entry/exit rules. The optimization methodology can be applied to virtually any trading approach you wish to evaluate.
Feel free to adapt this framework to test your own trading ideas and discover which parameters work best in different market conditions.
My S.T.A.C.K.📊 My S.T.A.C.K. (Simplified TA Combined Kit)
All your favorite technical tools in one clean, customizable overlay.
My S.T.A.C.K. is a power-packed indicator designed to streamline your chart by combining the most commonly used technical analysis tools into a single, space-saving script. Whether you're a trend trader, swing trader, or just looking to declutter your view — this kit gives you everything you need, nothing you don’t.
🔧 Features:
5 Customizable Moving Averages: Choose your type (SMA, EMA, WMA, etc.) and periods to match your strategy.
Bollinger Bands: Visualize volatility and overbought/oversold zones with precision.
Donchian Channels: Spot breakouts and trend reversals based on high/low ranges.
ATR Bands: Adaptive support/resistance zones based on Average True Range.
Clean Visualization: Toggle each element on or off, adjust colors, and focus only on what matters.
✅ Ideal For:
- Traders who want multiple indicators in one place
- Reducing indicator clutter on TradingView
- Quick visual analysis without switching scripts
EMA Distance Indicator [Eddie_Bitcoin]🧠 EMA Distance Indicator
This indicator is a powerful statistical tool designed to provide enhanced context and signal confirmation for traders who want to go beyond price action alone.
🔍 What It Does
It calculates and visualizes the distance (%) between two EMAs (Fast & Slow) on either the current chart symbol or a selected macro/index reference (e.g., BTC Dominance, TOTAL2, SPX). But it doesn't stop there:
Core Features:
✅ Real-time percentage distance between Fast and Slow EMAs
📈 Slope (acceleration) of the distance to capture trend momentum
🎯 Gaussian-based percentile rank of the current distance over a configurable historical sample
📊 Dynamic table display with intuitive emoji-based cues
🟢 Highlights extreme conditions (e.g., TOP 5% or LOW 5% percentile zones)
🔀 Compare both current asset and a macro/index asset side by side
💡 Display Modes:
Show only current symbol
Show only index/macro symbol
Show both with independently positioned tables
🎯 Ideal Use Case
This is not a standalone strategy, but rather a statistical enhancement module designed to pair with tools like my 👉 “AltCoin Index Correlation” indicator. It gives traders a quick-glance view of strength, divergence, and macro alignment for better timing and confidence.
Whether you’re trading altcoins, tracking dominance charts, or watching indices, this tool offers deep visual insight into EMA-based dynamics — wrapped in a clean, emoji-driven UI.
🛠 Created with ❤️ by @Eddie_Bitcoin
🚀 ### Check my profile for other juicy hints and original strategies. ### 🚀
Customizable 10‑MA SuiteCustomizable 10‑Moving‑Average Suite
OverviewPlot up to 10 independent moving averages on a single chart. Every line can be tailored to your trading style with adjustable length, timeframe, MA type (SMA, EMA, WMA, RMA, VWMA, HMA, LinReg), data source, colour, width, and plot style.
Key Features
True multi‑time‑frame support via request.security(): mix intraday and higher‑time‑frame MAs effortlessly.
Fine‑grained visibility control: toggle each MA on/off to keep charts clean and script performance high.
Versatile display options: choose between line, step, histogram, or area plots for every MA.
Typical Use‑Cases
Quickly compare short‑, medium‑, and long‑term trends.
Identify dynamic support/resistance and moving‑average crossovers.
Add confluence to existing strategies or discretionary setups.
Pro TipHighlight your primary trend MA with a thicker line and bolder colour, while setting secondary MAs to thinner or dashed styles—this keeps focus where it matters and prevents visual clutter.
Enjoy!
DECODE Moving Average ToolkitDECODE Moving Average Toolkit: Your All-in-One MA Analysis Powerhouse!
This versatile indicator is designed to be your go-to solution for analysing trends, identifying potential entry/exit points, and staying ahead of market movements using the power of Moving Averages (MAs).
Whether you're a seasoned trader or just starting out, the Decode MAT offers a comprehensive suite of features in a user-friendly package.
Key Features:
Multiple Moving Averages: Visualize up to 10 Moving Averages simultaneously on your chart.
Includes 5 Exponential Moving Averages (EMAs) and 5 Simple Moving Averages (SMAs).
Easily toggle the visibility of each MA and customize its length to suit your trading style and the asset you're analyzing.
Dynamic MA Ribbons: Gain a clearer perspective on trend direction and strength with 5 configurable MA Ribbons.
Each ribbon is formed between a corresponding EMA and SMA (e.g., EMA 20 / SMA 20).
The ribbon color changes to indicate bullish (e.g., green) or bearish (e.g., red) sentiment, providing an intuitive visual cue.
Toggle ribbon visibility with a single click.
Powerful Crossover Alerts: Never miss a potential trading opportunity with up to 5 customizable MA Crossover Alerts.
Define your own fast and slow MAs for each alert from any of the 10 available MAs.
Receive notifications directly through TradingView when your specified MAs cross over or cross under.
Optionally display visual symbols (e.g., triangles ▲▼) directly on your chart at the exact crossover points for quick identification.
Highly Customizable:
Adjust the source price (close, open, etc.) for all MA calculations.
Fine-tune the appearance (colors, line thickness) of every MA line, ribbon, and alert symbol to match your charting preferences.
User-Friendly Interface: All settings are neatly organized in the indicator's input menu, making configuration straightforward and intuitive.
How Can You Use the Decode MAT in Your Trading?
This toolkit is incredibly versatile and can be adapted to various trading strategies:
Trend Identification:
Use longer-term MAs (e.g., 50, 100, 200 period) to identify the prevailing market trend. When prices are consistently above these MAs, it suggests an uptrend, and vice-versa.
Observe the MA ribbons: A consistently green ribbon can indicate a strong uptrend, while a red ribbon can signal a downtrend. The widening or narrowing of the ribbon can also suggest changes in trend momentum.
Dynamic Support & Resistance:
Shorter-term MAs (e.g., 10, 20 period EMAs) can act as dynamic levels of support in an uptrend or resistance in a downtrend. Look for price pullbacks to these MAs as potential entry opportunities.
Crossover Signals (Entries & Exits):
Golden Cross / Death Cross: Configure alerts for classic crossover signals. For example, a 50-period MA crossing above a 200-period MA (Golden Cross) is often seen as a long-term bullish signal. Conversely, a 50-period MA crossing below a 200-period MA (Death Cross) can be a bearish signal.
Shorter-Term Signals: Use crossovers of shorter-term MAs (e.g., EMA 10 crossing EMA 20) for more frequent, shorter-term trading signals. A fast MA crossing above a slow MA can signal a buy, while a cross below can signal a sell.
Use the on-chart symbols for quick visual confirmation of these crossover events.
Confirmation Tool:
Combine the Decode MAT with other indicators (like RSI, MACD, or volume analysis) to confirm signals and increase the probability of successful trades. For instance, a bullish MA crossover combined with an oversold RSI reading could strengthen a buy signal.
Multi-Timeframe Analysis:
Apply the toolkit across different timeframes to get a broader market perspective. A long-term uptrend on the daily chart, confirmed by a short-term bullish crossover on the 1-hour chart, can provide a higher-confidence entry.
The DECODE Moving Average Toolkit empowers you to tailor your MA analysis precisely to your needs.
Clock&Flow MM+InfoThis script is an indicator that helps you visualize various moving averages directly on the price chart and gain some additional insights.
Here's what it essentially does:
Displays Different Moving Averages: You can choose to see groups of moving averages with different periods, set to nominal cyclical durations. You can also opt to configure them for instruments traded with classic or extended trading hours (great for Futures), and they'll adapt to your chosen timeframe.
Colored Bands: It allows you to add colored bands to the background of the chart that change weekly or daily, helping you visualize time cycles. You can customize the band colors.
Information Table: A small table appears in a corner of the chart, indicating which cycle the moving averages belong to (daily, weekly, monthly, etc.), corresponding to the timeframe you are using on the chart.
Customization: You can easily enable or disable the various groups of moving averages or the colored bands through the indicator's settings.
It's a useful tool for traders who use moving averages to identify trends and support/resistance levels, and who want a quick overview of market cycles.
Questo script è un indicatore che aiuta a visualizzare diverse medie mobili direttamente sul grafico dei prezzi e a ottenere alcune informazioni aggiuntive.
In pratica, fa queste cose:
Mostra diverse medie mobili: Puoi scegliere di vedere gruppi di medie mobili con periodi diversi impostati sulle durate cicliche nominali. Puoi scegliere se impostarle per uno strumento quotato con orario di negoziazione classico o esteso (ottimo per i Futures) e si adattano al tuo timeframe).
Bande colorate: Ti permette di aggiungere delle bande colorate sullo sfondo del grafico che cambiano ogni settimana o ogni giorno, per aiutarti a visualizzare i cicli temporali. Puoi scegliere il colore delle bande.
Tabella informativa: In un angolo del grafico, compare una piccola tabella che indica a quale ciclo appartengono le medie mobili (giornaliero, settimanale, mensile, ecc.) e corrispondono in base al timeframe che stai usando sul grafico.
Personalizzazione: Puoi facilmente attivare o disattivare i vari gruppi di medie mobili o le bande colorate tramite le impostazioni dell'indicatore.
È uno strumento utile per i trader che usano le medie mobili per identificare trend e supporti/resistenze, e che vogliono avere un colpo d'occhio sui cicli di mercato.
Dual Pwma Trends [ZORO_47]Key Features:
Dual PWMA System: Combines a fast and slow Parabolic Weighted Moving Average to identify momentum shifts and trend changes with precision.
Dynamic Color Coding: The indicator lines change color to reflect market conditions—green for bullish crossovers (potential buy signals) and red for bearish crossunders (potential sell signals), making it easy to interpret at a glance.
Customizable Parameters: Adjust the fast and slow PWMA lengths, power settings, and source data to tailor the indicator to your trading style and timeframe.
Clean Visualization: Plotted with bold, clear lines (3px width) for optimal visibility on any chart, ensuring you never miss a signal.
How It Works:
The indicator calculates two PWMAs using the imported ZOROLIBRARY by ZORO_47. When the fast PWMA crosses above the slow PWMA, both lines turn green, signaling a potential bullish trend. Conversely, when the fast PWMA crosses below the slow PWMA, the lines turn red, indicating a potential bearish trend. The color persists until the next crossover or crossunder, providing a seamless visual cue for trend direction.
Ideal For:
Trend Traders: Identify trend reversals and continuations with clear crossover signals.
Swing Traders: Use on higher timeframes to capture significant price moves.
Day Traders: Fine-tune settings for faster signals on intraday charts.
Settings:
Fast Length/Power: Control the sensitivity of the fast PWMA (default: 12/2).
Slow Length/Power: Adjust the smoother, slower PWMA (default: 21/1).
Source: Choose your preferred data input (default: close price).
Adaptive Multi-TF Indicator Table with Presets giua64📌 Script Name:
Adaptive Multi-Timeframe Indicator Table with Presets — giua64
📄 Description:
This script displays an adaptive multi-timeframe dashboard that summarizes the signals of three key technical indicators:
Moving Averages (MAs), Relative Strength Index (RSI), and MACD.
It provides a fast and visually intuitive overview of market conditions across five timeframes (5m, 15m, 30m, 1h, 4h), helping traders quickly identify potential directional biases (e.g., bullish, bearish, or neutral) based on either predefined presets or fully manual settings.
🧰 Preset Configurations:
You can choose between four trading styles, each with optimized indicator parameters:
Scalping
• MAs: 5 / 10 (Fast), 20 / 50 (Slow)
• RSI: 7 periods | Overbought: 70 | Oversold: 30
• MACD: 5 / 13 | Signal: 3
Intraday
• MAs: 9 / 21 (Fast), 50 / 100 (Slow)
• RSI: 14 periods | Overbought: 60 | Oversold: 40
• MACD: 12 / 26 | Signal: 9
Swing
• MAs: 10 / 20 (Fast), 50 / 200 (Slow)
• RSI: 14 periods | Overbought: 65 | Oversold: 35
• MACD: 12 / 26 | Signal: 9
Manual
• Full custom control over all indicator settings.
🛠️ All settings can be customized manually from the options panel, including the exact MA periods, RSI thresholds, and MACD structure.
🧠 How It Works:
For each timeframe, the script evaluates:
MA crossover status (two levels):
The first symbol refers to the crossover of the fast MAs
The second symbol refers to the crossover of the slow MAs
🟢 = Bullish crossover
🔴 = Bearish crossover
➖ = Flat or no clear signal
RSI Direction:
↑ = RSI above upper threshold (potential overbought)
↓ = RSI below lower threshold (potential oversold)
→ = RSI in neutral range
MACD Line vs Signal Line:
↑ = MACD line is above signal line (bullish)
↓ = MACD line is below signal line (bearish)
→ = Flat or neutral signal
Each signal is assigned a numerical score. These are aggregated per timeframe to compute a combined score that reflects the directional bias for that specific time window.
🧠 Adaptive Logic by Asset:
This script is designed to be universally compatible across all asset types — including forex, crypto, stocks, indices, and commodities.
Thanks to its multi-timeframe nature and flexible indicator presets, the script automatically adjusts its behavior based on the asset selected, ensuring relevant analysis without requiring manual recalibration.
🧾 Summary Table Output:
At the bottom of the dashboard, a combined sentiment is displayed for:
3TF → 5m, 15m, 30m
4TF → Adds 1h
5TF → Adds 4h
Each row shows:
Signal → LONG / SHORT / NEUTRAL
Confidence (%) → Based on score aggregation and signal consistency
📌 Customization Options:
Table Position: Left, Right, or Center
Text Size: Small, Normal, or Large
Full Manual Configuration: All MA, RSI, and MACD parameters can be adjusted as needed
⚠️ Disclaimer:
This script is for educational and analytical purposes only.
It does not constitute financial advice or guarantee any trading results.
Always do your own research and apply responsible risk management.
Hull-Exponential Moving Average (HEMA)The Hull Exponential Moving Average (HEMA) is an experimental technical indicator that uses a sequence of Exponential Moving Averages (EMAs) with the same logic as HMA - except with EMAs and not WMAs. It aims to create a responsive yet smooth trend indicator than HMA.
HEMA applies a multi-stage EMA process. Initial EMAs are calculated using alphas derived from logarithmic relationships and the input period. Their outputs are then combined in a de-lagging step, which itself uses a logarithmically derived ratio. A final EMA smoothing pass is then applied to this de-lagged series. This creates a moving average that responds quickly to genuine price changes while maintaining effective noise filtering. The specific alpha calculations and the de-lagging formula contribute to its balance between responsiveness and smoothness.
▶️ **Core Concepts**
Logarithmically-derived alphas: Alpha values for the three EMA stages are derived using natural logarithms and specific formulas related to the input period **N**.
Three-stage EMA process: The calculation involves:
An initial EMA (using **αS**) on the source data.
A second EMA (using **αF**) also on the source data.
A de-lagging step that combines the outputs of the first two EMAs using a specific ratio **r**.
A final EMA (using **αFin**) applied to the de-lagged series.
Specific de-lagging formula: Utilizes a constant ratio **r = ln(2.0) / (1.0 + ln(2.0))** to combine the outputs of the first two EMAs, aiming to reduce lag.
Optimized final smoothing: The alpha for the final EMA (**αFin**) is calculated based on the square root of the period **N**.
Warmup compensation: The internal EMA calculations include a warmup mechanism to provide more accurate values from the initial bars. This involves tracking decay factors (**eS**, **eF**, **eFin**) and applying a compensation factor **1.0 / (1.0 - e_decay)** during the warmup period. A shared warmup duration is determined by the smallest alpha among the three stages.
HEMA achieves its characteristics through this multi-stage EMA process, where the specific alpha calculations and the de-lagging step are key to its responsiveness and smoothness.
▶️ **Common Settings and Parameters**
Period (**N**): Default: 10 | Base lookback period for all alpha calculations | When to Adjust: Increase for longer-term trends and more smoothness, decrease for shorter-term signals and more responsiveness
Source: Default: Close | Data point used for calculation | When to Adjust: Change to HL2, HLC3, or OHLC4 for different price representations
Pro Tip: The HEMA's behavior is sensitive to the **Period** setting due to the non-linear relationships in its alpha calculations. Experiment with values around your typical MA periods. Small changes in **N** can have a noticeable impact, especially for smaller **N** values.
▶️ **Calculation and Mathematical Foundation**
Simplified explanation:
HEMA calculates its value through a sequence of three Exponential Moving Averages (EMAs) with specially derived smoothing factors (alphas).
Two initial EMAs are calculated from the source price, using alphas **αS** and **αF**.
The outputs of these two EMAs are combined into a "de-lagged" series.
This de-lagged series is then smoothed by a third EMA, using alpha **αFin**, to produce the final HEMA value.
All internal EMAs use a warmup compensation mechanism for improved accuracy on early bars.
Technical formula (let **N** be the input period):
1. Alpha for the first EMA (slow component related):
αS = 3.0 / (2.0 * N - 1.0)
2. Lambda for **αS** (intermediate value):
λS = -ln(1.0 - αS)
Note: **αS** must be less than 1, which implies 2N-1 > 3 or N > 2 for **λS** to be well-defined without NaN from ln of non-positive number. The code uses nz() for robustness but the formula implies this constraint.
3. De-lagging ratio **r**:
r = ln(2.0) / (1.0 + ln(2.0))
(This is a constant, approximately 0.409365)
4. Alpha for the second EMA (fast component related):
αF = 1.0 - exp(-λS / r)
5. Alpha for the final EMA smoothing:
αFin = 2.0 / (sqrt(N) / 2.0 + 1.0)
6. Applying the stages:
**OutputS = EMA_internal(source, αS, eS_state, emaS_state)**
**OutputF = EMA_internal(source, αF, eF_state, emaF_state)**
8. Calculate the de-lagged series:
DeLag = (OutputF / (1.0 - r)) - (r * OutputS / (1.0 - r))
9. Calculate the final HEMA:
HEMA = EMA_internal(DeLag, αFin, eFin_state, emaFin_state)
🔍 Technical Note: The HEMA implementation uses a shared warmup period controlled by **aMin** (the minimum of **αS**, **αF**, **αFin**). During this period, each internal EMA stage still tracks its own decay factor (**eS**, **eF**, **eFin**) to apply the correct compensation. The **nz()** function is used in the code to handle potential NaN values from alpha calculations if **N** is very small (e.g., **N=1** would make **αS=3**, **1-αS = -2**, **ln(-2)** is NaN).
▶️ **Interpretation Details**
HEMA provides several key insights for traders:
When price crosses above HEMA, it often signals the beginning of an uptrend
When price crosses below HEMA, it often signals the beginning of a downtrend
The slope of HEMA provides insight into trend strength and momentum
HEMA creates smooth dynamic support and resistance levels during trends
Multiple HEMA lines with different periods can identify potential reversal zones
HEMA is particularly effective for trend following strategies where both responsiveness and noise reduction are important. It provides earlier signals than traditional EMAs while exhibiting less whipsaw than standard HMA in choppy market conditions. The indicator excels at identifying the underlying trend direction while filtering out minor price fluctuations.
▶️ **Limitations and Considerations**
Experimental nature: As an experimental indicator, HEMA may behave differently from established HMA in certain market conditions
Lag characteristics: While designed to reduce lag, HEMA may exhibit slightly more lag than HMA in some scenarios due to the long tail of EMA
Mathematical complexity: The multi-stage calculation with specialized alpha parameters makes the behavior less intuitive to understand
Parameter sensitivity: Performance can vary significantly with different period settings
Complementary tools: Works best when combined with volume analysis or momentum indicators for confirmation
▶️ **References**
Hull, A. (2005). "Hull Moving Average," Technical Analysis of Stocks & Commodities .
RetryClaude can make mistakes. Please double-check responses.
5min orb all filters (9:45end)5min orb signal fired off the first 5min candle to open/close outside the range.. this version has trend filters and 2 take profit levels with a auto breakeven feature
Trend Signale: EMA Crossovers & Exit Signale✅ Explanation of the Changes:
Uptrend:
Detected when EMA8 crosses above EMA20 (Condition: crossover_up).
Downtrend:
Detected when EMA8 crosses below EMA20 (Condition: crossunder_down).
Exit Signals:
Exit Uptrend: When the close falls below EMA20 (Condition: exit_uptrend).
Exit Downtrend: When the close rises above EMA20 (Condition: exit_downtrend).
Alerts:
Uptrend Alert: When EMA8 > EMA20.
Downtrend Alert: When EMA8 < EMA20.
Exit Uptrend Alert: When the close falls below EMA20.
Exit Downtrend Alert: When the close rises above EMA20.
✅ Alert Settings:
For the Uptrend:
Select the condition EMA Crossover Up and set the alert to “Once per bar.”
Message: “📈 Uptrend detected: EMA8 crosses above EMA20”
For the Downtrend:
Select the condition EMA Crossover Down and set the alert to “Once per bar.”
Message: “📉 Downtrend detected: EMA8 crosses below EMA20”
For the Exit Signal in an Uptrend:
Select the condition Exit Uptrend and set the alert to “Once per bar.”
Message: “⚠️ Exit Uptrend: Close below EMA20”
For the Exit Signal in a Downtrend:
Select the condition Exit Downtrend and set the alert to “Once per bar.”
Message: “⚠️ Exit Downtrend: Close above EMA20”
✅ Chart Visualization:
Uptrend: A green arrow “↑” below the candle.
Downtrend: A red arrow “↓” above the candle.
Exit Uptrend: An orange arrow “↓” above the candle.
Exit Downtrend: A purple arrow “↑” below the candle
Keltner Channels Strategy with Middle Band ExitThis is the strategy version of the popular Keltner Channels Indicator with a Trailing Middle Band Exit.
Recommended use with Renko candles for automation.
Mimas buy and sellBollinger Bands: Calculated using a simple moving average (basis) and standard deviation (dev).
EMAs: Two exponential moving averages (EMA 5 and EMA 20) are plotted to identify short-term and long-term trends.
Price Action Patterns: The script detects higher highs and higher lows for bullish conditions, and lower highs and lower lows for bearish conditions.
Trend Strength: An exponential moving average of the price change is used to gauge the strength of the trend.
Trade Signals: Buy and sell signals are plotted on the chart when specific conditions are met, combining price action patterns, trend strength, Bollinger Bands, and EMA crossovers.
Take-Profit Levels: Dynamic take-profit levels are calculated based on recent swing highs and lows, adjusted by a user-defined multiplier. These levels are displayed on the chart using plot to draw horizontal lines.