/*
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/ES2015/type";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { isNaN_ } from "igniteui-react-core/ES2015/number";
export 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 = markType(WilliamsPercentRIndicatorStrategy, 'WilliamsPercentRIndicatorStrategy', IndicatorCalculationStrategy.$);
