/*
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, getEnumerator } from "igniteui-react-core/ES2015/type";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
export class ChaikinVolatilityIndicatorStrategy extends IndicatorCalculationStrategy {
    b(a, b) {
        let c = new List$1(String_$type, 0);
        c.add("HighColumn");
        c.add("LowColumn");
        c.o(b.a.c);
        return c;
    }
    a(a, b) {
        let c = b.j((d) => a.highColumn.item(d) - a.lowColumn.item(d), a.count);
        let d = getEnumerator(b.a.b(c, a.period));
        let e = a.indicatorColumn;
        let f = new Array(a.period);
        for (let g = 0; g < a.period; g++) {
            f[g] = 0;
        }
        let h = 0;
        while (d.moveNext()) {
            let i = h % a.period;
            let j = b.i((d.current - f[i]) / (f[i] * 100));
            if (h < a.period) {
                e.item(h, 0);
            }
            else {
                e.item(h, j);
            }
            f[i] = d.current;
            h++;
        }
        return true;
    }
}
ChaikinVolatilityIndicatorStrategy.$t = markType(ChaikinVolatilityIndicatorStrategy, 'ChaikinVolatilityIndicatorStrategy', IndicatorCalculationStrategy.$);
