/*
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 { StreamingIndicatorCalculationStrategy } from "./StreamingIndicatorCalculationStrategy";
import { String_$type, fromEnum, toEnum, markType } from "igniteui-react-core/ES2015/type";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
export class AccumulationDistributionIndicatorStrategy extends StreamingIndicatorCalculationStrategy {
    b(a, b) {
        let c = new List$1(String_$type, 0);
        c.add("CloseColumn");
        c.add("LowColumn");
        c.add("HighColumn");
        c.add("VolumeColumn");
        return c;
    }
    a(a, b) {
        let c = 0;
        for (let d of fromEnum(this.c(a, b))) {
            a.indicatorColumn.item(c, d);
            c++;
        }
        return true;
    }
    *_c(a, b) {
        let c = 0;
        let d = Number.POSITIVE_INFINITY;
        let e = Number.NEGATIVE_INFINITY;
        let f = a.indicatorColumn != null ? a.indicatorColumn.count : 0;
        let g = a.closeColumn != null ? a.closeColumn.count : 0;
        let h = a.highColumn != null ? a.highColumn.count : 0;
        let i = a.volumeColumn != null ? a.volumeColumn.count : 0;
        let j = Math.min(f, Math.min(g, Math.min(h, i)));
        for (let k = 0; k < j; ++k) {
            let l = a.closeColumn.item(k);
            let m = a.lowColumn.item(k);
            let n = a.highColumn.item(k);
            let o = a.volumeColumn.item(k);
            let p = ((l - m) - (n - l)) / (n - m);
            c += b.i(p * o);
            d = Math.min(d, c);
            e = Math.max(e, c);
            yield c;
        }
    }
    c(a, b) {
        return toEnum(() => this._c(a, b));
    }
}
AccumulationDistributionIndicatorStrategy.$t = markType(AccumulationDistributionIndicatorStrategy, 'AccumulationDistributionIndicatorStrategy', StreamingIndicatorCalculationStrategy.$);
