This repository has been archived by the owner on Mar 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wijmo.chart.finance.d.ts
executable file
·215 lines (215 loc) · 8.51 KB
/
wijmo.chart.finance.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
import * as wjcCore from 'wijmo/wijmo';
import * as wjcChart from 'wijmo/wijmo.chart';
export declare function _trunc(value: number): number;
export declare function _sum(...values: number[]): number;
export declare function _sum(values: number[]): number;
export declare function _average(...values: number[]): number;
export declare function _average(values: number[]): number;
export declare function _minimum(...values: number[]): number;
export declare function _minimum(values: number[]): number;
export declare function _maximum(...values: number[]): number;
export declare function _maximum(values: number[]): number;
export declare function _variance(...values: number[]): number;
export declare function _variance(values: number[]): number;
export declare function _stdDeviation(...values: number[]): number;
export declare function _stdDeviation(values: number[]): number;
export declare function _avgTrueRng(highs: number[], lows: number[], closes: number[], period?: number): number[];
export declare function _trueRng(highs: number[], lows: number[], closes: number[], period?: number): number[];
export declare function _sma(values: number[], period: number): number[];
export declare function _ema(values: number[], period: number): number[];
export declare function _range(begin: number, end: number, step?: number): number[];
export declare enum FinancialChartType {
Column = 0,
Scatter = 1,
Line = 2,
LineSymbols = 3,
Area = 4,
Candlestick = 5,
HighLowOpenClose = 6,
HeikinAshi = 7,
LineBreak = 8,
Renko = 9,
Kagi = 10,
ColumnVolume = 11,
EquiVolume = 12,
CandleVolume = 13,
ArmsCandleVolume = 14,
PointAndFigure = 15,
}
export declare class FinancialChart extends wjcChart.FlexChartCore {
private _chartType;
private __heikinAshiPlotter;
private __lineBreakPlotter;
private __renkoPlotter;
private __kagiPlotter;
private __pfPlotter;
constructor(element: any, options?: any);
chartType: FinancialChartType;
options: any;
private readonly _heikinAshiPlotter;
private readonly _lineBreakPlotter;
private readonly _renkoPlotter;
private readonly _kagiPlotter;
private readonly _pfPlotter;
_getChartType(): wjcChart.ChartType;
_getPlotter(series: FinancialSeries): wjcChart._IPlotter;
_createSeries(): wjcChart.SeriesBase;
}
export declare class FinancialSeries extends wjcChart.SeriesBase {
private _finChartType;
chartType: FinancialChartType;
_getChartType(): wjcChart.ChartType;
}
export interface _IFinanceItem {
high: number;
low: number;
open: number;
close: number;
x: number;
pointIndex: number;
}
export interface _IFinancialCalculator {
highs: number[];
lows: number[];
opens: number[];
closes: number[];
xs?: number[];
size?: number;
unit?: RangeMode;
fields?: DataFields;
calculate(): any;
}
export declare class _BaseCalculator implements _IFinancialCalculator {
highs: number[];
lows: number[];
opens: number[];
closes: number[];
constructor(highs: number[], lows: number[], opens: number[], closes: number[]);
calculate(): any;
}
export declare class _HeikinAshiCalculator extends _BaseCalculator {
constructor(highs: number[], lows: number[], opens: number[], closes: number[]);
calculate(): _IFinanceItem[];
}
export declare 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;
}
export declare class _LineBreakCalculator extends _BaseRangeCalculator {
constructor(highs: number[], lows: number[], opens: number[], closes: number[], xs: number[], size: number);
calculate(): _IFinanceItem[];
private _trendExists(vals);
}
export declare class _KagiCalculator extends _BaseRangeCalculator {
constructor(highs: number[], lows: number[], opens: number[], closes: number[], xs: number[], size: number, unit: RangeMode, field: DataFields);
calculate(): _IFinanceItem[];
}
export declare 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;
}
export declare class _HeikinAshiPlotter extends wjcChart._FinancePlotter {
private _haValues;
private _calculator;
private _symFactor;
constructor();
clear(): void;
plotSeries(engine: wjcChart.IRenderEngine, ax: wjcChart._IAxis, ay: wjcChart._IAxis, series: FinancialSeries, palette: wjcChart._IPalette, iser: number, nser: number): void;
_drawSymbol(engine: wjcChart.IRenderEngine, ax: wjcChart._IAxis, ay: wjcChart._IAxis, si: number, pi: number, fill: any, w: number, x: number, hi: number, lo: number, open: number, close: number, dpt?: wjcChart._DataPoint, dt?: wjcCore.DataType): void;
_getDataPoint(seriesIndex: number, pointIndex: number, x: any, series: wjcChart.SeriesBase): wjcChart._DataPoint;
private _calculate(series);
private _init();
}
export declare class _BaseRangePlotter extends wjcChart._BasePlotter {
private _symFactor;
_calculator: _BaseRangeCalculator;
_rangeValues: _IFinanceItem[];
_rangeXLabels: any[];
constructor();
clear(): void;
unload(): void;
adjustLimits(dataInfo: wjcChart._DataInfo, plotRect: wjcCore.Rect): wjcCore.Rect;
plotSeries(engine: wjcChart.IRenderEngine, ax: wjcChart._IAxis, ay: wjcChart._IAxis, series: FinancialSeries, palette: wjcChart._IPalette, iser: number, nser: number): void;
_drawSymbol(engine: wjcChart.IRenderEngine, ax: wjcChart._IAxis, ay: wjcChart._IAxis, si: number, pi: number, w: number, x: number, start: number, end: number, dpt: wjcChart._DataPoint): void;
_getDataPoint(seriesIndex: number, pointIndex: number, series: wjcChart.SeriesBase, dataY: number): wjcChart._DataPoint;
_init(): void;
_calculate(series: FinancialSeries): void;
_generateXLabels(series: FinancialSeries): void;
}
export declare enum DataFields {
Close = 0,
High = 1,
Low = 2,
Open = 3,
HighLow = 4,
HL2 = 5,
HLC3 = 6,
HLOC4 = 7,
}
export declare enum RangeMode {
Fixed = 0,
ATR = 1,
Percentage = 2,
}
export declare class _LineBreakPlotter extends _BaseRangePlotter {
private _newLineBreaks;
constructor();
clear(): void;
_calculate(series: FinancialSeries): void;
_init(): void;
}
export declare 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;
}
export declare class _KagiPlotter extends _BaseRangePlotter {
private _reversalAmount;
private _rangeMode;
private _fields;
constructor();
_calculate(series: FinancialSeries): void;
plotSeries(engine: wjcChart.IRenderEngine, ax: wjcChart._IAxis, ay: wjcChart._IAxis, series: FinancialSeries, palette: wjcChart._IPalette, iser: number, nser: number): void;
_init(): void;
clear(): void;
}
export declare enum PointAndFigureScaling {
Traditional = 0,
Fixed = 1,
Dynamic = 2,
}
export declare class _PointAndFigurePlotter extends wjcChart._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: wjcChart._DataInfo, plotRect: wjcCore.Rect): wjcCore.Rect;
plotSeries(engine: wjcChart.IRenderEngine, ax: wjcChart._IAxis, ay: wjcChart._IAxis, series: FinancialSeries, palette: wjcChart._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);
}