iLow
Syntax
iLow(Symbol: string, TimeFrame: number, index: number): numberParameters
Return Value
Description
Example
Last updated
iLow(Symbol: string, TimeFrame: number, index: number): numberLast updated
// Get the low price of the current bar for EURUSD on H1 timeframe
const currentLow = this.api.iLow("EURUSD", 60, 0);
// Get the low price from 5 bars ago
const pastLow = this.api.iLow("EURUSD", 60, 5);
// Calculate the lowest price over the last 3 bars
const lowest = Math.min(
this.api.iLow("EURUSD", 60, 0),
this.api.iLow("EURUSD", 60, 1),
this.api.iLow("EURUSD", 60, 2)
);
// Check if current bar's low is a new local low
if (this.api.iLow("EURUSD", 60, 0) < this.api.iLow("EURUSD", 60, 1)) {
console.log("New local low formed");
}
// Calculate the average low price of last 3 bars
const avgLow =
(this.api.iLow("EURUSD", 60, 0) +
this.api.iLow("EURUSD", 60, 1) +
this.api.iLow("EURUSD", 60, 2)) /
3;
// Calculate bar range
const barRange =
this.api.iHigh("EURUSD", 60, 0) - this.api.iLow("EURUSD", 60, 0);