簡體   English   中英

松腳本中的 [] 是什么?

[英]what is [] in pine-script?

以下代碼中 _smoothed[1] 變量的值是多少?

f_zrsi( _source, _length ) => rsi( _source, _length ) - 50

f_rsi( _source, _length, _mode ) =>
    //  get base rsi
    float _zrsi = f_zrsi( _source, _length )

    //  smoothing in a manner similar to HA open, but rather using the realtime
    //  rsi in place of the prior close value.
    var float _smoothed = na
    _smoothed := na( _smoothed[1] ) ? _zrsi : ( _smoothed[1] + _zrsi ) / 2

    //  return the requested mode
    _mode ? _smoothed : _zrsi

它被稱為History Reference Operator ,用於訪問歷史數據。

在您的示例中, _smoothed[1]返回_smoothed的先前值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM