blackcat1402

[blackcat] L2 Sine-Weighted Moving Average (SWMA)

Level: 2

Background

Invented by Patrick Lafferty in 1999, a Sine Weighted Moving Average (SWMA) takes its weighting from the first half of a Sine wave cycle and accordingly, the most weighting is given to the data in the middle of the data set. It is therefore very similar to the Triangular Moving Average.


Function

A sine weighted moving average (Sine-MA) applies weights to each bar in the shape of the bulge in a sine curve from 0 to pi. For an N-bar average the weightings are

/ 1 \ / 2 \ / N \
sin | --- * pi |, sin | --- * pi |, ..., sin | --- * pi |
\ N+1 / \ N+1 / \ N+1 /
The effect is that middle prices have the greatest weight (much like the TMA, Triangular Moving Average). A Sine Weighted Moving Average ( Sine WMA ) takes its weighting from the first half of a Sine wave cycle and accordingly, the most weighting is given to the data in the middle of the data set.


Key Signal

SWMA(FastLength) --> SWMA Fast Line.
SWMA(SlowLength) --> SWMA Slow Line.

Remarks

This is a Level 2 free and open source indicator.

Feedbacks are appreciated.

Avoid losing contact!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 防止失联,请立即行动,加入本猫聊天群: discord.com/invite/ZTGpQJq
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?