```TA.Highest()```函数返回最近一定周期内的某个属性的最大值,不包含当前Bar。
number
TA.Highest(inReal)
TA.Highest(inReal, period, attr)
```inReal```参数用于指定K线数据。
inReal
true
{@struct/Record Record}结构数组、数值数组
```period```参数用于设置周期。
period
false
number
```attr```参数用于设置属性,可选:```Open```、```Close```、```Low```、```High```、```Volume```、```OpenInterest```。
attr
false
string
```javascript
function main() {
var records = exchange.GetRecords()
var highestForOpen = TA.Highest(records, 10, "Open")
Log(highestForOpen)
}
def main():
records = exchange.GetRecords()
highestForOpen = TA.Highest(records, 10, "Open")
Log(highestForOpen)
void main() {
auto records = exchange.GetRecords();
auto highestForOpen = TA.Highest(records.Open(), 10);
Log(highestForOpen);
}
例如调用TA.Highest(records, 30, "High")
函数,如果周期参数period
设置为0
, 指计算inReal
参数传入的K线数据的所有Bar
;如果属性参数attr
不指定,则视为inReal
参数传入的K线数据为普通数组。
{@fun/TA/TA.MACD TA.MACD}, {@fun/TA/TA.KDJ TA.KDJ}, {@fun/TA/TA.RSI TA.RSI}, {@fun/TA/TA.ATR TA.ATR}, {@fun/TA/TA.OBV TA.OBV}, {@fun/TA/TA.MA TA.MA}, {@fun/TA/TA.EMA TA.EMA}, {@fun/TA/TA.BOLL TA.BOLL}, {@fun/TA/TA.Alligator TA.Alligator}, {@fun/TA/TA.CMF TA.CMF}, {@fun/TA/TA.Lowest TA.Lowest}
TA.CMF TA.Lowest