
/// <reference path="c1.mvc.basic.lib.d.ts" />

/*
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    */
declare module wijmo.chart.finance {
    function _trunc(value: number): number;
    function _sum(...values: number[]): number;
    function _sum(values: number[]): number;
    function _average(...values: number[]): number;
    function _average(values: number[]): number;
    function _minimum(...values: number[]): number;
    function _minimum(values: number[]): number;
    function _maximum(...values: number[]): number;
    function _maximum(values: number[]): number;
    function _variance(...values: number[]): number;
    function _variance(values: number[]): number;
    function _stdDeviation(...values: number[]): number;
    function _stdDeviation(values: number[]): number;
    function _avgTrueRng(highs: number[], lows: number[], closes: number[], period?: number): number[];
    function _trueRng(highs: number[], lows: number[], closes: number[], period?: number): number[];
    function _sma(values: number[], period: number): number[];
    function _ema(values: number[], period: number): number[];
    function _range(begin: number, end: number, step?: number): number[];
}

/**
 * Defines the @see:FinancialChart control and its associated classes.
 *
 */
declare module wijmo.chart.finance {
    /**
     * Specifies the type of financial chart.
     */
    enum FinancialChartType {
        /** Shows vertical bars and allows you to compare values of items across categories. */
        Column = 0,
        /** Uses X and Y coordinates to show patterns within the data. */
        Scatter = 1,
        /** Shows trends over a period of time or across categories. */
        Line = 2,
        /** Shows line chart with a symbol on each data point. */
        LineSymbols = 3,
        /** Shows line chart with area below the line filled with color. */
        Area = 4,
        /** Presents items with high, low, open, and close values.
         * The size of the wick line is determined by the High and Low values, while
         * the size of the bar is determined by the Open and Close values. The bar is
         * displayed using different colors, depending on whether the close value is
         * higher or lower than the open value. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "highProperty, lowProperty, openProperty, closeProperty".  */
        Candlestick = 5,
        /** Displays the same information as a candlestick chart, except that opening
         * values are displayed using lines to the left, while lines to the right
         * indicate closing values. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "highProperty, lowProperty, openProperty, closeProperty". */
        HighLowOpenClose = 6,
        /** Derived from the candlestick chart and uses information from the current and
         * prior period in order to filter out the noise. These charts cannot be combined
         * with any other series objects. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "highProperty, lowProperty, openProperty, closeProperty". */
        HeikinAshi = 7,
        /** Filters out noise by focusing exclusively on price changes. These charts cannot
         * be combined with any other series objects. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "highProperty, lowProperty, openProperty, closeProperty". */
        LineBreak = 8,
        /** Ignores time and focuses on price changes that meet a specified amount. These
         * charts cannot be combined with any other series objects. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "highProperty, lowProperty, openProperty, closeProperty". */
        Renko = 9,
        /** Ignores time and focuses on price action. These charts cannot be combined with
         * any other series objects. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "highProperty, lowProperty, openProperty, closeProperty". */
        Kagi = 10,
        /** Identical to the standard Column chart, except that the width of each bar is
         * determined by the Volume value. The data for this chart type can be defined using the
         *  @see:FinancialChart or @see:FinancialSeries <b>binding</b> property as a comma separated value in the
         * following format: "yProperty, volumeProperty".  This chart type can only be used at
         * the @see:FinancialChart level, and should not be applied on
         * @see:FinancialSeries objects. Only one set of volume data is currently supported
         * per @see:FinancialChart. */
        ColumnVolume = 11,
        /** Similar to the Candlestick chart, but shows the high and low values only.
         * In addition, the width of each bar is determined by Volume value. The data for
         * this chart type can be defined using the  @see:FinancialChart or @see:FinancialSeries
         * <b>binding</b> property as a comma separated value in the following format:
         * "highProperty, lowProperty, openProperty, closeProperty, volumeProperty".
         * This chart type can only be used at the @see:FinancialChart level, and should not
         * be applied on @see:FinancialSeries objects. Only one set of volume data is currently
         * supported per @see:FinancialChart. */
        EquiVolume = 12,
        /** Identical to the standard Candlestick chart, except that the width of each
         * bar is determined by Volume value. The data for
         * this chart type can be defined using the  @see:FinancialChart or @see:FinancialSeries
         * <b>binding</b> property as a comma separated value in the following format:
         * "highProperty, lowProperty, openProperty, closeProperty, volumeProperty".
         * This chart type can only be used at the @see:FinancialChart level, and should not
         * be applied on @see:FinancialSeries objects. Only one set of volume data is currently
         * supported per @see:FinancialChart. */
        CandleVolume = 13,
        /** Created by Richard Arms, this chart is a combination of EquiVolume and
         * CandleVolume chart types. The data for
         * this chart type can be defined using the  @see:FinancialChart or @see:FinancialSeries
         * <b>binding</b> property as a comma separated value in the following format:
         * "highProperty, lowProperty, openProperty, closeProperty, volumeProperty".
         * This chart type can only be used at the @see:FinancialChart level, and should not
         * be applied on @see:FinancialSeries objects. Only one set of volume data is currently
         * supported per @see:FinancialChart. */
        ArmsCandleVolume = 14,
        /**
         * Point and figure financial chart.
         * The data for this chart type can be defined using the  @see:FinancialChart
         * or @see:FinancialSeries <b>binding</b> property as a comma separated value in
         * the following format: "highProperty, lowProperty, closeProperty".
         * This chart type can only be used at the @see:FinancialChart level, and should not
         * be applied on @see:FinancialSeries objects. */
        PointAndFigure = 15,
    }
    /**
     * Financial charting control.
     */
    class FinancialChart extends FlexChartCore {
        private _chartType;
        private __heikinAshiPlotter;
        private __lineBreakPlotter;
        private __renkoPlotter;
        private __kagiPlotter;
        private __pfPlotter;
        /**
         * Initializes a new instance of the @see:FlexChart class.
         *
         * @param element The DOM element that hosts the control, or a selector for the
         * host element (e.g. '#theCtrl').
         * @param options A JavaScript object containing initialization data for the
         * control.
         */
        constructor(element: any, options?: any);
        /**
         * Gets or sets the type of financial chart to create.
         */
        chartType: FinancialChartType;
        /**
         * Gets or sets various chart options.
         *
         * The following options are supported:
         *
         * <b>kagi.fields</b>: Specifies the @see:DataFields used for
         * the Kagi chart. The default value is DataFields.Close.
         *
         * <b>kagi.rangeMode</b>: Specifies the @see:RangeMode for
         * the Kagi chart. The default value is RangeMode.Fixed.
         *
         * <b>kagi.reversalAmount</b>: Specifies the reversal amount for
         * the Kagi chart. The default value is 14.
         *
         * <pre>chart.options = {
         *   kagi: {
         *      fields: wijmo.chart.finance.DataFields.Close,
         *      rangeMode: wijmo.chart.finance.RangeMode.Fixed,
         *      reversalAmount: 14
         *   }
         * }</pre>
         *
         * <b>lineBreak.newLineBreaks</b>: Gets or sets the number of previous
         * boxes that must be compared before a new box is drawn in
         * Line Break charts. The default value is 3.
         *
         * <pre>chart.options = {
         *   lineBreak: { newLineBreaks: 3 }
         * }</pre>
         *
         * <b>renko.fields</b>: Specifies the @see:DataFields used for
         * the Renko chart. The default value is DataFields.Close.
         *
         * <b>renko.rangeMode</b>: Specifies the @see:RangeMode for
         * the Renko chart. The default value is RangeMode.Fixed.
         *
         * <b>renko.boxSize</b>: Specifies the box size for
         * the Renko chart. The default value is 14.
         *
         * <pre>chart.options = {
         *   renko: {
         *      fields: wijmo.chart.finance.DataFields.Close,
         *      rangeMode: wijmo.chart.finance.RangeMode.Fixed,
         *      boxSize: 14
         *   }
         * }</pre>
         */
        options: any;
        private readonly _heikinAshiPlotter;
        private readonly _lineBreakPlotter;
        private readonly _renkoPlotter;
        private readonly _kagiPlotter;
        private readonly _pfPlotter;
        _getChartType(): chart.ChartType;
        _getPlotter(series: FinancialSeries): _IPlotter;
        _createSeries(): SeriesBase;
    }
}

