/*
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 * as tslib_1 from "tslib";
import { IndicatorCalculationStrategy } from "./IndicatorCalculationStrategy";
import { String_$type, fromEnum, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
var RateOfChangeAndMomentumIndicatorStrategy = /** @class */ (function (_super) {
    tslib_1.__extends(RateOfChangeAndMomentumIndicatorStrategy, _super);
    function RateOfChangeAndMomentumIndicatorStrategy() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    RateOfChangeAndMomentumIndicatorStrategy.prototype.b = function (a, b) {
        var c = new List$1(String_$type, 0);
        c.add("CloseColumn");
        return c;
    };
    RateOfChangeAndMomentumIndicatorStrategy.prototype.a = function (a, b) {
        var c = a.closeColumn;
        var d = a.indicatorColumn;
        var e = a.period;
        var f = 0;
        var g = new Array(e);
        for (f = 0; f < e; f++) {
            g[f] = 0;
        }
        f = 0;
        try {
            for (var _a = tslib_1.__values(fromEnum(c)), _b = _a.next(); !_b.done; _b = _a.next()) {
                var h = _b.value;
                var i = f % e;
                var j = b.i(100 * (h - g[i]) / g[i]);
                d.item(f, j);
                g[i] = h;
                ++f;
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
            }
            finally { if (e_1) throw e_1.error; }
        }
        return true;
        var e_1, _c;
    };
    RateOfChangeAndMomentumIndicatorStrategy.$t = markType(RateOfChangeAndMomentumIndicatorStrategy, 'RateOfChangeAndMomentumIndicatorStrategy', IndicatorCalculationStrategy.$);
    return RateOfChangeAndMomentumIndicatorStrategy;
}(IndicatorCalculationStrategy));
export { RateOfChangeAndMomentumIndicatorStrategy };
