從指定的參考點開始,在指定數量的鋼筋中,最小值在陣列中的位移(位置)
Bar.lowest(prices:Array, count:int=array.length, start:int)
Parameters
Name |
Type |
Действие |
Значение по умолчанию |
prices |
Array |
價格數組 |
— |
count |
int |
條數(從當前條到增加索引的方向) |
array.length |
start |
int |
從指定的參考點開始,在指定數量的小節中最小值在數組中的移動 |
— |
Example
export class Main extends Indicator {
constructor() {
super();
}
onInit() {
}
async onUpdate() {
const priceType = 0,
{Time, Open} = await Bar.load([Bar.Mode.Time, Bar.Mode.Open], priceType);
let period = 12, shift = 46;
// 求Open數組在Open[46]到Open[46+12-1]範圍內的最小值(12個數組元素)
let LowestIndex = Bar.lowest(Open, period, shift)
let MinOfArrayPart = Open[LowestIndex];
this.print('Lowest bar is at ' + LowestIndex + " and it's value is " +MinOfArrayPart);
}
}