FX365_Thailand

MTF SMA on specific timeframe(5M-4H)

Japanese below. 日本語の説明は下記

This is multi time frame simple moving average that is shown only on the specific timeframe; 5M, 15M, 30M, 1H, 4H.

Problem of conventional MTF moving average is that MTF MA is sometimes annoying especially when you look at upper timeframe such as daily chart and/or weekly chart.
e.g. You set 20 MA of 4 hour chart into 1 hour chart, however, when you look at daily chart, daily chart also shows 20MA of 4 hour chart which is unnecessary.

This is why I have developed this MTF SMA indicator shown only on the timeframe from 5M to 4 hour.
With this indicator, even if you set MA of upper timeframe(such as 4 hour) into Lower timeframe, that MA will not be shown on above daily chart.

You can customize adding or removing below code;

timeframe.period == “X”? security(syminfo.tickerid, res, sma(src, ma_len))

X is the timeframe that you would add/remove from the indicator.

——————————————————————————————

特定の時間軸にのみ表示されるマルチタイムフレーム移動平均線のインジケーターです。

従来のマルチタイムフレーム移動平均線の問題点は、上位足に切り替えた時にもマルチタイムフレーム移動平均線の設定が表示され、チャートが見にくくなる点でした。
例: 4時間足の20MAをマルチタイムフレーム移動平均線としてセットしたとします。この場合、1時間足などの下位足で4時間足の20MAが表示されることになりますが、同時に日足や週足といった上位足チャートを見る時にも、この4時間足の20MAが表示されてしまいます。

このインジケーターでは、従来のマルチタイムフレーム移動平均線と同様に、設定元となる上位足の時間軸(4時間、日足など)を選択し、期間とソースを設定することができる一方で、表示されるのは5分足、15分足、30分足,1時間足、4時間足のみとなります。

スクリプトのMAの取得部分に以下コードを追加することで、必要な時間軸を追加・削除することが可能です。

timeframe.period == “X”? security(syminfo.tickerid, res, sma(src, ma_len))

Xは表示したい時間軸です。4時間足チャートからこのインジケーターを削除したい場合は
timeframe.period == “240”? security(syminfo.tickerid, res, sma(src, ma_len))
を削除してください。

Release Notes:
Enabled MA type selection for SMA and EMA.

■”なぜ”がわかる相場分析
・チャートの動きというファクトを元に
・客観的かつロジカルに
・初心者でもわかるように
相場展望を解説

Followすると投稿の度に通知が届きます。
bit.ly/3s888QI

■Editor's Pick
bit.ly/3pkLCEl

■Blog
bit.ly/2VPAMJk

■Indicator
bit.ly/3lmWYFk

■Membership
bit.ly/3zvLkPG
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?