Low
Last updated
Last updated
// Get current bar's low price
const currentLow = this.api.Low(0);
// Get previous bar's low price
const previousLow = this.api.Low(1);
// Find lowest price over last 3 bars
let lowestPrice = this.api.Low(0);
for (let i = 1; i < 3; i++) {
const low = this.api.Low(i);
if (low < lowestPrice) {
lowestPrice = low;
}
}
console.log(`Lowest price in last 3 bars: ${lowestPrice}`);
// Check if current bar made new low
if (this.api.Low(0) < this.api.Low(1)) {
console.log("New low formed on current bar");
}