igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
47 lines (46 loc) • 2.09 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { IndicatorCalculationStrategy } from "./IndicatorCalculationStrategy";
import { String_$type, markType } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
* @hidden
*/
export let WilliamsPercentRIndicatorStrategy = /*@__PURE__*/ (() => {
class WilliamsPercentRIndicatorStrategy extends IndicatorCalculationStrategy {
b(a, b) {
let c = new List$1(String_$type, 0);
c.add("HighColumn");
c.add("LowColumn");
c.add("CloseColumn");
return c;
}
a(a, b) {
let c = a.period;
let d = a.highColumn;
let e = a.lowColumn;
for (let f = 0; f < a.count; f++) {
let g = Math.min(c, f);
let h = -1.7976931348623157E+308;
let i = 1.7976931348623157E+308;
for (let j = 0; j < g; j++) {
if (!isNaN_(d.item(f - j))) {
h = Math.max(h, d.item(f - j));
}
if (!isNaN_(e.item(f - j))) {
i = Math.min(i, e.item(f - j));
}
}
a.indicatorColumn.item(f, b.i((a.closeColumn.item(f) - h) / (h - i) * 100));
}
return true;
}
}
WilliamsPercentRIndicatorStrategy.$t = /*@__PURE__*/ markType(WilliamsPercentRIndicatorStrategy, 'WilliamsPercentRIndicatorStrategy', IndicatorCalculationStrategy.$);
return WilliamsPercentRIndicatorStrategy;
})();