OLPF - Octavio Low-Pass Filter Strategy

---
DESCRIPTION
The Octavio Low-Pass Filter (OLPF) is an advanced Finite Impulse Response (FIR) low-pass filter designed for financial time series analysis. It builds upon the foundational work of the New Low-Pass Filter (NLF) by Alex Pierrefeu, introducing three key enhancements that significantly improve signal quality and reduce common filtering artifacts.
---
KEY INNOVATIONS
1. HERMITE SMOOTHING POLYNOMIAL
Replaces the simple quadratic base (x²) with the cubic Hermite interpolation polynomial [x²(3-2x)]. This mathematical refinement provides C¹ continuity at kernel boundaries, ensuring smoother transitions and eliminating edge discontinuities that can introduce artificial noise into the filtered signal.
2. LANCZOS SIGMA FACTOR WINDOWING
Applies a Lanczos-type attenuation factor [sin(πi/N)/(πi/N)] to each harmonic component in the sine series. This windowing technique dramatically reduces the Gibbs phenomenon - the characteristic overshooting and ringing that occurs near sharp price transitions. The result is a cleaner signal with minimized false crossover signals.
3. ADAPTIVE WEIGHT NORMALIZATION
Implements dynamic normalization of kernel weights, guaranteeing that the sum of all filter coefficients equals unity. This ensures proper amplitude preservation across all market conditions and prevents signal drift or scaling artifacts.
---
MATHEMATICAL FOUNDATION
The OLPF kernel function is defined as:
K(x, N) = x²(3-2x) + Σ[i=1 to N] (1/i) × σ(i) × sin(πxi)
Where:
- x ∈ [0,1] is the normalized position within the filter window
- N is the filter order (degree of the sine series)
- σ(i) = sin(πi/(N+1)) / (πi/(N+1)) is the Lanczos sigma factor
The filter output is computed via discrete convolution:
F(M, N) = Σ[i=1 to M] src[i-1] × [K(i/M, N) - K((i-1)/M, N)] / W
Where W is the sum of all weights for normalization.
---
APPLICATIONS
- Trend identification with reduced lag compared to traditional MAs
- Noise reduction in volatile market conditions
- Generation of trading signals via fast/slow filter crossovers
- Foundation for more complex indicator development
---
STRATEGY IMPLEMENTATION
This script implements a dual-filter crossover strategy with:
- Fast OLPF for responsive signal generation
- Slow OLPF for trend confirmation
- EMA filter for additional trend validation
- ATR-based dynamic stop-loss positioning
- Risk-based position sizing (percentage of equity)
---
AUTHOR
Name: Hector Octavio Piccone Pacheco
Filter: Octavio Low-Pass Filter (OLPF)
Version: 1.0
Based on: New Low-Pass Filter (NLF) by Alex Pierrefeu
Date: 2025
Original Contributions:
- Hermite smoothing polynomial kernel base
- Lanczos sigma factor windowing for Gibbs reduction
- Adaptive weight normalization system
- Integrated risk management framework
---
LICENSE
This work is licensed under the Mozilla Public License 2.0. You are free to use, modify, and distribute this code with attribution.
---
DISCLAIMER
Trading involves substantial risk of loss. This indicator is provided for educational and research purposes only. Past performance does not guarantee future results. Always conduct your own analysis and risk assessment.
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả chấp thuận mới có thể truy cập tập lệnh này. Bạn sẽ cần yêu cầu và được cấp quyền sử dụng. Thông thường quyền này được cấp sau khi thanh toán. Để biết thêm chi tiết, làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với octa_piccone.
TradingView KHÔNG khuyến nghị bạn trả phí hoặc sử dụng một tập lệnh trừ khi bạn hoàn toàn tin tưởng vào tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm các lựa chọn miễn phí, mã nguồn mở trong các script cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Thông báo miễn trừ trách nhiệm
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả chấp thuận mới có thể truy cập tập lệnh này. Bạn sẽ cần yêu cầu và được cấp quyền sử dụng. Thông thường quyền này được cấp sau khi thanh toán. Để biết thêm chi tiết, làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với octa_piccone.
TradingView KHÔNG khuyến nghị bạn trả phí hoặc sử dụng một tập lệnh trừ khi bạn hoàn toàn tin tưởng vào tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm các lựa chọn miễn phí, mã nguồn mở trong các script cộng đồng của chúng tôi.