Overview

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.

Syntax

const bop = new I.BOP();

Parameters

The Balance of Power indicator does not require specific input parameters, as it uses price data (open, high, low, close) for its calculation.

Returns

The BOP object provides a single value that oscillates between -1 and 1:

Accessing Indicator Values

To access the BOP value:

const iv = HFS.indicatorValues(state);
const bopValue = iv.bop; // Retrieve the most recent BOP value

Example Usage

Basic Implementation

const bop = new I.BOP();

const iv = HFS.indicatorValues(state);
const bopValue = iv.bop;

console.log(`BOP: ${bopValue}`); // Outputs the most recent BOP value

Analyzing Market Sentiment

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

Integration in Strategies