Lemrin

Awesome Oscillator and MACD, AntiStep Version

Any indicator based on moving averages (MAs) lags real-time movement. Immediately after large ("step") changes in level, the pre-step values that are still within the MA window cause the result to falsely reflect continued movement, even if real-time values remain flat or move in the opposite direction.

To counter this, when a step change of a configurable size is detected, my technique temporarily shrinks the MA window size to include only those values occurring since the step change, and then allow the size to increase to normal length as we move away from the step change.

Changes from my previous AO/MACD indicator:
Added anti-step capabilities, including brand-new functions that implement my anti-step technique in ema() and rma().
Created generalized alpha_ma() function, which allows ema function creation using custom alpha structures.
Created "_external" versions of all antistep functions, allowing step detection to be based on some other series, aside from the one being averaged (this is required for the macd signal ma).
Added options to calculate ao and macd using SMA, EMA, or RMA, including anti-step versions of all three.
Added bull and bear signal indicators based on previous descriptions.

Comparison with anti-step enabled and disabled:

Comparison with different tolerance levels (positive tolerance detects fewer steps; negative tolerance detects more steps):
Mã được bảo vệ
Tập lệnh này được xuất bản mã nguồn đóng và bạn có thể sử dụng một cách tự do. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ. Bạn không thể xem hoặc sửa đổi mã nguồn.
Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?