declare module wijmo.chart.finance {
    /**
     * Represents a series of data points to display in the chart.
     *
     * The @see:Series class supports all basic chart types. You may define
     * a different chart type on each @see:Series object that you add to the
     * @see:FlexChart series collection. This overrides the @see:chartType
     * property set on the chart that is the default for all @see:Series objects
     * in its collection.
     */
    class FinancialSeries extends SeriesBase {
        private _finChartType;
        /**
         * Gets or sets the chart type for a specific series, overriding the chart type
         * set on the overall chart. Please note that ColumnVolume, EquiVolume,
         * CandleVolume and ArmsCandleVolume chart types are not supported and should be
         * set on the @see:FinancialChart.
         */
        chartType: FinancialChartType;
        _getChartType(): chart.ChartType;
    }
}

declare module wijmo.chart.finance {
    interface _IFinanceItem {
        high: number;
        low: number;
        open: number;
        close: number;
        x: number;
        pointIndex: number;
    }
    interface _IFinancialCalculator {
        highs: number[];
        lows: number[];
        opens: number[];
        closes: number[];
        xs?: number[];
        size?: number;
        unit?: RangeMode;
        fields?: DataFields;
        calculate(): any;
    }
    class _BaseCalculator implements _IFinancialCalculator {
        highs: number[];
        lows: number[];
        opens: number[];
        closes: number[];
        constructor(highs: number[], lows: number[], opens: number[], closes: number[]);
        calculate(): any;
    }
    class _HeikinAshiCalculator extends _BaseCalculator {
        constructor(highs: number[], lows: number[], opens: number[], closes: number[]);
        calculate(): _IFinanceItem[];
    }
    class _BaseRangeCalculator extends _BaseCalculator {
        xs: number[];
        size: number;
        unit: RangeMode;
        fields: DataFields;
        constructor(highs: number[], lows: number[], opens: number[], closes: number[], xs: number[], size: number, unit?: RangeMode, fields?: DataFields);
        _getValues(): number[];
        _getSize(): number;
    }
    class _LineBreakCalculator extends _BaseRangeCalculator {
        constructor(highs: number[], lows: number[], opens: number[], closes: number[], xs: number[], size: number);
        calculate(): _IFinanceItem[];
        private _trendExists(vals);
    }
    class _KagiCalculator extends _BaseRangeCalculator {
        constructor(highs: number[], lows: number[], opens: number[], closes: number[], xs: number[], size: number, unit: RangeMode, field: DataFields);
        calculate(): _IFinanceItem[];
    }
    class _RenkoCalculator extends _BaseRangeCalculator {
        rounding: boolean;
        constructor(highs: number[], lows: number[], opens: number[], closes: number[], xs: number[], size: number, unit: RangeMode, field: DataFields, rounding?: boolean);
        calculate(): _IFinanceItem[];
        _round(value: number, size: number): number;
    }
}

