yuya_takahashi_

Pine講座⑲ 2行でlabelを表示する

Education
FX:USDJPY   U.S. Dollar / Japanese Yen
日本ではまだ公式に発表されていませんが、
6月頃にPineスクリプトのversion4がリリースされました。

大きな変更点は、
チャートにlabelとlineを描画できるようになったことです。

文字の出力も、かなり自由にできるようになりました。

=====
//@version=4
study( "label を表示する", overlay=true )
label.new( bar_index, high, style=label.style_none, text="x=" + tostring(bar_index) + "\ny=" + tostring(high) )
=====

bar_index : ローソク足番号(毎回変わる)

出力内容は、
text="x=" + tostring(bar_index) + "\ny=" + tostring(high)
の部分。

\n というのは改行のことです。
これがないと改行されずに出力されます。
Comment:
文字列は、必ず「"」ではさみます。
(「'」でも可)
Comment:
次の講座
Comment:

小次郎講師公式インジケーターのお申込
bit.ly/2vdSV4Q

小次郎講師のLINE@
bit.ly/2VZQFu3

小次郎講師のチャート情報局
bit.ly/2GvLAEp

Related Ideas

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.