@cmike444/supply-and-demand-zones
Version:
A library for identifying supply and demand zones in candlestick data.
15 lines (14 loc) • 519 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.candleBody = candleBody;
/**
* Calculates the body size of a candlestick by taking the absolute difference
* between its closing and opening prices.
*
* @param candle - An object representing a candlestick, containing `open` and `close` properties.
* @returns The absolute difference between the `close` and `open` prices of the candlestick.
*/
function candleBody(candle) {
return Math.abs(candle.close - candle.open);
}
;