【無料配布】違うMTFで複数のMAが上向きか下向きか確認できるインジケータ

まず初めに

初めまして!Takkyです。
以下ツイッターアカウントですが、フォローしてくださっている皆様いつもありがとうございます!(定期的にインジとかを配っていきたいと思うのでこれを機にFollwしてもらえると嬉しいです!)

(1) takky🏄‍♂️ (@takky931028) / X (twitter.com)

今回ご紹介するのは、MTFで複数のMAが上向きか下向きか確認できるインジケータ!(いちいち違う時間足に変えて長期足が強いか弱いかなど確認しなくてもある程度判断ができるため、時短になるかも?)

画面右上に表示されているのが今回配布するインジケータになります。
見てわかる通り「up⇒MAが上向き」「down⇒MAが下向き」という意味です。
※それぞれ色の設定もできます。

対象時間足は「5m/15m/30m/1h/4h/1d」となっております。
※こちらはカスタマイズできませんのでご容赦ください。

パラメータ概要


Ma period(上):上側のテーブル内のma期間の設定
Ma period(下):下側のテーブル内のma期間の設定
何個前のmaとの比較をするか:何個前のMAの値と比較するか
TitleColor:タイトル部分の背景色
Positive Color:陽線の背景色
Negative Color:陰線の背景色
設定できるのは、これだけのシンプルなインジです!
(仕様もシンプルなので当然ですよね笑)
特に設定していただくパラメータはございませんので、ご自身のチャートの色に合わせて色をカスタマイズだけしていただけたらと思います!

特にそれ以外の説明はすることないので、以下はコードになります~。
もしよければ使ってあげてくださいませ。
ではでは~。

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © takky931028

//@version=5
indicator("mtf_multi_ma_ud" , overlay = true)

var table perfTable = table.new(position.top_right, 3, 6, border_width = 3)
priod_1 = input(50 , "ma period(上)")
priod_2 = input(200 , "ma period(下)")
post = input(10 , "何個前のmaとの比較をするか")
i_titleColor = input(color.rgb(250, 247, 247,50), title="title Color")
i_posColor = input(color.rgb(38, 166, 154,50), title="Positive Color")
i_negColor = input(color.rgb(240, 83, 80,50), title="Negative Color")

vsi5m = request.security(syminfo.tickerid, "5", ta.sma(close,priod_1)) > request.security(syminfo.tickerid, "5", ta.sma(close,priod_1)[post]) ? "up" : "down"
vsi15m = request.security(syminfo.tickerid, "15",ta.sma(close,priod_1))> request.security(syminfo.tickerid, "15", ta.sma(close,priod_1)[post]) ? "up" : "down"
vsi30m = request.security(syminfo.tickerid, "30",ta.sma(close,priod_1))> request.security(syminfo.tickerid, "30", ta.sma(close,priod_1)[post]) ? "up" : "down"
vsi1h = request.security(syminfo.tickerid, "60", ta.sma(close,priod_1))> request.security(syminfo.tickerid, "60", ta.sma(close,priod_1)[post]) ? "up" : "down"
vsi4h = request.security(syminfo.tickerid, "240",ta.sma(close,priod_1))> request.security(syminfo.tickerid, "240", ta.sma(close,priod_1)[post]) ? "up" : "down"
vsid = request.security(syminfo.tickerid, "1D",ta.sma(close,priod_1))> request.security(syminfo.tickerid, "1D", ta.sma(close,priod_1)[post]) ? "up" : "down"

table.cell(perfTable, 0, 0, str.tostring(priod_1) + "_" + "MA" , bgcolor = i_titleColor ), table.merge_cells(perfTable, 0, 0, 2, 0)
table.cell(perfTable, 0, 1 , vsi5m + "\n" + "5m" , bgcolor =  vsi5m == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 1, 1 , vsi15m + "\n" + "15m" , bgcolor =  vsi15m == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 1 , vsi30m + "\n" + "30m" , bgcolor =  vsi30m == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 0, 2 , vsi1h + "\n" + "1h" , bgcolor =  vsi1h == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 1, 2 , vsi4h + "\n" + "4h" , bgcolor =  vsi4h == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 2 , vsid + "\n" + "1d" , bgcolor =  vsid == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)

