מעודכן
[blackcat] L2 Ehlers High Pass Filter (1 pole)

Level:2
Background
The first-order high-pass filter is a classic JF Ehlers specification.
Function
I have found many places where the algorithms are not uniform and some are even wrong. So, I did some research and wrote a high pass filter that I think is correctly defined. This indicator is often used as one of the basic elements of other trading systems.
When you are using it, you need to enter the HPPeriod setting period and specify its bandwidth parameter, the default value is 0.3
Remarks
Free but Open Source
Background
The first-order high-pass filter is a classic JF Ehlers specification.
Function
I have found many places where the algorithms are not uniform and some are even wrong. So, I did some research and wrote a high pass filter that I think is correctly defined. This indicator is often used as one of the basic elements of other trading systems.
When you are using it, you need to enter the HPPeriod setting period and specify its bandwidth parameter, the default value is 0.3
Remarks
Free but Open Source
הערות שחרור
OVERVIEWThe [blackcat] L2 Ehlers High Pass Filter (1 Pole) indicator applies John F. Ehlers' High Pass Filter technique to help traders identify trends and potential entry/exit points. This filter smoothes out noise while preserving trend information, allowing users to make more informed trading decisions. The indicator plots the filtered values on a separate pane and provides visual labels and alerts for buy/sell signals 📈💡.
FEATURES
Implements Ehlers High Pass Filter with user-defined period and bandwidth settings ⚙️
Plots the filtered values on a separate pane with dynamic coloring:
Yellow for upward movements
Fuchsia for downward movements
Provides clear buy ('BUY') and sell ('SELL') labels on the chart 🏷️
Generates alerts for buy and sell signals to keep users informed 🔔
Allows customization of input parameters for tailored performance
HOW TO USE
Add the indicator to your TradingView chart by selecting it from the indicators list.
Adjust the High Pass Period and Bandwidth inputs according to your preferences.
Monitor the plotted line and labels for potential trade opportunities.
Set up alerts based on the generated signals to receive notifications when conditions are met 📲.
Use the indicator alongside other tools for confirmation before executing trades.
LIMITATIONS
The indicator may generate false signals in choppy or ranging markets 🌪️.
Users should always combine this tool with other forms of analysis for better accuracy.
Optimal parameter settings may vary depending on the asset and timeframe being traded.
NOTES
Ensure that you have sufficient historical data available for accurate filtering.
Test the indicator thoroughly on demo accounts before applying it to live trading 🔍.
Experiment with different input parameters to find what works best for your strategy.
הערות שחרור
█ OVERVIEWThis oscillator isolates the short-term cyclical component of price using John Ehlers' one-pole high pass filter, stripping away trend so cycles stand out. V2 upgrades the classic filter into a complete signal engine with a position state machine, reverse-signal exits, ATR-scaled TP/SL reference levels, a live dashboard, and a full alert suite.
█ CONCEPTS
The 1-pole high pass filter attenuates low frequencies (slow trend) and passes high frequencies (rapid cyclical motion). What remains is a detrended momentum wave: when the wave turns up, short-term bullish momentum is building; when it turns down, bearish momentum takes over.
Key principles:
• Trend removal: the filter subtracts the slow component, so readings do not lag a moving-average baseline
• Turning-point signals: entries fire on the filter's direction change, not on static levels
• State-managed logic: a position state machine (long / flat / short) prevents duplicate entries and fires exits on the opposite turn
• Volatility-scaled risk: TP/SL references are anchored to the entry price and sized in ATR multiples
█ HOW TO USE
1 — Add the script to your chart; it runs in a separate pane below price
2 — Keep defaults on liquid symbols, or tune High Pass Period to the dominant cycle (longer = smoother, fewer signals)
3 — Read the labels: E = long entry, S = short entry, XL / XS = long / short exit
4 — Create alerts from "Any alert() function call" for bar-close confirmed notifications, or pick a specific alert condition
Input Parameters
• High Pass Period (20): cutoff period; longer values filter out slower cycles
• Bandwidth (0.3, 0.01-1.0): width of the filter transition band
• Enable Long / Short Signals: one-click direction switches
• Same-bar Entry/Exit Exclusivity (on): exit-first policy when both fire on one bar
• Cooldown Bars (3, 0 = off): minimum spacing between state-changing signals
• ATR Length (14), Stop Loss xATR (2.0), Take Profit xATR (3.0): TP/SL reference sizing
• Visual toggles: signal labels, position background, dashboard
█ FEATURES
• Position state machine with same-bar exclusivity and cooldown - no signal spam in choppy tape
• ATR-scaled stop-loss and take-profit reference levels, shown in the dashboard and data window
• Live dashboard: position, filter value, momentum direction, ATR, SL / TP
• Position background tint (green long / red short) for instant context
• Six static alert conditions plus one dynamic bar-close alert with symbol, timeframe and price
█ SIGNALS
Visual Elements
• Filter line: yellow while rising (bullish momentum), fuchsia while falling (bearish)
• E label (green, up arrow): long entry - the filter turned up
• S label (red, down arrow): short entry - the filter turned down
• XL / XS crosses (orange): long / short exit on the opposite turn
• Green / red background: current long / short state
█ IMPLEMENTATION NOTES
• The filter recursion follows Ehlers' 1-pole design: alpha is derived from the period and bandwidth, and the output combines the detrended price change with the previous filtered value
• All signals evaluate on confirmed bars; the dynamic alert uses bar-close confirmation, so nothing repaints after the bar closes
• ta.atr drives the TP/SL references; no higher-timeframe data is requested
█ LIMITATIONS
• High pass filters respond fast but can whipsaw in flat, range-bound markets - the cooldown and exclusivity filters reduce but do not eliminate this
• Signals are momentum turns, not trend-following entries; combine with trend context
• TP/SL levels are informational references for manual trading, not order placements
• Best suited to liquid markets on intraday and daily timeframes
█ NOTES
• Original filter by John F. Ehlers; V1 by blackcat1402 (MPL 2.0); V2 adds the state machine, exits, ATR risk references, dashboard and alerts
• Educational tool, not financial advice
════════════════════════════════════════════════════════════════════════
For questions or feedback, please use the comments section below.
Feel free to use and modify — attribution appreciated.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.