Low

Returns the lowest price for a specific bar.

Syntax

Low(shift: number): number

Parameters

  • shift: A number representing the shift from the current bar

Return Value

Returns a number representing the lowest price reached during the specified bar.

Description

The Low method returns the lowest price reached during a bar at the specified shift from the current bar. The shift parameter determines which bar's low price to return:

  • 0: Current bar

  • 1: Previous bar

  • 2: Two bars ago

  • And so on

Example

// 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");
}

Last updated