l_vsi5m = request.security(syminfo.tickerid, "5", ta.sma(close,priod_2)) > request.security(syminfo.tickerid, "5", ta.sma(close,priod_2)[post]) ? "up" : "down"
l_vsi15m = request.security(syminfo.tickerid, "15",ta.sma(close,priod_2))> request.security(syminfo.tickerid, "15", ta.sma(close,priod_2)[post]) ? "up" : "down"
l_vsi30m = request.security(syminfo.tickerid, "30",ta.sma(close,priod_2))> request.security(syminfo.tickerid, "30", ta.sma(close,priod_2)[post]) ? "up" : "down"
l_vsi1h = request.security(syminfo.tickerid, "60", ta.sma(close,priod_2))> request.security(syminfo.tickerid, "60", ta.sma(close,priod_2)[post]) ? "up" : "down"
l_vsi4h = request.security(syminfo.tickerid, "240",ta.sma(close,priod_2))> request.security(syminfo.tickerid, "240", ta.sma(close,priod_2)[post]) ? "up" : "down"
l_vsid = request.security(syminfo.tickerid, "1D",ta.sma(close,priod_2))> request.security(syminfo.tickerid, "1D", ta.sma(close,priod_2)[post]) ? "up" : "down"

table.cell(perfTable, 0, 3, str.tostring(priod_2) + 'MA', bgcolor = i_titleColor ), table.merge_cells(perfTable, 0, 3, 2, 3)
table.cell(perfTable, 0, 4 , l_vsi5m + "\n" + "5m" , bgcolor =  l_vsi5m == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 1, 4 , l_vsi15m + "\n" + "15m" , bgcolor =  l_vsi15m == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 4 , l_vsi30m + "\n" + "30m" , bgcolor =  l_vsi30m == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 0, 5 , l_vsi1h + "\n" + "1h" , bgcolor =  l_vsi1h == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 1, 5 , l_vsi4h + "\n" + "4h" , bgcolor =  l_vsi4h == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 5 , l_vsid + "\n" + "1d" , bgcolor =  l_vsid == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)

次のやつはおまけ。
時間軸ごとに複数のmaの向き確認できるversion。

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © takky931028

//@version=5
indicator("mtf_multi_ma_ud_timeshift" , overlay = true)

var table perfTable = table.new(position.top_right, 3, 12, border_width = 3)
priod_1 = input(10  , "ma period_1")
priod_2 = input(20  , "ma period_2")
priod_3 = input(50  , "ma period_3")
priod_4 = input(100 , "ma period_4")
priod_5 = input(150 , "ma period_5")
priod_6 = input(200 , "ma period_6")
post = input(10 , "何個前のmaとの比較をするか")
i_titleColor = input(color.rgb(250, 247, 247,50), title="title Color")
i_posColor = input(color.rgb(38, 166, 154,50), title="Positive Color")
i_negColor = input(color.rgb(240, 83, 80,50), title="Negative Color")

//--------------------------------------
t_vsi5_ma1 = request.security(syminfo.tickerid, "5", ta.sma(close,priod_1))
t_vsi5_ma2 = request.security(syminfo.tickerid, "5", ta.sma(close,priod_2))
t_vsi5_ma3 = request.security(syminfo.tickerid, "5", ta.sma(close,priod_3))
t_vsi5_ma4 = request.security(syminfo.tickerid, "5", ta.sma(close,priod_4))
t_vsi5_ma5 = request.security(syminfo.tickerid, "5", ta.sma(close,priod_5))
t_vsi5_ma6 = request.security(syminfo.tickerid, "5", ta.sma(close,priod_6))

vsi5m_ma1 = t_vsi5_ma1 > t_vsi5_ma1[post] ? "up" : "down"
vsi5m_ma2 = t_vsi5_ma2 > t_vsi5_ma2[post] ? "up" : "down"
vsi5m_ma3 = t_vsi5_ma3 > t_vsi5_ma3[post] ? "up" : "down"
vsi5m_ma4 = t_vsi5_ma4 > t_vsi5_ma4[post] ? "up" : "down"
vsi5m_ma5 = t_vsi5_ma5 > t_vsi5_ma5[post] ? "up" : "down"
vsi5m_ma6 = t_vsi5_ma6 > t_vsi5_ma6[post] ? "up" : "down"

