見出し画像

Pine Script™ (v5) の覚書 - 7 : request.security_lower_tfを使ってマルチタイムフレーム(MTF)移動平均線を描いてみる(1)


今回使うもの request.security_lower_tf

request.security_lower_tfとその引数

request.security_lower_tf(symbol, timeframe, expression, ignore_invalid_symbol, currency, ignore_invalid_timeframe) → array<type>

request.security_lower_tfを使うと指定したsymbol(銘柄)の指定した下位時間足の値を取得することができる。
本稿では、request.security_lower_tfの必須要素としてsymbol(syminfo.tickerid: 現在表示している銘柄固定), timeframe(15: 15分足固定), expressionに限定して進める。

request.security_lower_tfの基本的な使い方

myvalue=request.security_lower_tf(syminfo.tickerid, timeframe, 計算させたいもの)

基本的にはrequest.security()と同じ使い方になるが、返り値が下位足複数本分の配列(array)となる点が異なる。
また、引数で指定したtimeframeが現在足より大きいとna値となる。

続く


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