peacefulLizard50262

Cumulative Weighted Triple Exponential Moving Average (CWTEMA)

wma
This Pine Script code defines an indicator called "CWTEMA" that plots a custom weighted triple exponential moving average (TEMA) on a chart. The indicator takes two inputs: a source series (usually the close price of a security) and a length parameter that specifies the number of periods over which the moving average is calculated.

The code first defines a tema() function, which calculates the TEMA for a given series of data and a given length. The function uses the ta.ema() function from the ta library to compute the exponential moving average of the source data, and then applies the triple exponential moving average formula to calculate the TEMA.

The wma() function is then defined, which calculates the weighted moving average of a given series of data using a set of weights. This function computes the weighted sum of the source data using the given weights, then divides this sum by the sum of the weights to calculate the weighted moving average.

Finally, the cweema() function is defined, which calculates the custom weighted TEMA. This function first computes the weights for each value in the moving average using the given length parameter, then calls the wma() and tema() functions to calculate the weighted moving average using the TEMA values. The cweema() function is then plotted on the chart.

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?