declare module wijmo.chart.finance {
    class _HeikinAshiPlotter extends _FinancePlotter {
        private _haValues;
        private _calculator;
        private _symFactor;
        constructor();
        clear(): void;
        plotSeries(engine: IRenderEngine, ax: _IAxis, ay: _IAxis, series: FinancialSeries, palette: _IPalette, iser: number, nser: number): void;
        _drawSymbol(engine: IRenderEngine, ax: _IAxis, ay: _IAxis, si: number, pi: number, fill: any, w: number, x: number, hi: number, lo: number, open: number, close: number, dpt?: _DataPoint, dt?: DataType): void;
        _getDataPoint(seriesIndex: number, pointIndex: number, x: any, series: SeriesBase): _DataPoint;
        private _calculate(series);
        private _init();
    }
}

declare module wijmo.chart.finance {
    class _BaseRangePlotter extends _BasePlotter {
        private _symFactor;
        _calculator: _BaseRangeCalculator;
        _rangeValues: _IFinanceItem[];
        _rangeXLabels: any[];
        constructor();
        clear(): void;
        unload(): void;
        adjustLimits(dataInfo: _DataInfo, plotRect: Rect): Rect;
        plotSeries(engine: IRenderEngine, ax: _IAxis, ay: _IAxis, series: FinancialSeries, palette: _IPalette, iser: number, nser: number): void;
        _drawSymbol(engine: IRenderEngine, ax: _IAxis, ay: _IAxis, si: number, pi: number, w: number, x: number, start: number, end: number, dpt: _DataPoint): void;
        _getDataPoint(seriesIndex: number, pointIndex: number, series: SeriesBase, dataY: number): _DataPoint;
        _init(): void;
        _calculate(series: FinancialSeries): void;
        _generateXLabels(series: FinancialSeries): void;
    }
    /**
     * Specifies which fields are to be used for calculation. Applies to Renko and Kagi chart types.
     */
    enum DataFields {
        /** Close values are used for calculations. */
        Close = 0,
        /** High values are used for calculations. */
        High = 1,
        /** Low values are used for calculations. */
        Low = 2,
        /** Open values are used for calculations. */
        Open = 3,
        /** High-Low method is used for calculations. DataFields.HighLow is currently not
         * supported with Renko chart types. */
        HighLow = 4,
        /** Average of high and low values is used for calculations. */
        HL2 = 5,
        /** Average of high, low, and close values is used for calculations. */
        HLC3 = 6,
        /** Average of high, low, open, and close values is used for calculations. */
        HLOC4 = 7,
    }
    /**
     * Specifies the unit for Kagi and Renko chart types.
     */
    enum RangeMode {
        /** Uses a fixed, positive number for the Kagi chart's reversal amount
         * or Renko chart's box size. */
        Fixed = 0,
        /** Uses the current Average True Range value for Kagi chart's reversal amount
         * or Renko chart's box size. When ATR is used, the reversal amount or box size
         * option of these charts must be an integer and will be used as the period for
         * the ATR calculation. */
        ATR = 1,
        /** Uses a percentage for the Kagi chart's reversal amount. RangeMode.Percentage
         * is currently not supported with Renko chart types. */
        Percentage = 2,
    }
}