table.cell(perfTable, 0, 0, "5m" , bgcolor = i_titleColor ), table.merge_cells(perfTable, 0, 0, 2, 0)
table.cell(perfTable, 0, 1 , vsi5m_ma1 + "\n(" + str.tostring(priod_1) +"MA)"  , bgcolor =  vsi5m_ma1 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 1, 1 , vsi5m_ma2 + "\n(" + str.tostring(priod_2) +"MA)" , bgcolor =  vsi5m_ma2 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 1 , vsi5m_ma3 + "\n(" + str.tostring(priod_3) +"MA)" , bgcolor =  vsi5m_ma3 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 0, 2 , vsi5m_ma4 + "\n(" + str.tostring(priod_4) +"MA)"  , bgcolor =  vsi5m_ma4 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 1, 2 , vsi5m_ma5 + "\n(" + str.tostring(priod_5) +"MA)"  , bgcolor =  vsi5m_ma5 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 2 , vsi5m_ma6 + "\n(" + str.tostring(priod_6) +"MA)"  , bgcolor =  vsi5m_ma6 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)

//--------------------------------------
t_vsi15_ma1 = request.security(syminfo.tickerid, "15", ta.sma(close,priod_1))
t_vsi15_ma2 = request.security(syminfo.tickerid, "15", ta.sma(close,priod_2))
t_vsi15_ma3 = request.security(syminfo.tickerid, "15", ta.sma(close,priod_3))
t_vsi15_ma4 = request.security(syminfo.tickerid, "15", ta.sma(close,priod_4))
t_vsi15_ma5 = request.security(syminfo.tickerid, "15", ta.sma(close,priod_5))
t_vsi15_ma6 = request.security(syminfo.tickerid, "15", ta.sma(close,priod_6))

vsi15m_ma1 = t_vsi15_ma1 > t_vsi15_ma1[post] ? "up" : "down"
vsi15m_ma2 = t_vsi15_ma2 > t_vsi15_ma2[post] ? "up" : "down"
vsi15m_ma3 = t_vsi15_ma3 > t_vsi15_ma3[post] ? "up" : "down"
vsi15m_ma4 = t_vsi15_ma4 > t_vsi15_ma4[post] ? "up" : "down"
vsi15m_ma5 = t_vsi15_ma5 > t_vsi15_ma5[post] ? "up" : "down"
vsi15m_ma6 = t_vsi15_ma6 > t_vsi15_ma6[post] ? "up" : "down"

table.cell(perfTable, 0, 3, "15m" , bgcolor = i_titleColor ), table.merge_cells(perfTable, 0, 3, 2, 3)
table.cell(perfTable, 0, 4 , vsi15m_ma1 + "\n(" + str.tostring(priod_1) +"MA)"  , bgcolor =  vsi15m_ma1 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 1, 4 , vsi15m_ma2 + "\n(" + str.tostring(priod_2) +"MA)" , bgcolor =  vsi15m_ma2 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 4 , vsi15m_ma3 + "\n(" + str.tostring(priod_3) +"MA)" , bgcolor =  vsi15m_ma3 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 0, 5 , vsi15m_ma4 + "\n(" + str.tostring(priod_4) +"MA)"  , bgcolor =  vsi15m_ma4 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 1, 5 , vsi15m_ma5 + "\n(" + str.tostring(priod_5) +"MA)"  , bgcolor =  vsi15m_ma5 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 5 , vsi15m_ma6 + "\n(" + str.tostring(priod_6) +"MA)"  , bgcolor =  vsi15m_ma6 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)

//--------------------------------------
t_vsi60_ma1 = request.security(syminfo.tickerid, "60", ta.sma(close,priod_1))
t_vsi60_ma2 = request.security(syminfo.tickerid, "60", ta.sma(close,priod_2))
t_vsi60_ma3 = request.security(syminfo.tickerid, "60", ta.sma(close,priod_3))
t_vsi60_ma4 = request.security(syminfo.tickerid, "60", ta.sma(close,priod_4))
t_vsi60_ma5 = request.security(syminfo.tickerid, "60", ta.sma(close,priod_5))
t_vsi60_ma6 = request.security(syminfo.tickerid, "60", ta.sma(close,priod_6))

vsi60m_ma1 = t_vsi60_ma1 > t_vsi60_ma1[post] ? "up" : "down"
vsi60m_ma2 = t_vsi60_ma2 > t_vsi60_ma2[post] ? "up" : "down"
vsi60m_ma3 = t_vsi60_ma3 > t_vsi60_ma3[post] ? "up" : "down"
vsi60m_ma4 = t_vsi60_ma4 > t_vsi60_ma4[post] ? "up" : "down"
vsi60m_ma5 = t_vsi60_ma5 > t_vsi60_ma5[post] ? "up" : "down"
vsi60m_ma6 = t_vsi60_ma6 > t_vsi60_ma6[post] ? "up" : "down"

table.cell(perfTable, 0, 6, "1H" , bgcolor = i_titleColor ), table.merge_cells(perfTable, 0, 6, 2, 6)
table.cell(perfTable, 0, 7 , vsi60m_ma1 + "\n(" + str.tostring(priod_1) +"MA)"  , bgcolor =  vsi60m_ma1 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 1, 7 , vsi60m_ma2 + "\n(" + str.tostring(priod_2) +"MA)" , bgcolor =  vsi60m_ma2 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 7 , vsi60m_ma3 + "\n(" + str.tostring(priod_3) +"MA)" , bgcolor =  vsi60m_ma3 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 0, 8 , vsi60m_ma4 + "\n(" + str.tostring(priod_4) +"MA)"  , bgcolor =  vsi60m_ma4 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 1, 8 , vsi60m_ma5 + "\n(" + str.tostring(priod_5) +"MA)"  , bgcolor =  vsi60m_ma5 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 8 , vsi60m_ma6 + "\n(" + str.tostring(priod_6) +"MA)"  , bgcolor =  vsi60m_ma6 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)

//--------------------------------------
t_vsi240_ma1 = request.security(syminfo.tickerid, "240", ta.sma(close,priod_1))
t_vsi240_ma2 = request.security(syminfo.tickerid, "240", ta.sma(close,priod_2))
t_vsi240_ma3 = request.security(syminfo.tickerid, "240", ta.sma(close,priod_3))
t_vsi240_ma4 = request.security(syminfo.tickerid, "240", ta.sma(close,priod_4))
t_vsi240_ma5 = request.security(syminfo.tickerid, "240", ta.sma(close,priod_5))
t_vsi240_ma6 = request.security(syminfo.tickerid, "240", ta.sma(close,priod_6))

vsi240m_ma1 = t_vsi240_ma1 > t_vsi240_ma1[post] ? "up" : "down"
vsi240m_ma2 = t_vsi240_ma2 > t_vsi240_ma2[post] ? "up" : "down"
vsi240m_ma3 = t_vsi240_ma3 > t_vsi240_ma3[post] ? "up" : "down"
vsi240m_ma4 = t_vsi240_ma4 > t_vsi240_ma4[post] ? "up" : "down"
vsi240m_ma5 = t_vsi240_ma5 > t_vsi240_ma5[post] ? "up" : "down"
vsi240m_ma6 = t_vsi240_ma6 > t_vsi240_ma6[post] ? "up" : "down"

table.cell(perfTable, 0, 9, "4H" , bgcolor = i_titleColor ), table.merge_cells(perfTable, 0, 9, 2, 9)
table.cell(perfTable, 0, 10 , vsi240m_ma1 + "\n(" + str.tostring(priod_1) +"MA)"  , bgcolor =  vsi240m_ma1 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 1, 10 , vsi240m_ma2 + "\n(" + str.tostring(priod_2) +"MA)" , bgcolor =  vsi240m_ma2 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 10 , vsi240m_ma3 + "\n(" + str.tostring(priod_3) +"MA)" , bgcolor =  vsi240m_ma3 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)
table.cell(perfTable, 0, 11 , vsi240m_ma4 + "\n(" + str.tostring(priod_4) +"MA)"  , bgcolor =  vsi240m_ma4 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 1, 11 , vsi240m_ma5 + "\n(" + str.tostring(priod_5) +"MA)"  , bgcolor =  vsi240m_ma5 == "up" ? i_posColor : i_negColor  , text_color = color.white , width = 6)
table.cell(perfTable, 2, 11 , vsi240m_ma6 + "\n(" + str.tostring(priod_6) +"MA)"  , bgcolor =  vsi240m_ma6 == "up" ? i_posColor : i_negColor , text_color = color.white , width = 6)

この記事が気に入ったらサポートをしてみませんか?