iLowest
Syntax
iLowest(symbol: string, timeFrame: number, type: number, count: number, index: number): numberParameters
Return Value
Description
Example
Last updated
iLowest(symbol: string, timeFrame: number, type: number, count: number, index: number): numberLast updated
// Find lowest low price in last 10 bars
const lowestIndex = this.api.iLowest("EURUSD", 60, 2, 10, 0);
if (lowestIndex !== -1) {
const lowestPrice = this.api.iLow("EURUSD", 60, lowestIndex);
console.log(`Lowest price: ${lowestPrice} at index ${lowestIndex}`);
}
// Find lowest close in last 20 bars
const lowestCloseIndex = this.api.iLowest("EURUSD", 60, 3, 20, 0);
// Find lowest volume in last 5 bars
const lowestVolumeIndex = this.api.iLowest("EURUSD", 60, 4, 5, 0);
// Check if current bar is lowest in last 50 bars
const isNewLow = this.api.iLowest("EURUSD", 60, 2, 50, 0) === 0;
// Find lowest low starting from a specific bar
const startIndex = 10;
const lookback = 5;
const lowIndex = this.api.iLowest("EURUSD", 60, 2, lookback, startIndex);
// Get lowest price values for different types
const types = [0, 1, 2, 3]; // OPEN, HIGH, LOW, CLOSE
const lowestValues = types.map((type) => {
const idx = this.api.iLowest("EURUSD", 60, type, 10, 0);
return idx !== -1 ? this.api.iLow("EURUSD", 60, idx) : null;
});
// Find price channel
const highestHigh = this.api.iHigh(
"EURUSD",
60,
this.api.iHighest("EURUSD", 60, 1, 20, 0)
);
const lowestLow = this.api.iLow(
"EURUSD",
60,
this.api.iLowest("EURUSD", 60, 2, 20, 0)
);
const channelHeight = highestHigh - lowestLow;