UNPKG

@lightningchart/lcjs-trader

Version:

LightningChart JS Trader is a library for creating interactive and impressive technical analysis applications with top performance.

1,554 lines (1,553 loc) 583 kB
import { Axis } from '@lightningchart/lcjs'; import { ChartXY } from '@lightningchart/lcjs'; import { ChartXYUserInteractions } from '@lightningchart/lcjs'; import { Color } from '@lightningchart/lcjs'; import { LightningChart } from '@lightningchart/lcjs'; import { LightningChartOptions } from '@lightningchart/lcjs'; import { LUTStep } from '@lightningchart/lcjs'; import { Point } from '@lightningchart/lcjs'; import { PointLineAreaSeries } from '@lightningchart/lcjs'; import { RectangleSeries } from '@lightningchart/lcjs'; import { SeriesXY } from '@lightningchart/lcjs'; import { Theme } from '@lightningchart/lcjs'; import { UIBackground } from '@lightningchart/lcjs'; import { XOHLC } from '@lightningchart/lcjs'; /** * Accumulation/Distribution indicator (A/D) shows whether a stock is being accumulated or distributed. It uses both price and volume information. * @public */ export declare class AccumulationDistribution extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _ad; private _yMarker; private _titleText; private _settingsMenu; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _adValues; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, closeValues: number[], highValues: number[], lowValues: number[], volumes: number[], lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Accumulative Swing Index (ASI) is a trend line measuring long-term trends in prices. ASI is the cumulative sum of the Swing Index. * Shows also the Swing Index in a separate segment. * @public */ export declare class AccumulativeSwingIndex extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _asi; private _yMarker; private _titleText; private _settingsMenu; private _limitMoveInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _asiValues; private _lineColor; private _lineWidth; private _limitMoveValue; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the maximum price change in one direction. * @public * @param limitMoveValue - Maximum price change. */ setLimitMoveValue(limitMoveValue: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * The Aroon indicator identifies trend changes in the price. It also reveals the strength of that trend. * Consists of two lines: Aroon Up measuring the uptrend strength and Aroon Down measuring the downtrend strength. * @public */ export declare class Aroon extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _aroonUp; private _aroonDown; private _yMarkerUp; private _yMarkerDown; private _titleText; private _settingsMenu; private _periodInput; private _widthInput; private _colorUpInput; private _colorUpHidden; private _colorDownInput; private _colorDownHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _aroonValues; private _periodCount; private _lineColorUp; private _lineColorDown; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, highValues: number[], lowValues: number[], periodCount: number, lineColorUp: Color, lineColorDown: Color, lineWidth: number, rowIndex: number); /** * Sets the number of time periods (n) used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the color of the Aroon Up line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setAroonUpLineColor(newColor: string): void; /** * Sets the color of the Aroon Down line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setAroonDownLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Aroon Oscillator measures the difference between Aroon-Up and Aroon-Down indicators, which measures uptrend strength and downtrend strength respectively. * @public */ export declare class AroonOscillator extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _ao; private _yMarker; private _titleText; private _settingsMenu; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _aoValues; private _periodCount; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, highValues: number[], lowValues: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the number of time periods (n) used to calculate Aroon-Up and Aroon-Down indicators. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Draws an arrow pointing to one of the four directions (up, down, left, right). Can be freely positioned anywhere on the chart. * Arrow color depends on the selected direction, though it can be freely modified after the direction has been set. * @public */ export declare class Arrow extends DrawingToolBase { private _priceChart; private _chart; private _arrowSeries; private _arrow; private _arrowPosition; private _arrowType; private _blockUpdate; private _arrowColor; private _arrowWidth; private _arrowHeight; private _marker; private _settingsMenu; private _typeInput; private _widthInput; private _heightInput; private _colorInput; private _colorHidden; private _drawingToolMovedDispatcher; private _drawingToolMovedHandler; constructor(priceChart: TradingChart, chart: ChartXY, arrowPosition: Point, arrowType: ArrowType); /** * Updates the arrow based on the given position. * @public * @param point - Arrow position. */ updatePosition(point?: Point): void; /** * Sets the arrow type (direction). * @public * @param arrowType - New arrow type. */ setArrowType(arrowType: ArrowType): void; /** * Sets the color of the arrow. * @public * @param newColor - New arrow color as string, should be in HEX format e.g. #FFFFFF. */ setArrowColor(newColor: string): void; /** * Sets the size of the arrow in pixels. * @public * @param newWidth - New arrow width. * @param newHeight - New arrow height. */ setArrowSize(newWidth: number, newHeight: number): void; /** * Event that triggers when drawing tool's position has been changed either by dragging it or in code. * @public * @param handler - Event handler containing 'xPosition' and 'yPosition' parameters indicating the new position of the Arrow. */ onDrawingToolMoved(handler: Handler_2<DrawingToolMovedEvent>): void; /** * Unsubscribes from the DrawingToolMoved event. * @public */ offDrawingToolMoved(): void; /** * Disposes the drawing tool. * @public */ dispose(): void; } /** * Arrow Drawing Tool type. * @public */ export declare enum ArrowType { /** * Arrow pointing up. */ UpArrow = 0, /** * Arrow pointing down. */ DownArrow = 1, /** * Arrow pointing left. */ LeftArrow = 2, /** * Arrow pointing right. */ RightArrow = 3 } /** * Average Directional Index (ADX) measures the overall strength of a trend by calculating the average of expanding price range values. * Directional Movement Indicators (-DI and +DI) can be shown together with the ADX line. The indicator uses Wilder's smoothing techniques. * @public */ export declare class AverageDirectionalIndex extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _adx; private _diMinus; private _diPlus; private _yMarker; private _yMarkerP; private _yMarkerM; private _titleText; private _settingsMenu; private _periodInput; private _showDIsInput; private _widthInput; private _colorInput; private _colorHidden; private _diMinusColorInput; private _diMinusHidden; private _diPlusColorInput; private _diPlusHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _adxValues; private _periodCount; private _showDiLines; private _lineColor; private _diMinusColor; private _diPlusColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, closeValues: number[], highValues: number[], lowValues: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the number of time periods (n) used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the ADX line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line color of the -DI line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setDiMinusColor(newColor: string): void; /** * Sets the line color of the +DI line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setDiPlusColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Control whether -DI and +DI lines should be displayed. * @public * @param showDiLines - Set true to show DI lines. */ showDiLines(showDiLines: boolean): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Average True Range measures market volatility by calculating the average of true ranges over a given time range. * @public */ export declare class AverageTrueRange extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _atr; private _yMarker; private _titleText; private _settingsMenu; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _atrValues; private _periodCount; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, closeValues: number[], highValues: number[], lowValues: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the number of time periods (n) used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Awesome Oscillator (AO) provides information about the strength of the stock and possible reversals. * It compares recent momentum with the momentum over a longer time frame. * @public */ export declare class AwesomeOscillator extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _ao; private _yMarker; private _titleText; private _settingsMenu; private _periodInputLong; private _periodInputShort; private _colorInputUp; private _colorUpHidden; private _colorInputDown; private _colorDownHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _aoValues; private _periodCountShort; private _periodCountLong; private _barColorUp; private _barColorDown; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, highValues: number[], lowValues: number[], rowIndex: number); /** * Sets the number of short-term and long-term time periods used to calculate the indicator. * @public * @param shortPeriods - Short-term period count. * @param longPeriods - Long-term period count */ setPeriodCounts(shortPeriods: number, longPeriods: number): void; /** * Sets the colors of the bars. * @public * @param colorUp - The color of the bar, when its value is higher that the previous bar. * @param colorDown - The color of the bar, when its value is lower that the previous bar. */ setBarColors(colorUp: string, colorDown: string): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Axis mouse interaction options. * @public */ export declare enum AxisInteraction { /** * Dragging the axis causes it to stretch/contract. */ DragZoom = 0, /** * Pans the chart. */ Pan = 1, /** * Draws a rectangle signifying the zooming area. */ RectangleZoom = 2, /** * Zooms in /out while keeping the axis end value visible. */ ZoomToEnd = 3, /** * Interaction is disabled. */ Off = 4 } /** * Balance of Power (BOP) indicates how strongly the price moves towards higher or lower extremes * by measuring the strength of buying and selling pressures. * @public */ export declare class BalanceOfPower extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _bop; private _yMarker; private _titleText; private _settingsMenu; private _maTypeInput; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _bopValues; private _periodCount; private _movingAverageType; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the type of Moving Average used to smooth the indicator. * @public * @param movingAverageType - Moving Average type. */ setMovingAverageType(movingAverageType: MovingAverageType): void; /** * Sets the number of time periods (n) used to smooth the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * To select which values the special chart (Renko, Kagi etc.) is based on. * @public */ export declare enum BaseType { /** * The chart is based on Close values. */ Close = 0, /** * The chart is based on High-Low range. */ HighLowRange = 1, /** * The chart is formed using a set percentage of the first price. */ Percentage = 2, /** * The chart is based on Average True Range (ATR). Using ATR results in fluctuating box size/reversal amount. */ ATR = 3 } /** * Bollinger Band calculates a moving average line and then adds two more lines, one above and one below, * based on a set number of standard deviation levels. * @public */ export declare class BollingerBand extends IndicatorBase { private _priceChart; private _chart; private _movingAverage; private _bollingerBand; private _midValues; private _upperValues; private _lowerValues; private _periodCount; private _numberOfStandardDeviations; private _source; private _currentSource; private _sourceTypes; private _lineColor; private _lineWidth; private _fillColor; private _fillEnabled; private _visible; private _settingsMenu; private _sourceInput; private _periodInput; private _stDevInput; private _widthInput; private _colorInput; private _colorHidden; private _areaInput; private _areaHidden; private _fillInput; private _offsetInput; private _visibleInput; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], periodCount: number, numberOfStandardDeviations: number, lineColor: Color, lineWidth: number, fillColor: Color); /** * Sets which values the indicator calculations are based on. * @public * @param source - Values to base the calculations on. */ setSource(source: Source): void; /** * Sets the number of time periods (n) used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the number of standard deviations between the moving average line and the upper and the lower bands. Default value 2. * @public * @param standardDeviationNumber - New number of standard deviations. */ setStandardDeviationNumber(standardDeviationNumber: number): void; /** * Sets the color of all the indicator lines. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the width of all the indicator lines. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Sets whether the area between the upper and lower bands should be colored. Use setFillColor() -method to modify the fill color. * @public * @param fillEnabled - Set true to enable coloring. */ setFillEnabled(fillEnabled: boolean): void; /** * Sets the fill color of the Bollinger Band area. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setFillColor(newColor: string): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Center fo Gravity (COG) is designed to anticipate future price movements. Since it has no lag, it can give clear signals of turning points in the price. * A Simple Moving Average can be displayed as a signal line. * @public */ export declare class CenterOfGravity extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cog; private _signal; private _yMarker; private _yMarkerSignal; private _titleText; private _settingsMenu; private _sourceInput; private _periodInput; private _signalPeriodInput; private _showSignalInput; private _widthInput; private _cogInput; private _cogHidden; private _signalInput; private _signalHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _cogValues; private _periodCount; private _signalPeriodCount; private _showSignal; private _source; private _currentSource; private _sourceTypes; private _lineColor; private _signalColor; private _lineWidth; private _visible; private _created; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets which values the indicator calculations are based on. * @public * @param source - Values to base the calculations on. */ setSource(source: Source): void; /** * Sets the number of time periods (n) used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the number of time periods (n) used to calculate the signal line. * @public * @param newPeriodCount - New period count. */ setSignalPeriodCount(newPeriodCount: number): void; /** * Sets whether the signal line should be visible or not. * @public * @param showSignal - Set true to show the signal line. */ setShowSignal(showSignal: boolean): void; /** * Sets the color of the Center of Gravity line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the color of the Signal line. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setSignalColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Chaikin Money Flow calculates a Volume-weighted average based on Accumulation-Distribution (A/D) line. * @public */ export declare class ChaikinMoneyFlow extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cmf; private _zeroLine; private _yMarker; private _titleText; private _settingsMenu; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _cmfValues; private _periodCount; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, closeValues: number[], highValues: number[], lowValues: number[], volumes: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the number of time periods used to calculate the indicator. * @public * @param periodCount - New period count. */ setPeriodCount(periodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Chaikin Oscillator calculates Moving Average Convergence-Divergence (MACD) based on Accumulation-Distribution (A/D) line. * It is used to detect trends and reversals. * @public */ export declare class ChaikinOscillator extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _co; private _zeroLine; private _yMarker; private _titleText; private _settingsMenu; private _fastPeriodInput; private _slowPeriodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _coValues; private _fastPeriodCount; private _slowPeriodCount; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, closeValues: number[], highValues: number[], lowValues: number[], volumes: number[], fastPeriodCount: number, slowPeriodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the number of fast and slow time periods used to calculate the indicator. * @public * @param fastPeriodCount - New fast period count. * @param slowPeriodCount - New slow period count. */ setPeriodCounts(fastPeriodCount: number, slowPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Chaikin Volatility (CV) measures security's price volatility by comparing the range between High and Low values over a set period of time. * @public */ export declare class ChaikinVolatility extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cv; private _yMarker; private _titleText; private _settingsMenu; private _maTypeInput; private _periodInput; private _periodInputMA; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _cvValues; private _periodCount; private _periodCountMA; private _movingAverageType; private _lineColor; private _lineWidth; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, highValues: number[], lowValues: number[], lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets the type of Moving Average used in Chaikin Volatility calculations. * @public * @param movingAverageType - Moving Average type. */ setMovingAverageType(movingAverageType: MovingAverageType): void; /** * Sets the number of time periods (n) used to calculate the indicator. Allows setting different period count for the indicator * and for the moving average used in calculations. * @public * @param newPeriodCount - The number of time periods in the Chaikin Volatility calculation, set to 10 periods by default. * @param newPeriodCountMA - The number of time periods for the moving average used in Chaikin Volatility calculations. */ setPeriodCounts(newPeriodCount: number, newPeriodCountMA: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Chande Forecast Oscillator (CFO) measures the difference between the closing price and the forecasted price of a n-period linear regression. * The result is shown as a percentage. * @public */ export declare class ChandeForecastOscillator extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cfo; private _zeroLine; private _yMarker; private _titleText; private _settingsMenu; private _sourceInput; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _cfoValues; private _periodCount; private _source; private _currentSource; private _sourceTypes; private _lineColor; private _lineWidth; private _visible; private _created; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets which values the indicator calculations are based on. * @public * @param source - Values to base the calculations on. */ setSource(source: Source): void; /** * Sets the number of time periods used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Chande Momentum Oscillator is used to identify the relative strength or weakness of the market. * @public */ export declare class ChandeMomentumOscillator extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cmo; private _zeroLine; private _yMarker; private _titleText; private _settingsMenu; private _sourceInput; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _cmoValues; private _periodCount; private _source; private _currentSource; private _sourceTypes; private _lineColor; private _lineWidth; private _visible; private _created; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], periodCount: number, lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets which values the indicator calculations are based on. * @public * @param source - Values to base the calculations on. */ setSource(source: Source): void; /** * Sets the number of time periods used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Options used when creating TradingChart. * @public */ declare interface ChartOptions { /** * Parent HTML-element for the chart. */ parentElement?: HTMLElement; /** * Sets whether previous chart settings should be loaded from local storage. */ loadFromStorage?: boolean; /** * Determines on which side the price axis (Y-axis) is located. Default side is right (true). * * Note that loading from local storage overrides this setting. Therefore, this option works only if loadFromStorage is set false. * * ```typescript * tradingChart({axisOnRight: false, loadFromStorage: false}) * ``` */ axisOnRight?: boolean; /** * Color theme of the chart. * * Note that loading from local storage overrides this setting. Therefore, this option works only if loadFromStorage is set false. * * ```typescript * tradingChart({colorTheme: Themes.darkGold, loadFromStorage: false}) * ``` */ colorTheme?: Theme; /** * Optional HTML-canvas element which LightningChart can use for rendering. */ canvas?: HTMLCanvasElement; /** * Optional LightningChart instance that can be used to create charts. */ lightningChart?: LightningChart; /** * Controls whether the chart uses html or WebGL for text rendering. * Html texts are generally more visually appealing but may cause small decrease in performance especially when using large datasets. * Html texts are enabled by default. */ htmlTextRendering?: boolean; } /** * Commodity Channel Index (CCI) is designed to spot new trends and weaknesses in them, as well as to watch overbought and oversold levels. * @public */ export declare class CommodityChannelIndex extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cci; private _band; private _yMarker; private _titleText; private _settingsMenu; private _periodInput; private _widthInput; private _colorInput; private _colorHidden; private _overboughtInput; private _oversoldInput; private _fillInput; private _fillHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _cciValues; private _periodCount; private _lineColor; private _lineWidth; private _overboughtLevel; private _oversoldLevel; private _fillColor; private _visible; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, closeValues: number[], highValues: number[], lowValues: number[], periodCount: number, lineColor: Color, lineWidth: number, fillColor: Color, rowIndex: number); /** * Sets the number of time periods (n) used to calculate the indicator. * @public * @param newPeriodCount - New period count. */ setPeriodCount(newPeriodCount: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void; /** * Sets the line width of the indicator. * @public * @param newWidth - New line width. */ setLineWidth(newWidth: number): void; /** * Sets the overbought and oversold levels. * @public * @param overboughtLevel - Overbought level. * @param oversoldLevel - Oversold level. */ setOverboughtAndSoldLevels(overboughtLevel: number, oversoldLevel: number): void; /** * Sets the color of the area between overbought and oversold levels. * @public * @param newColor - New fill color as string, should be in HEX format e.g. #FFFFFF. */ setFillColor(newColor: string): void; /** * Moves the indicator from its calculated position forward or backward. * @public * @param newOffset - New offset value. */ setOffset(newOffset: number): void; /** * Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator. * @public * @param visible - Visibility of the indicator. */ setVisible(visible: boolean): void; /** * Programmatically opens the indicator settings menu. * @public */ showMenu(): void; /** * Disposes the indicator. * @public */ dispose(): void; } /** * Coppock Curve is a price momentum indicator that is used to identify long-term buy and sell signals. * Long and short Rate of Change values and Weighted Moving Average are used in the calculations. * @public */ export declare class CoppockCurve extends IndicatorBase { private _priceChart; private _chart; private _yAxis; private _splitter; private _splitterInvis; private _cc; private _yMarker; private _titleText; private _settingsMenu; private _sourceInput; private _periodInputLong; private _periodInputShort; private _periodInputWMA; private _widthInput; private _colorInput; private _colorHidden; private _offsetInput; private _visibleInput; private _settingsButton; private _deleteButton; private _ccValues; private _periodCountROCLong; private _periodCountROCShort; private _periodCountWMA; private _source; private _currentSource; private _sourceTypes; private _lineColor; private _lineWidth; private _visible; private _created; private _rowIndex; constructor(priceChart: TradingChart, chart: ChartXY, openValues: number[], highValues: number[], lowValues: number[], closeValues: number[], lineColor: Color, lineWidth: number, rowIndex: number); /** * Sets which values the indicator calculations are based on. * @public * @param source - Values to base the calculations on. */ setSource(source: Source): void; /** * Sets the period counts for long Rate of Change, short Rate of Change, and Weighted Moving Average. * @public * @param periodCountLongROC - Period count for long Rate of Change. * @param periodCountShortROC - Period count for short Rate of Change. * @param periodCountWMA - Period count for Weighted Moving Average. */ setPeriodCounts(periodCountLongROC: number, periodCountShortROC: number, periodCountWMA: number): void; /** * Sets the line color of the indicator. * @public * @param newColor - New line color as string, should be in HEX format e.g. #FFFFFF. */ setLineColor(newColor: string): void;