请问如何根据价格获得Bar的索引值idx?

Discussion in 'AmiBroker' started by forbbs, Sep 9, 2012.

  1. 比如说value=LLV(close,16);
    如何知道这个value在整个数组里的索引值或者是最近16个周期里第几个Bar?
    是不是只能loop?
     
  2. SYNTAX LLVBars( ARRAY, periods )
    RETURNS ARRAY
    FUNCTION Calculates the number of periods that have passed since the ARRAY reached its periods period trough. The function accepts periods parameter that can be constant as well as time-variant (array).
    EXAMPLE The formula "llvbars( close,50 )" returns the number of periods that have passed since the closing price reached its 50 period trough.
     
  3. 不明白,这个函数返回的又是array。
    我想返回的IDX应该是个数值啊。
     
  4. 最简单的就是用loop,设定一个最大向后搜索范围,比如搜索过去50个bar,其实速度很快的。