見出し画像

TradingViewインジケータ    Stdev Heat Map            - ボリバン標準偏差ヒートマップ

はじめに

ボリンジャーバンドがチャート上に描画されるとき、中央に描画される移動平均線を基準に標準偏差の値を加算減算して上下のバンドが描画されます。良くある設定では、±1σ、±2σ、±3σを描画する人が多いと思います。

このインジケータは、複数のシンボル(銘柄)のそれぞれ1時間足、4時間足、日足に対して、標準偏差の値と現在値と移動平均値から、現在値が標準偏差何個分となっているかを計算して表を作成します。

MTFの観点からどのシンボルがバンドウォーク中か、どのシンボルが現在押し目を作っているか、等の見方ができると思いますので活用してください。また、ソースコードも公開していますのでご自由に機能追加も行ってください。

なお、本インジケータはみかんさんが開発されたインジケータ「Muzunai checker」から発想を得て、詳細を表示できるように機能追加したものです。みかんさんのインジケータはよりシンプルに、一目でわかる表記になっています。シンプルな機能を求める場合は Muzunai checker を利用いただくと良いと思います。


機能説明・画面イメージ

インジケータ表示状態

下記に示す図が、インジケータをチャートに追加した初期状態になります。

インジケータ追加初期状態

本インジケーターを利用する際はこのnoteの下部にあるTradingViewリンクからスクリプトページに移動し、そこからお気に入りインジケーターに追加して利用してください。

初期状態ではチャートの上に上書きされる状態になります。チャートとは別のペインにインジケータ単体で表示したい場合はチャート左上のインジケータ名の右端にある「…」-「移動する」を選んで表示場所を変更してください。


別ペインに表示した状態


インジケータ表示内容

表に表示される内容について、以下に記載します。

表示内容サンプル

このインジケータは左から「symbol」「1h」「4h」「1D」「price」の5列で構成されます。それぞれ以下の内容を表します。

  • symbol : 銘柄名

  • 1h : 1時間足での現在値が標準偏差何個分か

  • 4h : 4時間足での現在値が標準偏差何個分か

  • 1D : 日足での現在値が標準偏差何個分か

  • price : 表を計算した時点での現在値

symbol列には、初期設定で12個の固定銘柄と「current」の銘柄が設定されます。「current」とは、現在チャート表示中のsymbolであり、表示するチャートを切り替える度に計算対象が変わります。サンプル画像ではUSDJPYチャートに本インジケータを表示しているため、current = USDJPY となっています。

標準偏差表示セルの色合いについて

本インジケータでは、標準偏差の個数を表示するセルの値によって表示色が変化します。標準設定では以下の状態になります。

標準偏差値によるセルの色分け



設定画面イメージ

INDICATOR PARAMETER SETTINGS

本設定では、標準偏差を計算する際に用いる移動平均線の計算対象期間(各足それぞれ、何本ずつを使って移動平均を算出するか)を指定します。

移動平均の計算方法は『SMA(単純移動平均線)のみ』となっています。必要であればスクリプトを拡張してご自身で対応してください。

SYMBOL SETTINGS

本設定では、インジケータの表に表示する対象となるsymbolを定義します。初期設定から変更したい場合は任意に設定してください。「current」は前述の通りその時のチャート表示によって変化するため設定項目はありません。

TABLE SETTINGS

本設定では、ペイン内に表示する表位置「Table position」と表の色合いを変更可能です。
Table positionは次の9つの場所から表を表示する箇所を選択可能です。
["top_left", "top_center", "top_right", "middle_left", "middle_center", "middle_right", "bottom_left", "bottom_center", "bottom_right"]
それぞれ、ペインの左上段・中央上段・右上段・左中段・中央中段・右中段・左下段・中央下段・右下段に対応します。

TABLE VISIBILITY SETTINGS

本設定では、表の表示項目の制御を行います。Joinmode, Join position は後述します。

Header visibility ~ Symbol_12 visibility の各項目は表の各行の表示状態を制御します。表示されるSymbolが多すぎる場合等にチェックを外すとその行は非表示となります。

Symbol cell width, Stddev cell width, Price cell width は、それぞれ表の各列の表示幅を制御します。ここで指定する幅はチャート画面の幅との割合に左右されるため、必要に応じて値を変えてみて各環境に合う設定を探してください。

Joinmodeについて、ペインのTopに寄せて表を複数表示する場合にチェックをONにします。Joinmodeでは表のヘッダとcurrentの行が自動で非表示になります。また、Join positionで指定した分、空行を描画します。複数の本インジケータを同一箇所に表示する場合、Join positionを指定することで疑似的に表領域の拡張が可能です。

13個のsymbol表示では表示が足りない場合に設定を試してみてください。
参考までに、筆者の環境でJoinmodeがONの場合のサンプルを以下に貼付します。

上記表は、以下の設定により作成されます。15行~17行目が二つ目のインジケータです。


TradingViewリンク

下記がTradingView上のスクリプトに対するリンクです。リンク先ページの下部にある「お気に入りインジケーターに追加」から、チャートに追加してください。


ソースコード(Pineスクリプト)

以下が、本インジケータ、バージョン2.0のコードです。

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

//@version=5
indicator(shorttitle="Stdev Heat Map", title="Stdev Heat Map", overlay=true)

ma_periods = input.int(defval=20,title="MA periods", group="indicator parameter settings")

//settings
sym_01 = input.symbol(defval="USDJPY",title="Symbol_01", group="symbol settings")
sym_02 = input.symbol(defval="EURUSD",title="Symbol_02", group="symbol settings")
sym_03 = input.symbol(defval="GBPUSD",title="Symbol_03", group="symbol settings")
sym_04 = input.symbol(defval="AUDUSD",title="Symbol_04", group="symbol settings")
sym_05 = input.symbol(defval="NZDUSD",title="Symbol_05", group="symbol settings")
sym_06 = input.symbol(defval="EURJPY",title="Symbol_06", group="symbol settings")
sym_07 = input.symbol(defval="GBPJPY",title="Symbol_07", group="symbol settings")
sym_08 = input.symbol(defval="AUDJPY",title="Symbol_08", group="symbol settings")
sym_09 = input.symbol(defval="NZDJPY",title="Symbol_09", group="symbol settings")
sym_10 = input.symbol(defval="XAUUSD",title="Symbol_10", group="symbol settings")
sym_11 = input.symbol(defval="US10Y",title="Symbol_11", group="symbol settings")
sym_12 = input.symbol(defval="US30",title="Symbol_12", group="symbol settings")
table_pos = input.string(position.middle_left, title="table position", options=["top_left", "top_center", "top_right", "middle_left", "middle_center", "middle_right", "bottom_left", "bottom_center", "bottom_right"], group="table settings")
table_bg_color = input.color(#0000cd, title="table bg color", group="table settings")
table_SS_color = input.color(#228b22, title=">= 1σ", group="table settings")
table_S_color = input.color(#80f580, title="0σ ~ 1σ", group="table settings")
table_W_color = input.color(#fd8099, title="0σ ~ -1σ", group="table settings")
table_WW_color = input.color(#dc143c, title="<= -1σ", group="table settings")

join_mode = input.bool(false, title="Joinmode", group="table visibility settings")
join_from = input.int(0, title="Join position", group="table visibility settings")
table_header_visibility = input.bool(true, title="Header visibility", group="table visibility settings")
sym_current_visibility = input.bool(true, title="Current Symbol visibility", group="table visibility settings")
sym_01_visibility = input.bool(true, title="Symbol_01 visibility", group="table visibility settings")
sym_02_visibility = input.bool(true, title="Symbol_02 visibility", group="table visibility settings")
sym_03_visibility = input.bool(true, title="Symbol_03 visibility", group="table visibility settings")
sym_04_visibility = input.bool(true, title="Symbol_04 visibility", group="table visibility settings")
sym_05_visibility = input.bool(true, title="Symbol_05 visibility", group="table visibility settings")
sym_06_visibility = input.bool(true, title="Symbol_06 visibility", group="table visibility settings")
sym_07_visibility = input.bool(true, title="Symbol_07 visibility", group="table visibility settings")
sym_08_visibility = input.bool(true, title="Symbol_08 visibility", group="table visibility settings")
sym_09_visibility = input.bool(true, title="Symbol_09 visibility", group="table visibility settings")
sym_10_visibility = input.bool(true, title="Symbol_10 visibility", group="table visibility settings")
sym_11_visibility = input.bool(true, title="Symbol_11 visibility", group="table visibility settings")
sym_12_visibility = input.bool(true, title="Symbol_12 visibility", group="table visibility settings")

symbol_width = input.int(8, title="Symbol cell width", group="table visibility settings")
stdev_width = input.int(3, title="Stdev cell width", group="table visibility settings")
price_width = input.int(4, title="Price cell width", group="table visibility settings")

middle = ta.sma(close, ma_periods)
dev = ta.stdev(close, ma_periods)
upper1 = middle + dev
lower1 = middle - dev

//current
[close_c, h1_upper1_c, h1_middle_c] = request.security(syminfo.tickerid,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_c, h4_middle_c] = request.security(syminfo.tickerid,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_c, D_middle_c] = request.security(syminfo.tickerid,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_c = (close_c - h1_middle_c) / (h1_upper1_c - h1_middle_c)
val_h4_c = (close_c - h4_middle_c) / (h4_upper1_c - h4_middle_c)
val_D_c = (close_c - D_middle_c) / (D_upper1_c - D_middle_c)


//Symbol_01
[close_01, h1_upper1_01, h1_middle_01] = request.security(sym_01,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_01, h4_middle_01] = request.security(sym_01,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_01, D_middle_01] = request.security(sym_01,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_01 = (close_01 - h1_middle_01) / (h1_upper1_01 - h1_middle_01)
val_h4_01 = (close_01 - h4_middle_01) / (h4_upper1_01 - h4_middle_01)
val_D_01 = (close_01 - D_middle_01) / (D_upper1_01 - D_middle_01)


//Symbol_02
[close_02, h1_upper1_02, h1_middle_02] = request.security(sym_02,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_02, h4_middle_02] = request.security(sym_02,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_02, D_middle_02] = request.security(sym_02,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_02 = (close_02 - h1_middle_02) / (h1_upper1_02 - h1_middle_02)
val_h4_02 = (close_02 - h4_middle_02) / (h4_upper1_02 - h4_middle_02)
val_D_02 = (close_02 - D_middle_02) / (D_upper1_02 - D_middle_02)


//Symbol_03
[close_03, h1_upper1_03, h1_middle_03] = request.security(sym_03,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_03, h4_middle_03] = request.security(sym_03,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_03, D_middle_03] = request.security(sym_03,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_03 = (close_03 - h1_middle_03) / (h1_upper1_03 - h1_middle_03)
val_h4_03 = (close_03 - h4_middle_03) / (h4_upper1_03 - h4_middle_03)
val_D_03 = (close_03 - D_middle_03) / (D_upper1_03 - D_middle_03)

//Symbol_04
[close_04, h1_upper1_04, h1_middle_04] = request.security(sym_04,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_04, h4_middle_04] = request.security(sym_04,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_04, D_middle_04] = request.security(sym_04,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_04 = (close_04 - h1_middle_04) / (h1_upper1_04 - h1_middle_04)
val_h4_04 = (close_04 - h4_middle_04) / (h4_upper1_04 - h4_middle_04)
val_D_04 = (close_04 - D_middle_04) / (D_upper1_04 - D_middle_04)

//Symbol_05
[close_05, h1_upper1_05, h1_middle_05] = request.security(sym_05,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_05, h4_middle_05] = request.security(sym_05,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_05, D_middle_05] = request.security(sym_05,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_05 = (close_05 - h1_middle_05) / (h1_upper1_05 - h1_middle_05)
val_h4_05 = (close_05 - h4_middle_05) / (h4_upper1_05 - h4_middle_05)
val_D_05 = (close_05 - D_middle_05) / (D_upper1_05 - D_middle_05)

//Symbol_06
[close_06, h1_upper1_06, h1_middle_06] = request.security(sym_06,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_06, h4_middle_06] = request.security(sym_06,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_06, D_middle_06] = request.security(sym_06,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_06 = (close_06 - h1_middle_06) / (h1_upper1_06 - h1_middle_06)
val_h4_06 = (close_06 - h4_middle_06) / (h4_upper1_06 - h4_middle_06)
val_D_06 = (close_06 - D_middle_06) / (D_upper1_06 - D_middle_06)

//Symbol_07
[close_07, h1_upper1_07, h1_middle_07] = request.security(sym_07,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_07, h4_middle_07] = request.security(sym_07,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_07, D_middle_07] = request.security(sym_07,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_07 = (close_07 - h1_middle_07) / (h1_upper1_07 - h1_middle_07)
val_h4_07 = (close_07 - h4_middle_07) / (h4_upper1_07 - h4_middle_07)
val_D_07 = (close_07 - D_middle_07) / (D_upper1_07 - D_middle_07)

//Symbol_08
[close_08, h1_upper1_08, h1_middle_08] = request.security(sym_08,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_08, h4_middle_08] = request.security(sym_08,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_08, D_middle_08] = request.security(sym_08,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_08 = (close_08 - h1_middle_08) / (h1_upper1_08 - h1_middle_08)
val_h4_08 = (close_08 - h4_middle_08) / (h4_upper1_08 - h4_middle_08)
val_D_08 = (close_08 - D_middle_08) / (D_upper1_08 - D_middle_08)

//Symbol_09
[close_09, h1_upper1_09, h1_middle_09] = request.security(sym_09,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_09, h4_middle_09] = request.security(sym_09,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_09, D_middle_09] = request.security(sym_09,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_09 = (close_09 - h1_middle_09) / (h1_upper1_09 - h1_middle_09)
val_h4_09 = (close_09 - h4_middle_09) / (h4_upper1_09 - h4_middle_09)
val_D_09 = (close_09 - D_middle_09) / (D_upper1_09 - D_middle_09)

//Symbol_10
[close_10, h1_upper1_10, h1_middle_10] = request.security(sym_10,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_10, h4_middle_10] = request.security(sym_10,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_10, D_middle_10] = request.security(sym_10,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_10 = (close_10 - h1_middle_10) / (h1_upper1_10 - h1_middle_10)
val_h4_10 = (close_10 - h4_middle_10) / (h4_upper1_10 - h4_middle_10)
val_D_10 = (close_10 - D_middle_10) / (D_upper1_10 - D_middle_10)

//Symbol_11
[close_11, h1_upper1_11, h1_middle_11] = request.security(sym_11,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_11, h4_middle_11] = request.security(sym_11,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_11, D_middle_11] = request.security(sym_11,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_11 = (close_11 - h1_middle_11) / (h1_upper1_11 - h1_middle_11)
val_h4_11 = (close_11 - h4_middle_11) / (h4_upper1_11 - h4_middle_11)
val_D_11 = (close_11 - D_middle_11) / (D_upper1_11 - D_middle_11)

//Symbol_12
[close_12, h1_upper1_12, h1_middle_12] = request.security(sym_12,"60", [close, upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[h4_upper1_12, h4_middle_12] = request.security(sym_12,"240", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)
[D_upper1_12, D_middle_12] = request.security(sym_12,"D", [upper1, middle], barmerge.gaps_off, barmerge.lookahead_on)

val_h1_12 = (close_12 - h1_middle_12) / (h1_upper1_12 - h1_middle_12)
val_h4_12 = (close_12 - h4_middle_12) / (h4_upper1_12 - h4_middle_12)
val_D_12 = (close_12 - D_middle_12) / (D_upper1_12 - D_middle_12)


join_from := join_from - 3
if join_from<0
    join_from := 0

//create table
var table checker = table.new(table_pos,5,join_from+14,table_bg_color,color.white,1,color.white,1)
if join_mode==true
    for i=0 to join_from+1
        table.cell(checker,0,i,"",bgcolor=color.new(table_bg_color,0),text_size=size.auto)
        table.cell(checker,1,i,"",bgcolor=color.new(table_bg_color,0),text_size=size.auto)
        table.cell(checker,2,i,"",bgcolor=color.new(table_bg_color,0),text_size=size.auto)
        table.cell(checker,3,i,"",bgcolor=color.new(table_bg_color,0),text_size=size.auto)
        table.cell(checker,4,i,"",bgcolor=color.new(table_bg_color,0),text_size=size.auto)


if join_mode==false and table_header_visibility==true
    table.cell(checker,0,0,"symbol",text_color=color.white,text_size=size.auto)
    table.cell(checker,1,0,"1h",text_color=color.white,text_size=size.auto)
    table.cell(checker,2,0,"4h",text_color=color.white,text_size=size.auto)
    table.cell(checker,3,0,"1D",text_color=color.white,text_size=size.auto)
    table.cell(checker,4,0,"price",text_color=color.white,text_size=size.auto)

if join_mode==false and sym_current_visibility==true
    table.cell(checker,0,1,"current",width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,1,str.tostring(val_h1_c, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_c >= 1? table_SS_color:val_h1_c >=0? table_S_color: val_h1_c <= -1? table_WW_color: val_h1_c <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,1,str.tostring(val_h4_c, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_c >= 1? table_SS_color:val_h4_c >=0? table_S_color: val_h4_c <= -1? table_WW_color: val_h4_c <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,1,str.tostring(val_D_c, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_c >= 1? table_SS_color:val_D_c >=0? table_S_color: val_D_c <= -1? table_WW_color: val_D_c <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,1,str.tostring(close_c, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_01_visibility==true
    table.cell(checker,0,join_from+2,sym_01,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+2,str.tostring(val_h1_01, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_01 >= 1? table_SS_color:val_h1_01 >=0? table_S_color: val_h1_01 <= -1? table_WW_color: val_h1_01 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+2,str.tostring(val_h4_01, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_01 >= 1? table_SS_color:val_h4_01 >=0? table_S_color: val_h4_01 <= -1? table_WW_color: val_h4_01 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+2,str.tostring(val_D_01, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_01 >= 1? table_SS_color:val_D_01 >=0? table_S_color: val_D_01 <= -1? table_WW_color: val_D_01 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+2,str.tostring(close_01, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_02_visibility==true
    table.cell(checker,0,join_from+3,sym_02,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+3,str.tostring(val_h1_02, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_02 >= 1? table_SS_color:val_h1_02 >=0? table_S_color: val_h1_02 <= -1? table_WW_color: val_h1_02 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+3,str.tostring(val_h4_02, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_02 >= 1? table_SS_color:val_h4_02 >=0? table_S_color: val_h4_02 <= -1? table_WW_color: val_h4_02 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+3,str.tostring(val_D_02, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_02 >= 1? table_SS_color:val_D_02 >=0? table_S_color: val_D_02 <= -1? table_WW_color: val_D_02 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+3,str.tostring(close_02, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_03_visibility==true
    table.cell(checker,0,join_from+4,sym_03,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+4,str.tostring(val_h1_03, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_03 >= 1? table_SS_color:val_h1_03 >=0? table_S_color: val_h1_03 <= -1? table_WW_color: val_h1_03 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+4,str.tostring(val_h4_03, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_03 >= 1? table_SS_color:val_h4_03 >=0? table_S_color: val_h4_03 <= -1? table_WW_color: val_h4_03 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+4,str.tostring(val_D_03, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_03 >= 1? table_SS_color:val_D_03 >=0? table_S_color: val_D_03 <= -1? table_WW_color: val_D_03 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+4,str.tostring(close_03, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_04_visibility==true
    table.cell(checker,0,join_from+5,sym_04,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+5,str.tostring(val_h1_04, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_04 >= 1? table_SS_color:val_h1_04 >=0? table_S_color: val_h1_04 <= -1? table_WW_color: val_h1_04 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+5,str.tostring(val_h4_04, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_04 >= 1? table_SS_color:val_h4_04 >=0? table_S_color: val_h4_04 <= -1? table_WW_color: val_h4_04 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+5,str.tostring(val_D_04, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_04 >= 1? table_SS_color:val_D_04 >=0? table_S_color: val_D_04 <= -1? table_WW_color: val_D_04 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+5,str.tostring(close_04, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_05_visibility==true
    table.cell(checker,0,join_from+6,sym_05,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+6,str.tostring(val_h1_05, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_05 >= 1? table_SS_color:val_h1_05 >=0? table_S_color: val_h1_05 <= -1? table_WW_color: val_h1_05 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+6,str.tostring(val_h4_05, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_05 >= 1? table_SS_color:val_h4_05 >=0? table_S_color: val_h4_05 <= -1? table_WW_color: val_h4_05 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+6,str.tostring(val_D_05, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_05 >= 1? table_SS_color:val_D_05 >=0? table_S_color: val_D_05 <= -1? table_WW_color: val_D_05 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+6,str.tostring(close_05, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_06_visibility==true
    table.cell(checker,0,join_from+7,sym_06,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+7,str.tostring(val_h1_06, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_06 >= 1? table_SS_color:val_h1_06 >=0? table_S_color: val_h1_06 <= -1? table_WW_color: val_h1_06 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+7,str.tostring(val_h4_06, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_06 >= 1? table_SS_color:val_h4_06 >=0? table_S_color: val_h4_06 <= -1? table_WW_color: val_h4_06 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+7,str.tostring(val_D_06, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_06 >= 1? table_SS_color:val_D_06 >=0? table_S_color: val_D_06 <= -1? table_WW_color: val_D_06 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+7,str.tostring(close_06, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_07_visibility==true
    table.cell(checker,0,join_from+8,sym_07,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+8,str.tostring(val_h1_07, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_07 >= 1? table_SS_color:val_h1_07 >=0? table_S_color: val_h1_07 <= -1? table_WW_color: val_h1_07 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+8,str.tostring(val_h4_07, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_07 >= 1? table_SS_color:val_h4_07 >=0? table_S_color: val_h4_07 <= -1? table_WW_color: val_h4_07 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+8,str.tostring(val_D_07, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_07 >= 1? table_SS_color:val_D_07 >=0? table_S_color: val_D_07 <= -1? table_WW_color: val_D_07 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+8,str.tostring(close_07, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_08_visibility==true
    table.cell(checker,0,join_from+9,sym_08,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+9,str.tostring(val_h1_08, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_08 >= 1? table_SS_color:val_h1_08 >=0? table_S_color: val_h1_08 <= -1? table_WW_color: val_h1_08 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+9,str.tostring(val_h4_08, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_08 >= 1? table_SS_color:val_h4_08 >=0? table_S_color: val_h4_08 <= -1? table_WW_color: val_h4_08 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+9,str.tostring(val_D_08, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_08 >= 1? table_SS_color:val_D_08 >=0? table_S_color: val_D_08 <= -1? table_WW_color: val_D_08 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+9,str.tostring(close_08, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_09_visibility==true
    table.cell(checker,0,join_from+10,sym_09,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+10,str.tostring(val_h1_09, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_09 >= 1? table_SS_color:val_h1_09 >=0? table_S_color: val_h1_09 <= -1? table_WW_color: val_h1_09 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+10,str.tostring(val_h4_09, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_09 >= 1? table_SS_color:val_h4_09 >=0? table_S_color: val_h4_09 <= -1? table_WW_color: val_h4_09 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+10,str.tostring(val_D_09, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_09 >= 1? table_SS_color:val_D_09 >=0? table_S_color: val_D_09 <= -1? table_WW_color: val_D_09 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+10,str.tostring(close_09, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_10_visibility==true
    table.cell(checker,0,join_from+11,sym_10,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+11,str.tostring(val_h1_10, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_10 >= 1? table_SS_color:val_h1_10 >=0? table_S_color: val_h1_10 <= -1? table_WW_color: val_h1_10 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+11,str.tostring(val_h4_10, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_10 >= 1? table_SS_color:val_h4_10 >=0? table_S_color: val_h4_10 <= -1? table_WW_color: val_h4_10 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+11,str.tostring(val_D_10, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_10 >= 1? table_SS_color:val_D_10 >=0? table_S_color: val_D_10 <= -1? table_WW_color: val_D_10 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+11,str.tostring(close_10, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_11_visibility==true
    table.cell(checker,0,join_from+12,sym_11,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+12,str.tostring(val_h1_11, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_11 >= 1? table_SS_color:val_h1_11 >=0? table_S_color: val_h1_11 <= -1? table_WW_color: val_h1_11 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+12,str.tostring(val_h4_11, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_11 >= 1? table_SS_color:val_h4_11 >=0? table_S_color: val_h4_11 <= -1? table_WW_color: val_h4_11 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+12,str.tostring(val_D_11, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_11 >= 1? table_SS_color:val_D_11 >=0? table_S_color: val_D_11 <= -1? table_WW_color: val_D_11 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+12,str.tostring(close_11, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)

if sym_12_visibility==true
    table.cell(checker,0,join_from+13,sym_12,width=symbol_width,text_color=color.white,text_size=size.auto)
    table.cell(checker,1,join_from+13,str.tostring(val_h1_12, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h1_12 >= 1? table_SS_color:val_h1_12 >=0? table_S_color: val_h1_12 <= -1? table_WW_color: val_h1_12 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,2,join_from+13,str.tostring(val_h4_12, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_h4_12 >= 1? table_SS_color:val_h4_12 >=0? table_S_color: val_h4_12 <= -1? table_WW_color: val_h4_12 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,3,join_from+13,str.tostring(val_D_12, '#.##'),width=stdev_width,text_color=color.white,bgcolor=val_D_12 >= 1? table_SS_color:val_D_12 >=0? table_S_color: val_D_12 <= -1? table_WW_color: val_D_12 <0? table_W_color : table_bg_color,text_size=size.auto)
    table.cell(checker,4,join_from+13,str.tostring(close_12, '#.####'),width=price_width,text_color=color.white,text_size=size.auto)


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