declare module wijmo.chart.finance {
    class _LineBreakPlotter extends _BaseRangePlotter {
        private _newLineBreaks;
        constructor();
        clear(): void;
        _calculate(series: FinancialSeries): void;
        _init(): void;
    }
}

declare module wijmo.chart.finance {
    class _RenkoPlotter extends _BaseRangePlotter {
        private _boxSize;
        private _rangeMode;
        private _fields;
        private _rounding;
        constructor();
        clear(): void;
        _calculate(series: FinancialSeries): void;
        _init(): void;
        _generateXLabels(series: FinancialSeries): void;
    }
}

declare module wijmo.chart.finance {
    class _KagiPlotter extends _BaseRangePlotter {
        private _reversalAmount;
        private _rangeMode;
        private _fields;
        constructor();
        _calculate(series: FinancialSeries): void;
        plotSeries(engine: IRenderEngine, ax: _IAxis, ay: _IAxis, series: FinancialSeries, palette: _IPalette, iser: number, nser: number): void;
        _init(): void;
        clear(): void;
    }
}

declare module wijmo.chart.finance {
    /**
     * Specifies the scaling mode for point and figure chart.
     */
    enum PointAndFigureScaling {
        /** Traditional scaling. The box size is calculated automatically based on price range.  */
        Traditional = 0,
        /** Fixed scaling. The box size is defined by boxSize property. */
        Fixed = 1,
        /** Dynamic(ATR) scaling. The box size is calculated based on ATR. */
        Dynamic = 2,
    }
    class _PointAndFigurePlotter extends _BasePlotter {
        private _boxSize;
        private _reversal;
        private _period;
        private _fields;
        private _scaling;
        private _actualBoxSize;
        private _pfdata;
        private _xlbls;
        constructor();
        clear(): void;
        unload(): void;
        _init(): void;
        adjustLimits(dataInfo: _DataInfo, plotRect: Rect): Rect;
        plotSeries(engine: IRenderEngine, ax: _IAxis, ay: _IAxis, series: FinancialSeries, palette: _IPalette, iser: number, nser: number): void;
        private calcBoxSize(data, fieldHi, fieldLo);
        private calcPFHiLo2(data, fieldHi, fieldLo, xbnd, boxSize, reversal);
        private roundUp(val, boxSize);
        private roundDown(val, boxSize);
        private renderGrid(engine, data, boxSize);
        private renderData(chart, engine, data, boxSize);
    }
}


/*
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    */
/**
 * Analytics extensions for @see:FinancialChart.
 */
