• Produk
  • Komunitas
  • Pasar
  • Broker
  • Lebih lanjut
Mulai
  • Komunitas
  • /Indikator dan strategi
  • /Smafix

Smafix

Awesome Oscillator with AntiStep CorrectionHere is the well-known Awesome Oscillator (AO), which I use to present the real purpose of this post: a function that provides step correction for simple moving averages (SMAs). We all know that any indicator based on moving averages lags real-time movement. Normally this is fine, but just after large ("step") changes in level, the pre-step values that are still within the SMA window cause the result to falsely reflect continued movement, even when real-time values remain flat. To counter this, when a step change of a configurable size is detected, I temporarily shrink the SMA 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. This is accomplished within the antistep_sma() function. Note that this will cause SMAs of different lengths (e.g. those used in the AO) to be temporarily equal, until the shorter of the two reaches its normal size and begins to leave the longer one behind again. You can see this above, where the AO, which is the difference of two SMAs, goes to 0 immediately after a sufficiently large step change--configured to 0.5% in this case.
Indikator Pine Script®
oleh Lemrin
Diupdate
11

Pilih data pasar yang disediakan oleh ICE Data Services. Pilih data referensi yang disediakan oleh FactSet. Copyright © 2025 FactSet Research Systems Inc.© 2025 TradingView, Inc.

Lebih dari sekadar produk
  • Superchart
Penyaring
  • Saham
  • ETF
  • Obligasi
  • Koin crypto
  • Pasangan CEX
  • Pasangan DEX
  • Pine
Heatmap
  • Saham
  • ETF
  • Crypto
Kalender
  • Ekonomis
  • Perolehan
  • Dividen
Produk lainnya
  • Kurva Imbal Hasil
  • Options
  • Aliran berita
  • Skrip Pine®
Aplikasi
  • Mobile
  • Desktop
Komunitas
  • Jejaring sosial
  • Tembok Cinta
  • Refer teman
  • Tata Tertib
  • Moderator
Ide-Ide
  • Trading
  • Edukasi
  • Pilihan editor
Skrip Pine
  • Indikator & strategi
  • Wizard
  • Freelancer
Peralatan & langganan
  • Fitur-fitur
  • Harga Akun
  • Data pasar
Trading
  • Ikhtisar
  • Broker
Penawaran spesial
  • Kontrak berjangka CME Group
  • Kontrak berjangka Eurex
  • Bundel saham AS
Tentang perusahaan
  • Tentang kami
  • Misi luar angksa
  • Blog
  • Karir
  • Media kit
Merchandise
  • Toko TradingView
  • Kartu tarot untuk trader
  • C63 TradeTime
Kebijakan & keamanan
  • Syarat penggunaan
  • Pernyataan Penyangkalan
  • Kebijakan Privasi
  • Kebijakan Cookie
  • Pernyataan Aksesibilitas
  • Tips keamanan
  • Program Pencari Bug
  • Halaman status
Solusi bisnis
  • Widget
  • Perpustakaan charting
  • Lightweight Charts™
  • Advanced Chart
  • Platform Trading
Peluang pertumbuhan
  • Periklanan
  • Integrasi broker
  • Program partner
  • Program Edukasi
Komunitas
  • Jejaring sosial
  • Tembok Cinta
  • Refer teman
  • Tata Tertib
  • Moderator
Ide-Ide
  • Trading
  • Edukasi
  • Pilihan editor
Skrip Pine
  • Indikator & strategi
  • Wizard
  • Freelancer
Solusi bisnis
  • Widget
  • Perpustakaan charting
  • Lightweight Charts™
  • Advanced Chart
  • Platform Trading
Peluang pertumbuhan
  • Periklanan
  • Integrasi broker
  • Program partner
  • Program Edukasi
Look FirstLook First