UNPKG

trading-signals

Version:

Technical indicators to run technical analysis with JavaScript / TypeScript.

7 lines 285 B
export function getPercentageChange(baseValue, newValue) { if (baseValue === 0) { throw new Error('Cannot calculate percentage change from a base value of "0".'); } return ((newValue - baseValue) / baseValue) * 100; } //# sourceMappingURL=getPercentageChange.js.map