U.S. Dollar / Japanese Yen
Education
Updated

Pine講座⑥ エンベロープを表示する

1941
今日はエンベロープを表示してみます。
数値は足種や銘柄に応じて調整をする必要があります。


=====
//version=3
study( "エンベロープを表示する" ,overlay=true )

price = input( close ,title="EMAの対象" )
length = input( 20 ,title="EMAの期間" )

ema = ema( price ,length )

plot( ema + ema * 0.04 ,linewidth=2 )
plot( ema + ema * 0.03 )
plot( ema + ema * 0.025 ,transp=75 )
plot( ema + ema * 0.02 )
plot( ema + ema * 0.015 ,transp=75 )
plot( ema + ema * 0.01 ,color=red )

plot( ema ,color=red )

plot( ema - ema * 0.01 ,color=red )
plot( ema - ema * 0.015 ,transp=75 )
plot( ema - ema * 0.02 )
plot( ema - ema * 0.025 ,transp=75 )
plot( ema - ema * 0.03 )
plot( ema - ema * 0.04 ,linewidth=2 )
=====


このように、Pineスクリプトを使えば、
何本でも移動平均線を表示することができます。

今日、新しく出てきたのは「transp」。
これは plot( ) する線の透明度を調整することができる項目です。
100にすると透明度が100%で、何も表示されなくなります。
Note
次の講座
Pine講座⑦ 出来高加重移動平均(VWMA)を表示する

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.