/*
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, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
var PositiveVolumeIndexIndicatorStrategy = /** @class */ (function (_super) {
    tslib_1.__extends(PositiveVolumeIndexIndicatorStrategy, _super);
    function PositiveVolumeIndexIndicatorStrategy() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    PositiveVolumeIndexIndicatorStrategy.prototype.b = function (a, b) {
        var c = new List$1(String_$type, 0);
        c.add("CloseColumn");
        c.add("VolumeColumn");
        return c;
    };
    PositiveVolumeIndexIndicatorStrategy.prototype.a = function (a, b) {
        var c = a.closeColumn;
        var d = a.volumeColumn;
        var e = a.indicatorColumn;
        var f = 0;
        var g = 0;
        var h = 0;
        if (e.count > 0) {
            e.item(0, f);
        }
        for (var i = 1; i < e.count; i++) {
            if (d.item(i) > d.item(i - 1)) {
                g = b.i((c.item(i) - c.item(i - 1)) / c.item(i - 1));
                if (h != 0) {
                    f += g * h;
                }
                else {
                    f += g;
                }
            }
            e.item(i, f);
            h = f;
        }
        return true;
    };
    PositiveVolumeIndexIndicatorStrategy.$t = markType(PositiveVolumeIndexIndicatorStrategy, 'PositiveVolumeIndexIndicatorStrategy', IndicatorCalculationStrategy.$);
    return PositiveVolumeIndexIndicatorStrategy;
}(IndicatorCalculationStrategy));
export { PositiveVolumeIndexIndicatorStrategy };