declare module wijmo.chart.finance.analytics {
    /**
     * Represents a Fibonacci Retracements tool for the @see:FinancialChart.

     * The tool enables the calculation and plotting of various alert levels that are
     * useful in financial charts.
     *
     * To add Fibonacci tool to a @see:FinancialChart control, create an instance
     * of the @see:Fibonacci and add it to the <b>series</b> collection of the chart.
     * For example:
     *
     * <pre>
     * // create chart
     * var chart = new wijmo.chart.finance.FinancialChart('#chartElement');
     * // create Fibonacci tool
     * var ftool = new wijmo.chart.finance.analytics.Fibonacci();
     * chart.series.push(ftool);
     * </pre>
      */
    class Fibonacci extends SeriesBase {
        private _high;
        private _low;
        private _minX;
        private _maxX;
        private _actualHigh;
        private _actualLow;
        private _levels;
        private _uptrend;
        private _labelPosition;
        /**
         * Initializes a new instance of the @see:Fibonacci class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the low value of @see:Fibonacci tool.
         *
         * If not specified, the low value is calculated based on data values provided by <b>itemsSource</b>.
         */
        low: number;
        /**
         * Gets or sets the high value of @see:Fibonacci tool.
         *
         * If not specified, the high value is caclulated based on
         * data values provided by the <b>itemsSource</b>.
         */
        high: number;
        /**
         * Gets or sets the label position for levels in @see:Fibonacci tool.
         */
        labelPosition: LabelPosition;
        /**
         * Gets or sets a value indicating whether to create uptrending @see:Fibonacci tool.
         *
         * Default value is true(uptrend). If the value is false, the downtrending levels are plotted.
         */
        uptrend: boolean;
        /**
         * Gets or sets the array of levels for plotting.
         *
         * Default value is [0, 23.6, 38.2, 50, 61.8, 100].
         */
        levels: number[];
        /**
         * Gets or sets the x minimal value of the @see:Fibonacci tool.
         *
         * If not specified, current minimum of x-axis is used.
         * The value can be specified as a number or Date object.
         */
        minX: any;
        /**
         * Gets or sets the x maximum value of the @see:Fibonacci tool.
         *
         * If not specified, current maximum of x-axis is used.
         * The value can be specified as a number or Date object.
         */
        maxX: any;
        private _getMinX();
        private _getMaxX();
        private _updateLevels();
        private _render(sender, args);
        _getChartType(): ChartType;
    }
    /**
     * Represents a Fibonacci Arcs tool for the @see:FinancialChart.
     */
    class FibonacciArcs extends SeriesBase {
        private _start;
        private _end;
        private _levels;
        private _labelPosition;
        /**
         * Initializes a new instance of the @see:FibonacciArcs class.
         *
         * @param options A JavaScript object containing initialization data.
         */
        constructor(options?: any);
        /**
         * Gets or sets the starting @see:DataPoint for the base line.
         *
         * The @see:DataPoint x value can be a number or a Date object
         * (for time-based data).
         *
         * Unlike some of the other Fibonacci tools, the starting
         * @see:DataPoint is <b>not</b> calculated automatically if
         * undefined.
         */
        start: DataPoint;
        /**
         * Gets or sets the ending @see:DataPoint for the base line.
         *
         * The @see:DataPoint x value can be a number or a Date object
         * (for time-based data).
         *
         * Unlike some of the other Fibonacci tools, the ending
         * @see:DataPoint is <b>not</b> calculated automatically if
         * undefined.
         */
        end: DataPoint;
        /**
         * Gets or sets the array of levels for plotting.
         *
         * Default value is [38.2, 50, 61.8].
         */
        levels: number[];
        /**
         * Gets or sets the @see:LabelPosition for levels in @see:FibonacciArcs tool.
         */
        labelPosition: LabelPosition;
        _render(sender: SeriesBase, args: RenderEventArgs): void;
        private _getX(dim);
        private _getY(dim);
        _getChartType(): ChartType;
    }
    /**
     * Represents a Fibonacci Fans tool for the @see:FinancialChart.
     */
    class FibonacciFans extends SeriesBase {
        private _start;
        private _end;
        private _levels;
        private _labelPosition;
        /**
         * Initializes a new instance of the @see:FibonacciFans class.
         *
         * @param options A JavaScript object containing initialization data.
         */
        constructor(options?: any);
        /**
         * Gets or sets the starting @see:DataPoint for the base line.
         *
         * If not set, the starting @see:DataPoint is calculated automatically.
         * The @see:DataPoint x value can be a number or a Date object (for
         * time-based data).
         */
        start: DataPoint;
        /**
         * Gets or sets the ending @see:DataPoint for the base line.
         *
         * If not set, the starting @see:DataPoint is calculated automatically.
         * The @see:DataPoint x value can be a number or a Date object (for
         * time-based data).
         */
        end: DataPoint;
        /**
         * Gets or sets the array of levels for plotting.
         *
         * Default value is [0, 23.6, 38.2, 50, 61.8, 100].
         */
        levels: number[];
        /**
         * Gets or sets the @see:LabelPosition for levels in @see:FibonacciFans tool.
         */
        labelPosition: LabelPosition;
        _updateLevels(): void;
        _render(sender: SeriesBase, args: RenderEventArgs): void;
        private _getX(dim);
        private _getY(dim);
        _getChartType(): ChartType;
    }
    /**
     * Represents a Fibonacci Time Zones tool for the @see:FinancialChart.
     */
    class FibonacciTimeZones extends SeriesBase {
        private _startX;
        private _endX;
        private _levels;
        private _labelPosition;
        /**
         * Initializes a new instance of the @see:FibonacciTimeZones class.
         *
         * @param options A JavaScript object containing initialization data.
         */
        constructor(options?: any);
        /**
         * Gets or sets the starting X data point for the time zones.
         *
         * If not set, the starting X data point is calculated automatically. The
         * value can be a number or a Date object (for time-based data).
         */
        startX: any;
        /**
         * Gets or sets the ending X data point for the time zones.
         *
         * If not set, the ending X data point is calculated automatically. The
         * value can be a number or a Date object (for time-based data).
         */
        endX: any;
        /**
         * Gets or sets the array of levels for plotting.
         *
         * Default value is [0, 1, 2, 3, 5, 8, 13, 21, 34].
         */
        levels: number[];
        /**
         * Gets or sets the @see:LabelPosition for levels in @see:FibonacciTimeZones tool.
         */
        labelPosition: LabelPosition;
        _render(sender: SeriesBase, args: RenderEventArgs): void;
        _updateLevels(): void;
        private _getX(dim);
        _getChartType(): ChartType;
    }
}

