@guihz/trading-vue-editor-tes 0.0.302 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/editor.worker-BxEYBjj-.js +7352 -0
- package/lib/assets/parserTccWorker-D5cq4N-Y.js +80540 -0
- package/lib/assets/scriptsRunWorker-CaEvEpNA.js +37748 -0
- package/lib/components/diffEditor/index.d.ts +1 -0
- package/lib/components/editor/config/monarchTokens.d.ts +2 -4
- package/lib/components/editor/constants/common.d.ts +38 -0
- package/lib/components/editor/constants/locals.d.ts +1 -0
- package/lib/components/editor/index.d.ts +1 -0
- package/lib/components/editor/tokenizer/utils.d.ts +0 -16
- package/lib/components/editor/type/index.d.ts +32 -1
- package/lib/components/editor/utils/completions.d.ts +3 -1
- package/lib/components/editor/utils/importLibrary.d.ts +2 -160
- package/lib/components/editor/utils/initEditor.d.ts +3 -0
- package/lib/components/editor/utils/parse.d.ts +2 -0
- package/lib/components/editor/utils/parserTccWorker.d.ts +1 -7
- package/lib/components/editor/utils/scriptsRunWorker.d.ts +1 -1
- package/lib/components/editor/utils/signatureHelp.d.ts +2 -0
- package/lib/components/editor/utils/tools.d.ts +6 -0
- package/lib/components/editor/v3/config/monarchTokens.d.ts +3 -0
- package/lib/components/editor/v3/constants/contents_zh.d.ts +6 -0
- package/lib/components/editor/{constants/contents.d.ts → v3/constants/index.d.ts} +1 -5
- package/lib/components/editor/v3/parseScript/buildInConstants.d.ts +179 -0
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/index.d.ts +9 -0
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/input.d.ts +43 -0
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/math.d.ts +50 -0
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/strategy.d.ts +243 -0
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/ta.d.ts +102 -0
- package/lib/components/editor/{parseScript → v3/parseScript}/buildInFuncNamespace/timeframe.d.ts +1 -1
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/barstate.d.ts +19 -0
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/index.d.ts +4 -0
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/strategy.d.ts +126 -0
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/syminfo.d.ts +22 -0
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/ta.d.ts +17 -0
- package/lib/components/editor/v3/parseScript/buildInVariables.d.ts +96 -0
- package/lib/components/editor/v3/parseScript/constants.d.ts +119 -0
- package/lib/components/editor/v3/parseScript/enum.d.ts +283 -0
- package/lib/components/editor/v3/parseScript/parseToJs.d.ts +65 -0
- package/lib/components/editor/v3/parseScript/runType.d.ts +119 -0
- package/lib/components/editor/v3/parseScript/strategyNamespace/index.d.ts +2 -0
- package/lib/components/editor/{parseScript → v3/parseScript}/type.d.ts +1 -1
- package/lib/components/editor/v3/parseScript/utils.d.ts +21 -0
- package/lib/components/editor/v3/parseScript/visitorParser.d.ts +321 -0
- package/lib/components/editor/v3/parseScript/visitorUtils.d.ts +25 -0
- package/lib/components/editor/v3/parserTccWorker.d.ts +32 -0
- package/lib/components/editor/v3/scriptsRunWorker.d.ts +11 -0
- package/lib/{tccParser → components/editor/v3/tccParser}/LexerBase.d.ts +1 -1
- package/lib/components/editor/v3/tccParser/tccScriptParserVisitor.d.ts +359 -0
- package/lib/components/editor/v4/config/monarchTokens.d.ts +205 -0
- package/lib/components/editor/v4/constants/contents_zh.d.ts +6 -0
- package/lib/components/editor/v4/constants/index.d.ts +44 -0
- package/lib/components/editor/v4/parseScript/buildInConstants.d.ts +308 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/array.d.ts +84 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/box.d.ts +60 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/errorListener.d.ts +9 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/index.d.ts +17 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/input.d.ts +44 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/label.d.ts +61 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/line.d.ts +62 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/math.d.ts +50 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/strategy.d.ts +244 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/string.d.ts +38 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/ta.d.ts +118 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/table.d.ts +87 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/timeframe.d.ts +22 -0
- package/lib/components/editor/{parseScript → v4/parseScript}/buildInVarNamespace/barstate.d.ts +1 -1
- package/lib/components/editor/v4/parseScript/buildInVarNamespace/index.d.ts +8 -0
- package/lib/components/editor/v4/parseScript/buildInVarNamespace/strategy.d.ts +126 -0
- package/lib/components/editor/v4/parseScript/buildInVarNamespace/syminfo.d.ts +18 -0
- package/lib/components/editor/v4/parseScript/buildInVarNamespace/ta.d.ts +34 -0
- package/lib/components/editor/{parseScript → v4/parseScript}/constants.d.ts +1 -160
- package/lib/components/editor/v4/parseScript/constantsRun.d.ts +3 -0
- package/lib/components/editor/v4/parseScript/enum.d.ts +282 -0
- package/lib/components/editor/v4/parseScript/parseToJs.d.ts +65 -0
- package/lib/components/editor/v4/parseScript/strategyNamespace/index.d.ts +2 -0
- package/lib/components/editor/v4/parseScript/strategyNamespace/risk.d.ts +22 -0
- package/lib/components/editor/v4/parseScript/type.d.ts +39 -0
- package/lib/components/editor/v4/parseScript/utils.d.ts +21 -0
- package/lib/components/editor/v4/parseScript/visitorParser.d.ts +323 -0
- package/lib/components/editor/v4/parseScript/visitorUtils.d.ts +29 -0
- package/lib/components/editor/v4/parserTccWorker.d.ts +32 -0
- package/lib/components/editor/v4/scriptsRunWorker.d.ts +11 -0
- package/lib/components/editor/v4/tccParser/LexerBase.d.ts +19 -0
- package/lib/components/editor/v4/tccParser/tccScriptParserVisitor.d.ts +401 -0
- package/lib/components/editor/v5/config/monarchTokens.d.ts +205 -0
- package/lib/components/editor/v5/constants/contents_en.d.ts +6 -0
- package/lib/components/editor/{constants → v5/constants}/contents_zh.d.ts +1 -1
- package/lib/components/editor/v5/constants/index.d.ts +41 -0
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/box.d.ts +1 -1
- package/lib/components/editor/v5/parseScript/buildInFuncNamespace/color.d.ts +25 -0
- package/lib/components/editor/v5/parseScript/buildInFuncNamespace/errorListener.d.ts +9 -0
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/label.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/line.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/linefill.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/log.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/map.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/math.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/polyline.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/strategy.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/ta.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/table.d.ts +1 -1
- package/lib/components/editor/v5/parseScript/buildInFuncNamespace/timeframe.d.ts +22 -0
- package/lib/components/editor/v5/parseScript/buildInVarNamespace/barstate.d.ts +22 -0
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInVarNamespace/chart.d.ts +1 -1
- package/lib/components/editor/v5/parseScript/buildInVarNamespace/dividends.d.ts +8 -0
- package/lib/components/editor/v5/parseScript/buildInVarNamespace/earnings.d.ts +9 -0
- package/lib/components/editor/v5/parseScript/buildInVarNamespace/session.d.ts +12 -0
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInVarNamespace/strategy.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInVarNamespace/syminfo.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/buildInVarNamespace/ta.d.ts +4 -3
- package/lib/components/editor/v5/parseScript/buildInVarNamespace/timeframe.d.ts +16 -0
- package/lib/components/editor/v5/parseScript/constants.d.ts +124 -0
- package/lib/components/editor/v5/parseScript/constantsRun.d.ts +3 -0
- package/lib/components/editor/{parseScript → v5/parseScript}/parseToJs.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/parseToLibJs.d.ts +1 -1
- package/lib/components/editor/v5/parseScript/strategyNamespace/risk.d.ts +22 -0
- package/lib/components/editor/v5/parseScript/type.d.ts +39 -0
- package/lib/components/editor/{parseScript → v5/parseScript}/userTypeClass.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/utils.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/visitorParser.d.ts +1 -1
- package/lib/components/editor/{parseScript → v5/parseScript}/visitorUtils.d.ts +2 -2
- package/lib/components/editor/v5/parserTccWorker.d.ts +40 -0
- package/lib/components/editor/v5/scriptsRunWorker.d.ts +11 -0
- package/lib/components/editor/v5/tccParser/LexerBase.d.ts +19 -0
- package/lib/{tccParser → components/editor/v5/tccParser}/tccScriptParserVisitor.d.ts +1 -1
- package/lib/components/referenceManual/components/ContentItem.d.ts +2 -0
- package/lib/components/referenceManual/index.d.ts +2 -0
- package/lib/components/referenceManualPage/components/ContentItem.d.ts +1 -0
- package/lib/components/referenceManualPage/components/ManualLeft.d.ts +5 -0
- package/lib/components/referenceManualPage/index.d.ts +2 -0
- package/lib/index-Ce2gRdFk.js +12813 -0
- package/lib/index-CjECfhIW.js +28088 -0
- package/lib/index-UdtfRBFV.js +59792 -0
- package/lib/monarchTokens-Cj3v8l0Q.js +526 -0
- package/lib/monarchTokens-CnFYyHnR.js +191 -0
- package/lib/monarchTokens-oh3fO2YY.js +563 -0
- package/lib/packages/index.d.ts +3 -3
- package/lib/trading-vue-editor.es.packages.js +6356 -66629
- package/lib/trading-vue-editor.umd.packages.mjs +117 -75
- package/lib/utils/tools.d.ts +7 -2
- package/package.json +1 -1
- package/lib/assets/editor.worker-CT5Cb1wO.js +0 -11
- package/lib/assets/parserTccWorker-cjv11J0f.js +0 -279
- package/lib/assets/scriptsRunWorker-ISxcgzMz.js +0 -91
- /package/lib/components/editor/{parseScript → v3/parseScript}/buildInFuncNamespace/errorListener.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v3/parseScript}/constantsRun.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v3/parseScript}/strategyNamespace/risk.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v4/parseScript}/buildInFuncNamespace/color.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v4/parseScript}/buildInVarNamespace/dividends.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v4/parseScript}/buildInVarNamespace/earnings.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v4/parseScript}/buildInVarNamespace/session.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v4/parseScript}/buildInVarNamespace/timeframe.d.ts +0 -0
- /package/lib/components/editor/{constants → v5/constants}/newContents_en.d.ts +0 -0
- /package/lib/components/editor/{constants → v5/constants}/newContents_zh.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInConstants.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/array.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/chartPoint.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/index.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/input.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/matrix.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/runtime.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/string.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInFuncNamespace/syminfo.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/buildInVarNamespace/index.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/enum.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/strategyNamespace/closedtrades.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/strategyNamespace/index.d.ts +0 -0
- /package/lib/components/editor/{parseScript → v5/parseScript}/strategyNamespace/opentrades.d.ts +0 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../../type";
|
2
|
+
import { BuildInTimeframe } from '../buildInFuncNamespace/index';
|
3
|
+
export declare class Ta {
|
4
|
+
private _preAccdist;
|
5
|
+
private _preNvi;
|
6
|
+
private _prePvi;
|
7
|
+
private _preObv;
|
8
|
+
private _prePvt;
|
9
|
+
private _preWad;
|
10
|
+
private _preVwap;
|
11
|
+
private _preValue;
|
12
|
+
private _currentData;
|
13
|
+
private _preData;
|
14
|
+
private _id;
|
15
|
+
protected timeframeFunc?: BuildInTimeframe;
|
16
|
+
constructor(id: string);
|
17
|
+
set buildInTimeframeFunc(timeframeFunc: BuildInTimeframe);
|
18
|
+
get _varTaCacheData(): IKeyObjectValue;
|
19
|
+
set _varTaCacheData(data: IKeyObjectValue);
|
20
|
+
taUpdate(currentData: IKeyObjectValue): void;
|
21
|
+
get isRealTime(): boolean;
|
22
|
+
get accdist(): any;
|
23
|
+
get iii(): any;
|
24
|
+
get nvi(): any;
|
25
|
+
get wvad(): any;
|
26
|
+
get obv(): any;
|
27
|
+
get pvi(): any;
|
28
|
+
get tr(): any;
|
29
|
+
get pvt(): any;
|
30
|
+
get wad(): any;
|
31
|
+
get vwap(): any;
|
32
|
+
private _getNvi;
|
33
|
+
private _getPvi;
|
34
|
+
}
|
@@ -107,7 +107,6 @@ export declare const WARNING_TIPS: {
|
|
107
107
|
};
|
108
108
|
export declare const QUALIFIERS: VType[];
|
109
109
|
export declare const BASE_TYPE: VType[];
|
110
|
-
export declare const PLOT_DISPLAY_TYPES: string[];
|
111
110
|
export declare const ONLY_STATEMENTS: string[];
|
112
111
|
export declare const GLOBAL_DRAW_FUNCS: string[];
|
113
112
|
export declare const GLOBAL_FUNCS: string[];
|
@@ -130,166 +129,8 @@ export declare const READY_ONLY_OPTIONS: {
|
|
130
129
|
contextmenu: boolean;
|
131
130
|
};
|
132
131
|
export declare const COMMENTS_DESC_REG: RegExp;
|
133
|
-
export declare const DEFAULT_EXPORT_TEST: {
|
134
|
-
functions: ({
|
135
|
-
name: string;
|
136
|
-
desc: string[];
|
137
|
-
args: ({
|
138
|
-
name: string;
|
139
|
-
desc: string;
|
140
|
-
required: boolean;
|
141
|
-
allowedTypeIDs: string[];
|
142
|
-
displayType: string;
|
143
|
-
} | {
|
144
|
-
name: string;
|
145
|
-
required: boolean;
|
146
|
-
allowedTypeIDs: string[];
|
147
|
-
displayType: string;
|
148
|
-
desc?: undefined;
|
149
|
-
})[];
|
150
|
-
syntax: string[];
|
151
|
-
hasMemberIndex: boolean;
|
152
|
-
pos: {
|
153
|
-
lineNumber: number;
|
154
|
-
column: number;
|
155
|
-
};
|
156
|
-
isUser: boolean;
|
157
|
-
returnedTypes: string[];
|
158
|
-
returns: string[];
|
159
|
-
index?: undefined;
|
160
|
-
info?: undefined;
|
161
|
-
} | {
|
162
|
-
name: string;
|
163
|
-
args: {
|
164
|
-
name: string;
|
165
|
-
required: boolean;
|
166
|
-
allowedTypeIDs: string[];
|
167
|
-
displayType: string;
|
168
|
-
}[];
|
169
|
-
syntax: string[];
|
170
|
-
hasMemberIndex: boolean;
|
171
|
-
pos: {
|
172
|
-
lineNumber: number;
|
173
|
-
column: number;
|
174
|
-
};
|
175
|
-
isUser: boolean;
|
176
|
-
returnedTypes: string[];
|
177
|
-
index: number;
|
178
|
-
desc?: undefined;
|
179
|
-
returns?: undefined;
|
180
|
-
info?: undefined;
|
181
|
-
} | {
|
182
|
-
name: string;
|
183
|
-
args: {
|
184
|
-
name: string;
|
185
|
-
required: boolean;
|
186
|
-
allowedTypeIDs: string[];
|
187
|
-
displayType: string;
|
188
|
-
}[];
|
189
|
-
returnedTypes: string[];
|
190
|
-
pos: {
|
191
|
-
lineNumber: number;
|
192
|
-
column: number;
|
193
|
-
};
|
194
|
-
syntax: string[];
|
195
|
-
desc?: undefined;
|
196
|
-
hasMemberIndex?: undefined;
|
197
|
-
isUser?: undefined;
|
198
|
-
returns?: undefined;
|
199
|
-
index?: undefined;
|
200
|
-
info?: undefined;
|
201
|
-
} | {
|
202
|
-
name: string;
|
203
|
-
args: {
|
204
|
-
name: string;
|
205
|
-
required: boolean;
|
206
|
-
allowedTypeIDs: string[];
|
207
|
-
displayType: string;
|
208
|
-
}[];
|
209
|
-
returnedTypes: string[];
|
210
|
-
pos: {
|
211
|
-
lineNumber: number;
|
212
|
-
column: number;
|
213
|
-
};
|
214
|
-
info: string;
|
215
|
-
syntax: string[];
|
216
|
-
desc?: undefined;
|
217
|
-
hasMemberIndex?: undefined;
|
218
|
-
isUser?: undefined;
|
219
|
-
returns?: undefined;
|
220
|
-
index?: undefined;
|
221
|
-
})[];
|
222
|
-
methods: ({
|
223
|
-
name: string;
|
224
|
-
args: {
|
225
|
-
name: string;
|
226
|
-
required: boolean;
|
227
|
-
allowedTypeIDs: string[];
|
228
|
-
displayType: string;
|
229
|
-
}[];
|
230
|
-
desc: string[];
|
231
|
-
originalName: string;
|
232
|
-
syntax: string[];
|
233
|
-
returnedTypes: string[];
|
234
|
-
hasMemberIndex: boolean;
|
235
|
-
pos: {
|
236
|
-
lineNumber: number;
|
237
|
-
column: number;
|
238
|
-
};
|
239
|
-
thisType: string[];
|
240
|
-
returns: string[];
|
241
|
-
index?: undefined;
|
242
|
-
} | {
|
243
|
-
name: string;
|
244
|
-
args: {
|
245
|
-
name: string;
|
246
|
-
required: boolean;
|
247
|
-
allowedTypeIDs: string[];
|
248
|
-
displayType: string;
|
249
|
-
}[];
|
250
|
-
originalName: string;
|
251
|
-
syntax: string[];
|
252
|
-
returnedTypes: string[];
|
253
|
-
hasMemberIndex: boolean;
|
254
|
-
pos: {
|
255
|
-
lineNumber: number;
|
256
|
-
column: number;
|
257
|
-
};
|
258
|
-
thisType: string[];
|
259
|
-
index: number;
|
260
|
-
desc?: undefined;
|
261
|
-
returns?: undefined;
|
262
|
-
} | {
|
263
|
-
name: string;
|
264
|
-
args: never[];
|
265
|
-
returnedTypes: string[];
|
266
|
-
thisType: string[];
|
267
|
-
pos: {
|
268
|
-
lineNumber: number;
|
269
|
-
column: number;
|
270
|
-
};
|
271
|
-
syntax: string[];
|
272
|
-
desc?: undefined;
|
273
|
-
originalName?: undefined;
|
274
|
-
hasMemberIndex?: undefined;
|
275
|
-
returns?: undefined;
|
276
|
-
index?: undefined;
|
277
|
-
})[];
|
278
|
-
types: {
|
279
|
-
fields: {
|
280
|
-
name: string;
|
281
|
-
type: string;
|
282
|
-
}[];
|
283
|
-
name: string;
|
284
|
-
pos: {
|
285
|
-
lineNumber: number;
|
286
|
-
column: number;
|
287
|
-
};
|
288
|
-
}[];
|
289
|
-
description: string;
|
290
|
-
codeStr: string;
|
291
|
-
};
|
292
132
|
export declare const JS_KEYWORDS: string[];
|
293
133
|
export declare const TCC_KEYWORDS: string[];
|
294
134
|
export declare const TCC_NAMESAPCES: string[];
|
295
135
|
export declare const CHANGE_VALUE_FUNCS: string[];
|
136
|
+
export declare const HAS_MEMBER_INDEX_FUNCS: string[];
|
@@ -0,0 +1,282 @@
|
|
1
|
+
export declare enum VType {
|
2
|
+
BOOL = "bool",
|
3
|
+
INT = "int",
|
4
|
+
FLOAT = "float",
|
5
|
+
ARRAY = "array",
|
6
|
+
BOX = "box",
|
7
|
+
COLOR = "color",
|
8
|
+
CONST = "const",
|
9
|
+
LABEL = "label",
|
10
|
+
LINE = "line",
|
11
|
+
SERIES = "series",
|
12
|
+
SIMPLE = "",
|
13
|
+
STRING = "string",
|
14
|
+
TABLE = "table",
|
15
|
+
UNDETERMINED = "undetermined type",
|
16
|
+
INPUT = "input",
|
17
|
+
NA = "na",
|
18
|
+
VOID = "void",
|
19
|
+
symbol = "symbol"
|
20
|
+
}
|
21
|
+
export declare enum VInsType {
|
22
|
+
TYPE = "type",
|
23
|
+
ARRAY = "array",
|
24
|
+
BOX = "box",
|
25
|
+
CHART_POINT = "chart.point",
|
26
|
+
LABEL = "label",
|
27
|
+
LINE = "line",
|
28
|
+
LINEFILL = "linefill",
|
29
|
+
MAP = "map",
|
30
|
+
MATRIX = "matrix",
|
31
|
+
POLYLINE = "polyline",
|
32
|
+
TABLE = "table"
|
33
|
+
}
|
34
|
+
export declare enum VRuleType {
|
35
|
+
FlowStmt = "FlowStmt",
|
36
|
+
DeclareAssign = "DeclareAssign",
|
37
|
+
VarBlockStmt = "VarBlockStmt",
|
38
|
+
VarSingle = "VarSingle",
|
39
|
+
VarMultiple = "VarMultiple",
|
40
|
+
ParenthesizedExpression = "ParenthesizedExpression",
|
41
|
+
AdditiveExpression = "AdditiveExpression",
|
42
|
+
RelationalExpression = "RelationalExpression",
|
43
|
+
EqualityExpression = "EqualityExpression",
|
44
|
+
TernaryExpression = "TernaryExpression",
|
45
|
+
UnaryExpression = "UnaryExpression",
|
46
|
+
NotExpression = "NotExpression",
|
47
|
+
MemberIndexExpression = "MemberIndexExpression",
|
48
|
+
MethodExpression = "MethodExpression",
|
49
|
+
LogicalAndExpression = "LogicalAndExpression",
|
50
|
+
LogicalOrExpression = "LogicalOrExpression",
|
51
|
+
MultiplicativeExpression = "MultiplicativeExpression",
|
52
|
+
Brackethesized = "Brackethesized",
|
53
|
+
IfStatement = "IfStatement",
|
54
|
+
ForToStatement = "ForToStatement",
|
55
|
+
ForInStatement = "ForInStatement",
|
56
|
+
SwitchStatement = "SwitchStatement",
|
57
|
+
CaseClause = "CaseClause",
|
58
|
+
DefaultCaluse = "DefaultCaluse",
|
59
|
+
WhileStatement = "WhileStatement",
|
60
|
+
ImportElement = "ImportElement",
|
61
|
+
Literal = "Literal",
|
62
|
+
ArrowFunction = "ArrowFunction",
|
63
|
+
ArrowMethod = "ArrowMethod",
|
64
|
+
TypeStatement = "TypeStatement",
|
65
|
+
Name = "Name",
|
66
|
+
AgainAssign = "AgainAssign",
|
67
|
+
EnumStatement = "EnumStatement"
|
68
|
+
}
|
69
|
+
export declare enum VAdjustment {
|
70
|
+
dividends = "dividends",
|
71
|
+
none = "none",
|
72
|
+
splits = "splits"
|
73
|
+
}
|
74
|
+
export declare enum VDividends {
|
75
|
+
gross = "gross",
|
76
|
+
net = "net"
|
77
|
+
}
|
78
|
+
export declare enum VAlert {
|
79
|
+
freqAll = "freq_all",
|
80
|
+
freqOncePerBar = "freq_once_per_bar",
|
81
|
+
freqOncePerBarClose = "freq_once_per_bar_close"
|
82
|
+
}
|
83
|
+
export declare enum VPlotDisplay {
|
84
|
+
all = "all",
|
85
|
+
dataWindow = "data_window",
|
86
|
+
none = "none",
|
87
|
+
pane = "pane",
|
88
|
+
priceScale = "price_scale",
|
89
|
+
statusLine = "status_line"
|
90
|
+
}
|
91
|
+
export declare enum VExtend {
|
92
|
+
both = "both",
|
93
|
+
left = "left",
|
94
|
+
none = "none",
|
95
|
+
right = "right"
|
96
|
+
}
|
97
|
+
export declare enum VFormatType {
|
98
|
+
inherit = "inherit",
|
99
|
+
mintick = "mintick",
|
100
|
+
percent = "percent",
|
101
|
+
price = "price",
|
102
|
+
volume = "volume"
|
103
|
+
}
|
104
|
+
export declare enum VHlineStyle {
|
105
|
+
styleDashed = "style_dashed",
|
106
|
+
styleDotted = "style_dotted",
|
107
|
+
styleSolid = "style_solid"
|
108
|
+
}
|
109
|
+
export declare enum VLabelStyle {
|
110
|
+
styleArrowdown = "style_arrowdown",
|
111
|
+
styleArrowup = "style_arrowup",
|
112
|
+
styleCircle = "style_circle",
|
113
|
+
styleCross = "style_cross",
|
114
|
+
styleDiamond = "style_diamond",
|
115
|
+
styleFlag = "style_flag",
|
116
|
+
styleLabelCenter = "style_label_center",
|
117
|
+
styleLabelDown = "style_label_down",
|
118
|
+
styleLabelLeft = "style_label_left",
|
119
|
+
styleLabelLowerLeft = "style_label_lower_left",
|
120
|
+
styleLabelLowerRight = "style_label_lower_right",
|
121
|
+
styleLabelRight = "style_label_right",
|
122
|
+
styleLabelUp = "style_label_up",
|
123
|
+
styleLabelUpperLeft = "style_label_upper_left",
|
124
|
+
styleLabelUpperRight = "style_label_upper_right",
|
125
|
+
styleNone = "style_none",
|
126
|
+
styleSquare = "style_square",
|
127
|
+
styleTextOutline = "style_text_outline",
|
128
|
+
styleTriangledown = "style_triangledown",
|
129
|
+
styleTriangleup = "style_triangleup",
|
130
|
+
styleXcross = "style_xcross"
|
131
|
+
}
|
132
|
+
export declare enum VLineStyle {
|
133
|
+
styleArrowBoth = "style_arrow_both",
|
134
|
+
styleArrowLeft = "style_arrow_left",
|
135
|
+
styleArrowRight = "style_arrow_right",
|
136
|
+
styleDashed = "style_dashed",
|
137
|
+
styleDotted = "style_dotted",
|
138
|
+
styleSolid = "style_solid"
|
139
|
+
}
|
140
|
+
export declare enum VLocation {
|
141
|
+
abovebar = "abovebar",
|
142
|
+
absolute = "absolute",
|
143
|
+
belowbar = "belowbar",
|
144
|
+
bottom = "bottom",
|
145
|
+
top = "top"
|
146
|
+
}
|
147
|
+
export declare enum VSortOrder {
|
148
|
+
ascending = "ascending",// 从小到大
|
149
|
+
descending = "descending"
|
150
|
+
}
|
151
|
+
export declare enum VPlotStyle {
|
152
|
+
styleArea = "Area",
|
153
|
+
styleAreabr = "Area With Breaks",
|
154
|
+
styleCircles = "Circles",
|
155
|
+
styleColumns = "Columns",
|
156
|
+
styleCross = "Cross",
|
157
|
+
styleHistogram = "Histogram",
|
158
|
+
styleLine = "Line",
|
159
|
+
styleLinebr = "Line With Breaks",
|
160
|
+
styleStepline = "Step Line",
|
161
|
+
styleSteplineDiamond = "Step Line With Diamonds",
|
162
|
+
styleSteplinebr = "Step line with Breaks"
|
163
|
+
}
|
164
|
+
export declare enum VPosition {
|
165
|
+
bottomCenter = "bottom_center",
|
166
|
+
bottomLeft = "bottom_left",
|
167
|
+
bottomRight = "bottom_right",
|
168
|
+
middleCenter = "middle_center",
|
169
|
+
middleLeft = "middle_left",
|
170
|
+
middleRight = "middle_right",
|
171
|
+
topCenter = "top_center",
|
172
|
+
topLeft = "top_left",
|
173
|
+
topRight = "top_right"
|
174
|
+
}
|
175
|
+
export declare enum VScale {
|
176
|
+
left = "left",
|
177
|
+
none = "none",
|
178
|
+
right = "right"
|
179
|
+
}
|
180
|
+
export declare enum VSession {
|
181
|
+
extended = "extended",
|
182
|
+
regular = "regular"
|
183
|
+
}
|
184
|
+
export declare enum VShape {
|
185
|
+
arrowdown = "arrowdown",
|
186
|
+
arrowup = "arrowup",
|
187
|
+
circle = "circle",
|
188
|
+
cross = "cross",
|
189
|
+
diamond = "diamond",
|
190
|
+
flag = "flag",
|
191
|
+
labeldown = "labeldown",
|
192
|
+
labelup = "labelup",
|
193
|
+
square = "square",
|
194
|
+
triangledown = "triangledown",
|
195
|
+
triangleup = "triangleup",
|
196
|
+
xcross = "xcross"
|
197
|
+
}
|
198
|
+
export declare enum VSize {
|
199
|
+
auto = "auto",
|
200
|
+
huge = "huge",
|
201
|
+
large = "large",
|
202
|
+
normal = "normal",
|
203
|
+
small = "small",
|
204
|
+
tiny = "tiny"
|
205
|
+
}
|
206
|
+
export declare enum VStrategy {
|
207
|
+
cash = "cash",
|
208
|
+
fixed = "fixed",
|
209
|
+
percentOfEquity = "percent_of_equity"
|
210
|
+
}
|
211
|
+
export declare enum VCommission {
|
212
|
+
cashPerContract = "cash_per_contract",
|
213
|
+
cashPerOrder = "cash_per_order",
|
214
|
+
percent = "percent"
|
215
|
+
}
|
216
|
+
export declare enum VDirection {
|
217
|
+
all = "all",
|
218
|
+
long = "long",
|
219
|
+
short = "short"
|
220
|
+
}
|
221
|
+
export declare enum VOca {
|
222
|
+
cancel = "cancel",
|
223
|
+
none = "none",
|
224
|
+
reduce = "reduce"
|
225
|
+
}
|
226
|
+
export declare enum VText {
|
227
|
+
alignBottom = "align_bottom",
|
228
|
+
alignCenter = "align_center",
|
229
|
+
alignLeft = "align_left",
|
230
|
+
alignRight = "align_right",
|
231
|
+
alignTop = "align_top"
|
232
|
+
}
|
233
|
+
export declare enum VXloc {
|
234
|
+
bar_index = "bar_index",
|
235
|
+
bar_time = "bar_time"
|
236
|
+
}
|
237
|
+
export declare enum VYloc {
|
238
|
+
abovebar = "abovebar",
|
239
|
+
belowbar = "belowbar",
|
240
|
+
price = "price"
|
241
|
+
}
|
242
|
+
export declare enum VEarnings {
|
243
|
+
actual = "actual",
|
244
|
+
estimate = "estimate",
|
245
|
+
standardized = "standardized"
|
246
|
+
}
|
247
|
+
export declare enum VPivotType {
|
248
|
+
traditional = "Traditional",
|
249
|
+
fibonacci = "Fibonacci",
|
250
|
+
woodie = "Woodie",
|
251
|
+
classic = "Classic",
|
252
|
+
dm = "DM",
|
253
|
+
camarilla = "Camarilla"
|
254
|
+
}
|
255
|
+
export declare enum VInputType {
|
256
|
+
INT = "int",
|
257
|
+
BOOL = "bool",
|
258
|
+
TIME = "time",
|
259
|
+
COLOR = "color",
|
260
|
+
FLOAT = "float",
|
261
|
+
PRICE = "price",
|
262
|
+
SOURCE = "source",
|
263
|
+
STRING = "string",
|
264
|
+
SYMBOL = "symbol",
|
265
|
+
SESSION = "session",
|
266
|
+
TIMEFRAME = "timeframe"
|
267
|
+
}
|
268
|
+
export declare enum VComments {
|
269
|
+
description = "description",
|
270
|
+
field = "field",
|
271
|
+
function = "function",
|
272
|
+
param = "param",
|
273
|
+
returns = "returns",
|
274
|
+
type = "type",
|
275
|
+
variable = "variable",
|
276
|
+
enum = "enum"
|
277
|
+
}
|
278
|
+
export declare enum VScriptType {
|
279
|
+
indicator = "indicator",
|
280
|
+
strategy = "strategy",
|
281
|
+
study = "study"
|
282
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
2
|
+
export default class ParseToJs {
|
3
|
+
private _nameMap;
|
4
|
+
private _argChangeMap;
|
5
|
+
private _prefixNameVar;
|
6
|
+
private _prefixNameFunc;
|
7
|
+
private _prefixNameConst;
|
8
|
+
private _isInFunc;
|
9
|
+
private _currentFuncName?;
|
10
|
+
private _varlist;
|
11
|
+
private _memberIndexList;
|
12
|
+
private _blockCount;
|
13
|
+
private _inputCount;
|
14
|
+
private _count;
|
15
|
+
private _isSwitch;
|
16
|
+
private _isInIf;
|
17
|
+
private _isInLoop;
|
18
|
+
private _codesCol;
|
19
|
+
private _dependsObj;
|
20
|
+
private _preRunMembers;
|
21
|
+
private _isInConditionalStmt;
|
22
|
+
private _preRunMembersFuncs;
|
23
|
+
private _preRunMemberFuncsCount;
|
24
|
+
private __count;
|
25
|
+
preParseCode: string;
|
26
|
+
private _isExperssion;
|
27
|
+
constructor(prefix: string);
|
28
|
+
preParser(values: IKeyObjectValue[]): string | undefined;
|
29
|
+
parser(values: IKeyObjectValue[]): {
|
30
|
+
code: string;
|
31
|
+
} | undefined;
|
32
|
+
private _parserStmt;
|
33
|
+
private _parserVarBlockStmt;
|
34
|
+
private _getDepends;
|
35
|
+
private _parserForToStatement;
|
36
|
+
private _parserAgainAssign;
|
37
|
+
private _parserIfStatement;
|
38
|
+
private _parserBlockLine;
|
39
|
+
private _parserReturnBlock;
|
40
|
+
private _getMembersCode;
|
41
|
+
private _parserArrowFunction;
|
42
|
+
private _parserParameters;
|
43
|
+
private _parserBlock;
|
44
|
+
private _addVarList;
|
45
|
+
private _parserDeclareAssign;
|
46
|
+
private _parserDeclareAssignNames;
|
47
|
+
private _parserSingleExpression;
|
48
|
+
private _parserEqualityExpression;
|
49
|
+
private _parserAdditiveExpression;
|
50
|
+
private _parserMemberIndexExpression;
|
51
|
+
private _getOtherVarMemberIndexs;
|
52
|
+
private _getUserVarMemberIndexs;
|
53
|
+
private _parseLiteral;
|
54
|
+
private _colorToRgba;
|
55
|
+
private _parserName;
|
56
|
+
private _setDepend;
|
57
|
+
private _parserMethodExpression;
|
58
|
+
private _parserMethodElement;
|
59
|
+
private _parserArguments;
|
60
|
+
private _requestParamsHandle;
|
61
|
+
private _getExpressionContext;
|
62
|
+
private _getDependsCode;
|
63
|
+
private _parserBrackethesized;
|
64
|
+
private _functionalProcess;
|
65
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Strategy, TccErrorListener } from "../buildInFuncNamespace";
|
2
|
+
import { VStrategy } from "../enum";
|
3
|
+
interface IRiskArgs {
|
4
|
+
value?: any;
|
5
|
+
count?: number;
|
6
|
+
alert_message?: string;
|
7
|
+
type?: VStrategy;
|
8
|
+
contracts?: number;
|
9
|
+
}
|
10
|
+
declare class Risk {
|
11
|
+
private _strategy;
|
12
|
+
private _errorListener;
|
13
|
+
constructor(strategy: Strategy, errorListener: TccErrorListener);
|
14
|
+
allow_entry_in({ value }: IRiskArgs, posStr: string): void;
|
15
|
+
max_cons_loss_days({ count }: IRiskArgs, posStr: string): void;
|
16
|
+
max_drawdown({ value, type }: IRiskArgs, posStr: string): void;
|
17
|
+
max_intraday_filled_orders({ count }: IRiskArgs, posStr: string): void;
|
18
|
+
max_intraday_loss({ value, type }: IRiskArgs, posStr: string): void;
|
19
|
+
max_position_size({ contracts }: IRiskArgs, posStr: string): void;
|
20
|
+
private _paramVerfiy;
|
21
|
+
}
|
22
|
+
export default Risk;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
2
|
+
import { VInsType } from "./enum";
|
3
|
+
interface IBase {
|
4
|
+
startColumn: number;
|
5
|
+
startLineNumber: number;
|
6
|
+
endColumn: number;
|
7
|
+
endLineNumber: number;
|
8
|
+
}
|
9
|
+
export declare enum VMarkerSeverity {
|
10
|
+
Hint = 1,
|
11
|
+
Info = 2,
|
12
|
+
Warning = 4,
|
13
|
+
Error = 8
|
14
|
+
}
|
15
|
+
export interface IPosition {
|
16
|
+
readonly lineNumber: number;
|
17
|
+
readonly column: number;
|
18
|
+
reName?: string;
|
19
|
+
}
|
20
|
+
export interface IRange {
|
21
|
+
readonly startLineNumber: number;
|
22
|
+
readonly startColumn: number;
|
23
|
+
readonly endLineNumber: number;
|
24
|
+
readonly endColumn: number;
|
25
|
+
}
|
26
|
+
export interface IError extends IBase {
|
27
|
+
message: string;
|
28
|
+
type?: VMarkerSeverity;
|
29
|
+
}
|
30
|
+
export type WithRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
31
|
+
export interface IDrawComponent {
|
32
|
+
type: VInsType;
|
33
|
+
id: string;
|
34
|
+
data: IKeyObjectValue;
|
35
|
+
_suffix: string;
|
36
|
+
preId: string;
|
37
|
+
isDraw: boolean;
|
38
|
+
}
|
39
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { IKeyValue } from "../../type";
|
2
|
+
import { TccErrorListener } from "./buildInFuncNamespace";
|
3
|
+
import moment from 'moment-timezone';
|
4
|
+
export declare function replaceTemplate(template: string, replacements: IKeyValue): string;
|
5
|
+
export declare function parsePerid(period: string): (string | number)[];
|
6
|
+
export declare function periodTransform(period: string): string;
|
7
|
+
export declare function generateRandomId(length?: number): string;
|
8
|
+
export declare function parseTimezoneOffset(timezone: string): number;
|
9
|
+
export declare function parserTimezone(time?: any, timezone?: string): moment.Moment;
|
10
|
+
export declare function parserTimeStamp(time?: any, timezone?: string): number;
|
11
|
+
export declare function periodConvert(period: string, time: number): number;
|
12
|
+
export declare function isNotNum(num?: number): boolean;
|
13
|
+
export declare function argColorsHandle(args: any, colors: string[]): void;
|
14
|
+
export declare function encode(str: string): string;
|
15
|
+
export declare function decode(base64: string): string;
|
16
|
+
export declare function decimalTrunc(num: number, len: number): number;
|
17
|
+
export declare function decimalCeil(num?: number, precision?: number): number | undefined;
|
18
|
+
export declare function decimalFloor(num?: number, precision?: number): number | undefined;
|
19
|
+
export declare function parsePeriodHandle(period?: string): string;
|
20
|
+
export declare function transformPeriod(period: string): string;
|
21
|
+
export declare function addRequestUseFuncError(errorListener: TccErrorListener, funcName: string, reqName: string, posStr: string): void;
|