The Balance of Power (BOP) is a momentum indicator used to measure the strength of buyers versus sellers in the market. It evaluates price movement in relation to the opening, closing, high, and low prices of a given period to gauge market sentiment.
const bop = new I.BOP();
The Balance of Power indicator does not require specific input parameters, as it uses price data (open, high, low, close) for its calculation.
The BOP
object provides a single value that oscillates between -1 and 1:
To access the BOP value:
const iv = HFS.indicatorValues(state);
const bopValue = iv.bop; // Retrieve the most recent BOP value
const bop = new I.BOP();
const iv = HFS.indicatorValues(state);
const bopValue = iv.bop;
console.log(`BOP: ${bopValue}`); // Outputs the most recent BOP value
Use BOP to evaluate the balance between buyers and sellers:
if (bopValue > 0) {
console.log("Market is dominated by buyers.");
} else if (bopValue < 0) {
console.log("Market is dominated by sellers.");
} else {
console.log("Market is neutral.");
}