declare module wijmo.chart.finance.analytics {
    /**
     * Base class for overlay and indicator series (abstract).
     */
    class OverlayIndicatorBase extends SeriesBase {
        private __hitTester;
        _styles: any;
        _seriesCount: number;
        /**
         * Initializes a new instance of the @see:OverlayIndicatorBase class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        readonly _hitTester: _HitTester;
        _getChartType(): ChartType;
        _getXValues(): number[];
        _getDataPoint(dataX: number, dataY: number, seriesIndex: number, pointIndex: number, ax: Axis, ay: Axis): _DataPoint;
        _shouldCalculate(): boolean;
        _init(): void;
        _calculate(): void;
        _clearValues(): void;
        _getName(dim: number): string;
        _getStyles(dim: number): any;
        legendItemLength(): number;
        measureLegendItem(engine: IRenderEngine, index: number): Size;
        drawLegendItem(engine: IRenderEngine, rect: Rect, index: number): void;
    }
    /**
     * Base class for overlay and indicator series that render a single series (abstract).
     */
    class SingleOverlayIndicatorBase extends OverlayIndicatorBase {
        private _period;
        _xvals: number[];
        _yvals: number[];
        /**
         * Initializes a new instance of the @see:SingleOverlayIndicatorBase class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the period for the calculation as an integer value.
         */
        period: any;
        getValues(dim: number): number[];
        getDataRect(currentRect?: Rect, calculatedRect?: Rect): Rect;
        _clearValues(): void;
        _shouldCalculate(): boolean;
        _init(): void;
        _getItem(pointIndex: number): any;
    }
}

declare module wijmo.chart.finance.analytics {
    /**
     * Represents an Average True Range indicator series for the @see:FinancialChart.
     *
     * Average true range is used to measure the volatility of an asset. Average true range
     * does not provide any indication of the price's trend, but rather the degree of price
     * volatility.
     */
    class ATR extends SingleOverlayIndicatorBase {
        /**
         * Initializes a new instance of the @see:ATR class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        _calculate(): void;
    }
}

declare module wijmo.chart.finance.analytics {
    /**
     * Represents a Commodity Channel Index indicator series for the @see:FinancialChart.
     *
     * The commodity channel index is an oscillator that measures an asset's current price
     * level relative to an average price level over a specified period of time.
     */
    class CCI extends SingleOverlayIndicatorBase {
        private _constant;
        /**
         * Initializes a new instance of the @see:CCI class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the constant value for the CCI calculation.  The default
         * value is 0.015.
         */
        constant: number;
        _calculate(): void;
    }
    function _cci(highs: number[], lows: number[], closes: number[], period: number, constant: number): number[];
}

declare module wijmo.chart.finance.analytics {
    /**
     * Represents a Willaims %R indicator series for the @see:FinancialChart.
     *
     * Williams %R is a momentum indicator that is the inverse of a fast stochastic
     * oscillator (@see:Stochastic).  The Williams %R indicator is designed to
     * tell whether an asset is trading near the high or low of its trading range.
     */
    class WilliamsR extends SingleOverlayIndicatorBase {
        /**
         * Initializes a new instance of the @see:WilliamsR class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        _calculate(): void;
    }
    function _williamsR(highs: number[], lows: number[], closes: number[], period: number): number[];
}

declare module wijmo.chart.finance.analytics {
    enum MovingAverageType {
        Simple = 0,
        Exponential = 1,
    }
    /**
     * Represents a Moving Average Envelopes overlay series for the @see:FinancialChart.
     *
     * Moving average envelopes are moving averages set above and below a standard moving
     * average.  The amount above/below the standard moving average is percentage based and
     * dictated by the @see:size property.
     */
    class Envelopes extends OverlayIndicatorBase {
        private _upperYVals;
        private _lowerYVals;
        private _xVals;
        private _period;
        private _type;
        private _size;
        /**
         * Initializes a new instance of the @see:Envelopes class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the period for the calculation as an integer value.
         */
        period: any;
        /**
         * Gets or sets the moving average type for the
         * envelopes.  The default value is Simple.
         */
        type: MovingAverageType;
        /**
         * Gets or set the size of the moving average
         * envelopes.  The default value is 2.5 percent (0.025).
         */
        size: number;
        getDataRect(currentRect?: Rect, calculatedRect?: Rect): Rect;
        _clearValues(): void;
        _init(): void;
        _shouldCalculate(): boolean;
        _calculate(): void;
        private _rendering(sender, args);
        getCalculatedValues(key: string): any[];
    }
}

declare module wijmo.chart.finance.analytics {
    /**
     * Represents a Bollinger Bands&reg; overlay series for the @see:FinancialChart.
     *
     * <i>Bollinger Bands is a registered trademark of John Bollinger.</i>
     */
    class BollingerBands extends OverlayIndicatorBase {
        private _upperYVals;
        private _middleYVals;
        private _lowerYVals;
        private _xVals;
        private _period;
        private _multiplier;
        /**
         * Initializes a new instance of the @see:BollingerBands class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the period for the calculation as an integer value.
         */
        period: any;
        /**
         * Gets or sets the standard deviation multiplier.
         */
        multiplier: number;
        getDataRect(currentRect?: Rect, calculatedRect?: Rect): Rect;
        _clearValues(): void;
        _shouldCalculate(): boolean;
        _init(): void;
        _calculate(): void;
        private _rendering(sender, args);
        getCalculatedValues(key: string): any[];
    }
    function _bollingerBands(ys: number[], period: number, multiplier: number): any;
}

declare module wijmo.chart.finance.analytics {
    /**
     * Represents a Relative Strength Index indicator series for the @see:FinancialChart.
     *
     * Relative strength index is a momentum oscillator designed to measure the current
     * and historical strength or weakness of an asset based on the closing prices of a
     * recent trading period.
     */
    class RSI extends SingleOverlayIndicatorBase {
        /**
         * Initializes a new instance of the @see:RSI class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        _calculate(): void;
    }
    function _rsi(ys: number[], period: number): number[];
}

declare module wijmo.chart.finance.analytics {
    /**
     * Base class for @see:Macd and @see:MacdHistogram series (abstract).
     */
    class MacdBase extends OverlayIndicatorBase {
        _macdXVals: number[];
        _macdVals: number[];
        _signalXVals: number[];
        _signalVals: number[];
        _histogramXVals: number[];
        _histogramVals: number[];
        private _fastPeriod;
        private _slowPeriod;
        private _smoothingPeriod;
        /**
         * Initializes a new instance of the @see:MacdBase class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the fast exponential moving average period
         * for the MACD line.
         */
        fastPeriod: number;
        /**
         * Gets or sets the slow exponential moving average period
         * for the MACD line.
         */
        slowPeriod: number;
        /**
         * Gets or sets the exponential moving average period
         * for the signal line.
         */
        smoothingPeriod: number;
        _clearValues(): void;
        _shouldCalculate(): boolean;
        _init(): void;
        _calculate(): void;
    }
    /**
     * Represents a Moving Average Convergence/Divergence (MACD) indicator series
     * for the @see:FinancialChart.
     *
     * The MACD indicator is designed to reveal changes in strength, direction, momentum,
     * and duration of an asset's price trend.
     */
    class Macd extends MacdBase {
        /**
         * Initializes a new instance of the @see:Macd class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the styles for the MACD and Signal lines.
         *
         * The following options are supported:
         *
         * <pre>series.styles = {
         *   macdLine: {
         *      stroke: 'red',
         *      strokeWidth: 1
         *   },
         *   signalLine: {
         *      stroke: 'green',
         *      strokeWidth: 1
         *   },
         * }</pre>
         */
        styles: any;
        getDataRect(currentRect?: Rect, calculatedRect?: Rect): Rect;
        private _rendering(sender, args);
        getCalculatedValues(key: string): any[];
    }
    /**
     * Represents a Moving Average Convergence/Divergence (MACD) Histogram indicator series
     * for the @see:FinancialChart.
     *
     * The MACD indicator is designed to reveal changes in strength, direction, momentum,
     * and duration of an asset's price trend.
     */
    class MacdHistogram extends MacdBase {
        /**
         * Initializes a new instance of the @see:MacdHistogram class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        getValues(dim: number): number[];
        getDataRect(currentRect?: Rect, calculatedRect?: Rect): Rect;
        _getChartType(): ChartType;
        _getItem(pointIndex: number): any;
    }
    function _macd(ys: number[], fastPeriod: number, slowPeriod: number, smoothingPeriod: number): any;
}

declare module wijmo.chart.finance.analytics {
    /**
     * Represents a Stochastic Oscillator indicator series for the @see:FinancialChart.
     *
     * Stochastic oscillators are momentum indicators designed to predict price turning
     * points by comparing an asset's closing price to its high-low range.
     *
     * The @see:Stochastic series can be used for fast (default), slow and full stochastic
     * oscillators.  To create a slow or full stochastic oscillator, set the @see:smoothingPeriod
     * to an integer value greater than one; slow stochastic oscillators generally use a fixed
     * @see:smoothingPeriod of three.  To create or revert to a fast stochastic oscillator, set the
     * @see:smoothingPeriod to an integer value of one.
     */
    class Stochastic extends OverlayIndicatorBase {
        private _kVals;
        private _kXVals;
        private _dVals;
        private _dXVals;
        private _kPeriod;
        private _dPeriod;
        private _smoothingPeriod;
        /**
         * Initializes a new instance of the @see:Stochastic class.
         *
         * @param options JavaScript object containing initialization data for the object.
         */
        constructor(options?: any);
        /**
         * Gets or sets the period for the %K calculation.
         */
        kPeriod: number;
        /**
         * Gets or sets the period for the %D simple moving average.
         */
        dPeriod: number;
        /**
         * Gets or sets the smoothing period for full %K.
         */
        smoothingPeriod: number;
        /**
         * Gets or sets the styles for the %K and %D lines.
         *
         * The following options are supported:
         *
         * <pre>series.styles = {
         *   kLine: {
         *      stroke: 'red',
         *      strokeWidth: 1
         *   },
         *   dLine: {
         *      stroke: 'green',
         *      strokeWidth: 1
         *   },
         * }</pre>
         */
        styles: any;
        getDataRect(currentRect?: Rect, calculatedRect?: Rect): Rect;
        _clearValues(): void;
        _shouldCalculate(): boolean;
        _init(): void;
        _calculate(): void;
        private _rendering(sender, args);
        getCalculatedValues(key: string): any[];
    }
    function _stochastic(highs: number[], lows: number[], closes: number[], kPeriod: number, dPeriod: number, smoothingPeriod: number): any;
}


declare module wijmo.chart.finance.FinancialChart {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.FinancialChart type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): FinancialChart;
}
declare module wijmo.chart.finance.FinancialSeries {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.FinancialSeries type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): FinancialSeries;
}
declare module wijmo.chart.finance.analytics.SingleOverlayIndicatorBase {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.SingleOverlayIndicatorBase type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): SingleOverlayIndicatorBase;
}
declare module wijmo.chart.finance.analytics.ATR {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.ATR type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): ATR;
}
declare module wijmo.chart.finance.analytics.BollingerBands {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.BollingerBands type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): BollingerBands;
}
declare module wijmo.chart.finance.analytics.CCI {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.CCI type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): CCI;
}
declare module wijmo.chart.finance.analytics.Envelopes {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.Envelopes type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): Envelopes;
}
declare module wijmo.chart.finance.analytics.Fibonacci {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.Fibonacci type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): Fibonacci;
}
declare module wijmo.chart.finance.analytics.FibonacciArcs {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.FibonacciArcs type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): FibonacciArcs;
}
declare module wijmo.chart.finance.analytics.FibonacciFans {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.FibonacciFans type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): FibonacciFans;
}
declare module wijmo.chart.finance.analytics.FibonacciTimeZones {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.FibonacciTimeZones type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): FibonacciTimeZones;
}
declare module wijmo.chart.finance.analytics.Macd {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.Macd type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): Macd;
}
declare module wijmo.chart.finance.analytics.MacdBase {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.MacdBase type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): MacdBase;
}
declare module wijmo.chart.finance.analytics.MacdHistogram {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.MacdHistogram type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): MacdHistogram;
}
declare module wijmo.chart.finance.analytics.RSI {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.RSI type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): RSI;
}
declare module wijmo.chart.finance.analytics.Stochastic {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.Stochastic type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): Stochastic;
}
declare module wijmo.chart.finance.analytics.WilliamsR {
    /**
     * Casts the specified object to @see:wijmo.chart.finance.analytics.WilliamsR type.
     * @param obj The object to cast.
     * @return The object passed in.
     */
    function cast(obj: any): WilliamsR;
}
