Search
Products
Community
Markets
News
Brokers
More
IN
Get started
U.S. Dollar / Japanese Yen
Education
Updated
Aug 1, 2019
Pine講座⑧ ハイローバンドを表示する
2
8
Grab this chart
Grab this chart
4
4
Jun 19, 2019
Pineスクリプトには、期間中の最高値や最安値を取得する関数も用意されています。
highest( high ,20 ) → 過去20本の最高値を取得
lowest( low ,20 ) → 過去20本の最安値を取得
この中間点を求めたのが、一目均衡表の均衡点ですね!
=====
//Pineのバージョンとインジケーターの宣言
//
version
=3
study( "ハイローバンドを表示する" ,overlay=true )
//設定項目を指定し、その初期値を変数に格納
length = input( 20 ,title="計算する期間" )
//変数 length に格納されている期間中の最高値
highest = highest( high ,length )
//最安値と中間
lowest = lowest( low ,length )
middle = ( highest + lowest ) / 2
//最高値と最安値を変数に格納しつつチャートに描画
//offsetでplotの位置を左右にずらせる
//今回は1本前の計算値に対するブレイクアウトを見るために1本分ずらしている
p1 = plot( highest ,offset=1 )
p2 = plot( lowest ,offset=1 )
//中間をチャートに描画
plot( middle ,offset=1 ,color=red )
//最高値と最安値の間を塗りつぶす
fill( p1 ,p2 )
=====
Aug 1, 2019
Note
次の講座
yuya_takahashi_
Follow
小次郎講師公式インジケーターのお申込
bit.ly/2vdSV4Q
小次郎講師のLINE@
bit.ly/2VZQFu3
小次郎講師のチャート情報局
bit.ly/2GvLAEp
Also on:
Beyond Technical Analysis
pinescript
yuya_takahashi_
Follow
小次郎講師公式インジケーターのお申込
bit.ly/2vdSV4Q
小次郎講師のLINE@
bit.ly/2VZQFu3
小次郎講師のチャート情報局
bit.ly/2GvLAEp
Also on:
Related publications
Pine講座① たった2行で移動平均線が出せる
by yuya_takahashi_
Pine講座② EMAに設定項目を追加する
by yuya_takahashi_
Pine講座③ EMAを複数表示する
by yuya_takahashi_
Pine講座④ EMAの間を塗りつぶす
by yuya_takahashi_
Pine講座⑤ ボリンジャーバンドを表示する
by yuya_takahashi_
Pine講座⑥ エンベロープを表示する
by yuya_takahashi_
Pine講座⑦ 出来高加重移動平均(VWMA)を表示する
by yuya_takahashi_
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
.