• Produits
  • Communauté
  • Marchés
  • Courtiers
  • Plus
Commencez
  • Communauté
  • /Indicateurs et stratégies
  • /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.
Indicateur Pine Script®
par Lemrin
Mis à jour
11

Sélectionnez les données de marché fournies par ICE Data services. Sélectionnez les données de référence fournies par FactSet. Copyright © 2025 FactSet Research Systems Inc.© 2025 TradingView, Inc.

Plus qu'un produit
  • Supercharts
Screeners
  • Actions
  • ETFs
  • Obligations
  • Crypto coins
  • Paires CEX
  • Paires DEX
  • Pine
Cartes thermiques
  • Actions
  • ETFs
  • Crypto
Calendriers
  • Economie
  • Bénéfices
  • Dividendes
Plus de produits
  • Courbes de rendement
  • Options
  • Flux d'actualités
  • Pine Script®
Apps
  • Mobile
  • Desktop
Communauté
  • Réseau social
  • Mur d'Amour
  • Parrainer un ami
  • Règlement
  • Modérateurs
Idées
  • Trading
  • Éducation
  • Choix de la rédaction
Pine script
  • Indicateurs & stratégies
  • Wizards
  • Freelancers
Outils & Abonnements
  • Fonctionnalités
  • Tarifications
  • Données boursières
Trading
  • Vue d'ensemble
  • Courtiers
Offres spéciales
  • Contrats à terme de CME Group
  • Contrats à terme Eurex
  • Paquet d'actions US
Au sujet de l'entreprise
  • Qui nous sommes
  • Mission spatiale
  • Blog
  • Carrières
  • Kit media
Merch
  • Boutique TradingView
  • Cartes de tarot pour les traders
  • Le C63 TradeTime
Politiques & Sécurité
  • Conditions d'utilisation
  • Clause de non-responsabilité
  • Politique de confidentialité
  • Politique en matière de cookies
  • Déclaration d'accessibilité
  • Conseils de sécurité
  • Programme de chasse aux bugs
  • Page du statut
Solutions pour les entreprises
  • Widgets
  • Bibliothèques de graphiques
  • Lightweight Charts™
  • Graphiques avancés
  • Plateforme de trading
Opportunités de croissance
  • Publicité
  • Intégration de courtiers
  • Programme de partenariat
  • Programme éducatif
Communauté
  • Réseau social
  • Mur d'Amour
  • Parrainer un ami
  • Règlement
  • Modérateurs
Idées
  • Trading
  • Éducation
  • Choix de la rédaction
Pine script
  • Indicateurs & stratégies
  • Wizards
  • Freelancers
Solutions pour les entreprises
  • Widgets
  • Bibliothèques de graphiques
  • Lightweight Charts™
  • Graphiques avancés
  • Plateforme de trading
Opportunités de croissance
  • Publicité
  • Intégration de courtiers
  • Programme de partenariat
  • Programme éducatif
Look FirstLook First