@guihz/trading-vue-editor-tes 0.1.20 → 0.1.22
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/{parserTccWorker-DzdECu81.js → parserTccWorker-DGNOKwGq.js} +44291 -25566
- package/lib/assets/{scriptsRunWorker-DO_0NAgb.js → scriptsRunWorker-DXmuwBvo.js} +24882 -15587
- package/lib/components/editor/type/index.d.ts +2 -0
- package/lib/components/editor/utils/parserTccWorker.d.ts +1 -25
- package/lib/components/editor/utils/runTools.d.ts +4 -0
- package/lib/components/editor/utils/tools.d.ts +1 -4
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/strategy.d.ts +18 -2
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/strategy.d.ts +8 -2
- package/lib/components/editor/v3/parseScript/buildInVariables.d.ts +1 -0
- package/lib/components/editor/v3/parseScript/constants.d.ts +3 -0
- package/lib/components/editor/v3/parseScript/constantsRun.d.ts +2 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/strategy.d.ts +19 -2
- package/lib/components/editor/v4/parseScript/buildInVarNamespace/strategy.d.ts +8 -4
- package/lib/components/editor/v4/parseScript/constants.d.ts +3 -0
- package/lib/components/editor/v4/parseScript/constantsRun.d.ts +2 -0
- package/lib/components/editor/v5/parseScript/buildInConstants.d.ts +2 -0
- package/lib/components/editor/v5/parseScript/buildInFuncNamespace/linefill.d.ts +3 -0
- package/lib/components/editor/v5/parseScript/buildInVarNamespace/strategy.d.ts +8 -6
- package/lib/components/editor/v5/parseScript/constants.d.ts +2 -0
- package/lib/components/editor/v5/parseScript/constantsRun.d.ts +2 -0
- package/lib/components/editor/v5/parseScript/constants_en.d.ts +134 -0
- package/lib/components/editor/v5/parseScript/parseToJs.d.ts +2 -0
- package/lib/components/editor/v6/config/monarchTokens.d.ts +205 -0
- package/lib/components/editor/v6/constants/contents_zh.d.ts +6 -0
- package/lib/components/editor/v6/constants/index.d.ts +41 -0
- package/lib/components/editor/v6/parseScript/buildInConstants.d.ts +310 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/array.d.ts +109 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/box.d.ts +83 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/chartPoint.d.ts +26 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/color.d.ts +25 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/errorListener.d.ts +9 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/index.d.ts +25 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/input.d.ts +57 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/label.d.ts +66 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/line.d.ts +74 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/linefill.d.ts +39 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/log.d.ts +39 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/map.d.ts +51 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/math.d.ts +49 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/matrix.d.ts +98 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/polyline.d.ts +32 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/runtime.d.ts +10 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/strategy.d.ts +279 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/string.d.ts +55 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/syminfo.d.ts +9 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/ta.d.ts +125 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/table.d.ts +89 -0
- package/lib/components/editor/v6/parseScript/buildInFuncNamespace/timeframe.d.ts +22 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/barstate.d.ts +22 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/chart.d.ts +21 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/dividends.d.ts +8 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/earnings.d.ts +9 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/index.d.ts +9 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/session.d.ts +12 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/strategy.d.ts +146 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/syminfo.d.ts +49 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/ta.d.ts +32 -0
- package/lib/components/editor/v6/parseScript/buildInVarNamespace/timeframe.d.ts +16 -0
- package/lib/components/editor/v6/parseScript/constants.d.ts +146 -0
- package/lib/components/editor/v6/parseScript/constantsRun.d.ts +5 -0
- package/lib/components/editor/v6/parseScript/enum.d.ts +302 -0
- package/lib/components/editor/v6/parseScript/parseToJs.d.ts +78 -0
- package/lib/components/editor/v6/parseScript/parseToLibJs.d.ts +71 -0
- package/lib/components/editor/v6/parseScript/strategyNamespace/closedtrades.d.ts +28 -0
- package/lib/components/editor/v6/parseScript/strategyNamespace/index.d.ts +4 -0
- package/lib/components/editor/v6/parseScript/strategyNamespace/opentrades.d.ts +25 -0
- package/lib/components/editor/v6/parseScript/strategyNamespace/risk.d.ts +22 -0
- package/lib/components/editor/v6/parseScript/type.d.ts +39 -0
- package/lib/components/editor/v6/parseScript/userTypeClass.d.ts +12 -0
- package/lib/components/editor/v6/parseScript/utils.d.ts +21 -0
- package/lib/components/editor/v6/parseScript/visitorParser.d.ts +384 -0
- package/lib/components/editor/v6/parseScript/visitorUtils.d.ts +31 -0
- package/lib/components/editor/v6/parserTccWorker.d.ts +40 -0
- package/lib/components/editor/v6/scriptsRunWorker.d.ts +11 -0
- package/lib/components/editor/v6/tccParser/LexerBase.d.ts +19 -0
- package/lib/components/editor/v6/tccParser/tccScriptParserVisitor.d.ts +507 -0
- package/lib/index-B2LF-839.js +61958 -0
- package/lib/{monarchTokens-D-73EVQs.js → monarchTokens-BNkQaBBZ.js} +22 -22
- package/lib/monarchTokens-Dzsc5GLx.js +563 -0
- package/lib/packages/index.d.ts +1 -1
- package/lib/trading-vue-editor.es.packages.js +1520 -1495
- package/lib/trading-vue-editor.umd.packages.mjs +110 -45
- package/package.json +2 -2
- package/lib/{index-DLIhM_y0.js → index-Clupi1hX.js} +24 -24
@@ -0,0 +1,302 @@
|
|
1
|
+
export declare enum VType {
|
2
|
+
BOOL = "bool",
|
3
|
+
INT = "int",
|
4
|
+
FLOAT = "float",
|
5
|
+
ARRAY = "array",
|
6
|
+
BOX = "box",
|
7
|
+
CHART_POINT = "chart.point",
|
8
|
+
COLOR = "color",
|
9
|
+
CONST = "const",
|
10
|
+
LABEL = "label",
|
11
|
+
LINE = "line",
|
12
|
+
LINEFILL = "linefill",
|
13
|
+
MAP = "map",
|
14
|
+
MATRIX = "matrix",
|
15
|
+
POLYLINE = "polyline",
|
16
|
+
SERIES = "series",
|
17
|
+
SIMPLE = "simple",
|
18
|
+
STRING = "string",
|
19
|
+
TABLE = "table",
|
20
|
+
UNDETERMINED = "undetermined type",
|
21
|
+
INPUT = "input",
|
22
|
+
NA = "na",
|
23
|
+
VOID = "void",
|
24
|
+
ENUM = "enum"
|
25
|
+
}
|
26
|
+
export declare enum VInsType {
|
27
|
+
TYPE = "type",
|
28
|
+
ARRAY = "array",
|
29
|
+
BOX = "box",
|
30
|
+
CHART_POINT = "chart.point",
|
31
|
+
LABEL = "label",
|
32
|
+
LINE = "line",
|
33
|
+
LINEFILL = "linefill",
|
34
|
+
MAP = "map",
|
35
|
+
MATRIX = "matrix",
|
36
|
+
POLYLINE = "polyline",
|
37
|
+
TABLE = "table"
|
38
|
+
}
|
39
|
+
export declare enum VRuleType {
|
40
|
+
FlowStmt = "FlowStmt",
|
41
|
+
DeclareAssign = "DeclareAssign",
|
42
|
+
VarBlockStmt = "VarBlockStmt",
|
43
|
+
VarSingle = "VarSingle",
|
44
|
+
VarMultiple = "VarMultiple",
|
45
|
+
ParenthesizedExpression = "ParenthesizedExpression",
|
46
|
+
AdditiveExpression = "AdditiveExpression",
|
47
|
+
RelationalExpression = "RelationalExpression",
|
48
|
+
EqualityExpression = "EqualityExpression",
|
49
|
+
TernaryExpression = "TernaryExpression",
|
50
|
+
UnaryExpression = "UnaryExpression",
|
51
|
+
NotExpression = "NotExpression",
|
52
|
+
MemberIndexExpression = "MemberIndexExpression",
|
53
|
+
MethodExpression = "MethodExpression",
|
54
|
+
LogicalAndExpression = "LogicalAndExpression",
|
55
|
+
LogicalOrExpression = "LogicalOrExpression",
|
56
|
+
MultiplicativeExpression = "MultiplicativeExpression",
|
57
|
+
Brackethesized = "Brackethesized",
|
58
|
+
IfStatement = "IfStatement",
|
59
|
+
ForToStatement = "ForToStatement",
|
60
|
+
ForInStatement = "ForInStatement",
|
61
|
+
SwitchStatement = "SwitchStatement",
|
62
|
+
CaseClause = "CaseClause",
|
63
|
+
DefaultCaluse = "DefaultCaluse",
|
64
|
+
WhileStatement = "WhileStatement",
|
65
|
+
ImportElement = "ImportElement",
|
66
|
+
Literal = "Literal",
|
67
|
+
ArrowFunction = "ArrowFunction",
|
68
|
+
ArrowMethod = "ArrowMethod",
|
69
|
+
TypeStatement = "TypeStatement",
|
70
|
+
Name = "Name",
|
71
|
+
AgainAssign = "AgainAssign",
|
72
|
+
EnumStatement = "EnumStatement"
|
73
|
+
}
|
74
|
+
export declare enum VAdjustment {
|
75
|
+
dividends = "dividends",
|
76
|
+
none = "none",
|
77
|
+
splits = "splits"
|
78
|
+
}
|
79
|
+
export declare enum VAlert {
|
80
|
+
freqAll = "freq_all",
|
81
|
+
freqOncePerBar = "freq_once_per_bar",
|
82
|
+
freqOncePerBarClose = "freq_once_per_bar_close"
|
83
|
+
}
|
84
|
+
export declare enum VBarmergeGaps {
|
85
|
+
gapsOff = "gaps_off",
|
86
|
+
gapsOn = "gaps_on",
|
87
|
+
lookaheadOff = "lookahead_off",
|
88
|
+
lookaheadOn = "lookahead_on"
|
89
|
+
}
|
90
|
+
export declare enum VPlotDisplay {
|
91
|
+
all = "all",
|
92
|
+
dataWindow = "data_window",
|
93
|
+
none = "none",
|
94
|
+
pane = "pane",
|
95
|
+
priceScale = "price_scale",
|
96
|
+
statusLine = "status_line"
|
97
|
+
}
|
98
|
+
export declare enum VExtend {
|
99
|
+
both = "both",
|
100
|
+
left = "left",
|
101
|
+
none = "none",
|
102
|
+
right = "right"
|
103
|
+
}
|
104
|
+
export declare enum VFormatType {
|
105
|
+
inherit = "inherit",
|
106
|
+
mintick = "mintick",
|
107
|
+
percent = "percent",
|
108
|
+
price = "price",
|
109
|
+
volume = "volume"
|
110
|
+
}
|
111
|
+
export declare enum VHlineStyle {
|
112
|
+
styleDashed = "style_dashed",
|
113
|
+
styleDotted = "style_dotted",
|
114
|
+
styleSolid = "style_solid"
|
115
|
+
}
|
116
|
+
export declare enum VLabelStyle {
|
117
|
+
styleArrowdown = "style_arrowdown",
|
118
|
+
styleArrowup = "style_arrowup",
|
119
|
+
styleCircle = "style_circle",
|
120
|
+
styleCross = "style_cross",
|
121
|
+
styleDiamond = "style_diamond",
|
122
|
+
styleFlag = "style_flag",
|
123
|
+
styleLabelCenter = "style_label_center",
|
124
|
+
styleLabelDown = "style_label_down",
|
125
|
+
styleLabelLeft = "style_label_left",
|
126
|
+
styleLabelLowerLeft = "style_label_lower_left",
|
127
|
+
styleLabelLowerRight = "style_label_lower_right",
|
128
|
+
styleLabelRight = "style_label_right",
|
129
|
+
styleLabelUp = "style_label_up",
|
130
|
+
styleLabelUpperLeft = "style_label_upper_left",
|
131
|
+
styleLabelUpperRight = "style_label_upper_right",
|
132
|
+
styleNone = "style_none",
|
133
|
+
styleSquare = "style_square",
|
134
|
+
styleTextOutline = "style_text_outline",
|
135
|
+
styleTriangledown = "style_triangledown",
|
136
|
+
styleTriangleup = "style_triangleup",
|
137
|
+
styleXcross = "style_xcross"
|
138
|
+
}
|
139
|
+
export declare enum VLineStyle {
|
140
|
+
styleArrowBoth = "style_arrow_both",
|
141
|
+
styleArrowLeft = "style_arrow_left",
|
142
|
+
styleArrowRight = "style_arrow_right",
|
143
|
+
styleDashed = "style_dashed",
|
144
|
+
styleDotted = "style_dotted",
|
145
|
+
styleSolid = "style_solid"
|
146
|
+
}
|
147
|
+
export declare enum VLocation {
|
148
|
+
abovebar = "abovebar",
|
149
|
+
absolute = "absolute",
|
150
|
+
belowbar = "belowbar",
|
151
|
+
bottom = "bottom",
|
152
|
+
top = "top"
|
153
|
+
}
|
154
|
+
export declare enum VSortOrder {
|
155
|
+
ascending = "ascending",// 从小到大
|
156
|
+
descending = "descending"
|
157
|
+
}
|
158
|
+
export declare enum VPlotStyle {
|
159
|
+
styleArea = "Area",
|
160
|
+
styleAreabr = "Area With Breaks",
|
161
|
+
styleCircles = "Circles",
|
162
|
+
styleColumns = "Columns",
|
163
|
+
styleCross = "Cross",
|
164
|
+
styleHistogram = "Histogram",
|
165
|
+
styleLine = "Line",
|
166
|
+
styleLinebr = "Line With Breaks",
|
167
|
+
styleStepline = "Step Line",
|
168
|
+
styleSteplineDiamond = "Step Line With Diamonds",
|
169
|
+
styleSteplinebr = "Step line with Breaks"
|
170
|
+
}
|
171
|
+
export declare enum VPosition {
|
172
|
+
bottomCenter = "bottom_center",
|
173
|
+
bottomLeft = "bottom_left",
|
174
|
+
bottomRight = "bottom_right",
|
175
|
+
middleCenter = "middle_center",
|
176
|
+
middleLeft = "middle_left",
|
177
|
+
middleRight = "middle_right",
|
178
|
+
topCenter = "top_center",
|
179
|
+
topLeft = "top_left",
|
180
|
+
topRight = "top_right"
|
181
|
+
}
|
182
|
+
export declare enum VScale {
|
183
|
+
left = "left",
|
184
|
+
none = "none",
|
185
|
+
right = "right"
|
186
|
+
}
|
187
|
+
export declare enum VSession {
|
188
|
+
extended = "extended",
|
189
|
+
regular = "regular"
|
190
|
+
}
|
191
|
+
export declare enum VShape {
|
192
|
+
arrowdown = "arrowdown",
|
193
|
+
arrowup = "arrowup",
|
194
|
+
circle = "circle",
|
195
|
+
cross = "cross",
|
196
|
+
diamond = "diamond",
|
197
|
+
flag = "flag",
|
198
|
+
labeldown = "labeldown",
|
199
|
+
labelup = "labelup",
|
200
|
+
square = "square",
|
201
|
+
triangledown = "triangledown",
|
202
|
+
triangleup = "triangleup",
|
203
|
+
xcross = "xcross"
|
204
|
+
}
|
205
|
+
export declare enum VSize {
|
206
|
+
auto = "auto",
|
207
|
+
huge = "huge",
|
208
|
+
large = "large",
|
209
|
+
normal = "normal",
|
210
|
+
small = "small",
|
211
|
+
tiny = "tiny"
|
212
|
+
}
|
213
|
+
export declare enum VFont {
|
214
|
+
familyDefault = "default",
|
215
|
+
familyMonospace = "monospace"
|
216
|
+
}
|
217
|
+
export declare enum VStrategy {
|
218
|
+
cash = "cash",
|
219
|
+
fixed = "fixed",
|
220
|
+
percentOfEquity = "percent_of_equity"
|
221
|
+
}
|
222
|
+
export declare enum VCommission {
|
223
|
+
cashPerContract = "cash_per_contract",
|
224
|
+
cashPerOrder = "cash_per_order",
|
225
|
+
percent = "percent"
|
226
|
+
}
|
227
|
+
export declare enum VDirection {
|
228
|
+
all = "all",
|
229
|
+
long = "long",
|
230
|
+
short = "short"
|
231
|
+
}
|
232
|
+
export declare enum VOca {
|
233
|
+
cancel = "cancel",
|
234
|
+
none = "none",
|
235
|
+
reduce = "reduce"
|
236
|
+
}
|
237
|
+
export declare enum VText {
|
238
|
+
alignBottom = "align_bottom",
|
239
|
+
alignCenter = "align_center",
|
240
|
+
alignLeft = "align_left",
|
241
|
+
alignRight = "align_right",
|
242
|
+
alignTop = "align_top",
|
243
|
+
wrapAuto = "wrap_auto",
|
244
|
+
wrapNone = "wrap_none"
|
245
|
+
}
|
246
|
+
export declare enum VXloc {
|
247
|
+
bar_index = "bar_index",
|
248
|
+
bar_time = "bar_time"
|
249
|
+
}
|
250
|
+
export declare enum VYloc {
|
251
|
+
abovebar = "abovebar",
|
252
|
+
belowbar = "belowbar",
|
253
|
+
price = "price"
|
254
|
+
}
|
255
|
+
export declare enum VEarnings {
|
256
|
+
actual = "actual",
|
257
|
+
estimate = "estimate",
|
258
|
+
standardized = "standardized"
|
259
|
+
}
|
260
|
+
export declare enum VPivotType {
|
261
|
+
traditional = "Traditional",
|
262
|
+
fibonacci = "Fibonacci",
|
263
|
+
woodie = "Woodie",
|
264
|
+
classic = "Classic",
|
265
|
+
dm = "DM",
|
266
|
+
camarilla = "Camarilla"
|
267
|
+
}
|
268
|
+
export declare enum VInputType {
|
269
|
+
INT = "int",
|
270
|
+
BOOL = "bool",
|
271
|
+
TIME = "time",
|
272
|
+
COLOR = "color",
|
273
|
+
FLOAT = "float",
|
274
|
+
PRICE = "price",
|
275
|
+
SOURCE = "source",
|
276
|
+
STRING = "string",
|
277
|
+
SYMBOL = "symbol",
|
278
|
+
SESSION = "session",
|
279
|
+
TEXT_AREA = "text_area",
|
280
|
+
TIMEFRAME = "timeframe",
|
281
|
+
ENUM = "enum"
|
282
|
+
}
|
283
|
+
export declare enum VComments {
|
284
|
+
description = "description",
|
285
|
+
field = "field",
|
286
|
+
function = "function",
|
287
|
+
param = "param",
|
288
|
+
returns = "returns",
|
289
|
+
type = "type",
|
290
|
+
variable = "variable",
|
291
|
+
enum = "enum"
|
292
|
+
}
|
293
|
+
export declare enum VScriptType {
|
294
|
+
library = "library",
|
295
|
+
indicator = "indicator",
|
296
|
+
strategy = "strategy"
|
297
|
+
}
|
298
|
+
export declare enum VTextFormat {
|
299
|
+
format_bold = "format_bold",
|
300
|
+
format_italic = "format_italic",
|
301
|
+
format_none = "format_none"
|
302
|
+
}
|
@@ -0,0 +1,78 @@
|
|
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 _userTypes;
|
9
|
+
private _isInFunc;
|
10
|
+
private _currentFuncName?;
|
11
|
+
private _varlist;
|
12
|
+
private _memberIndexList;
|
13
|
+
private _blockCount;
|
14
|
+
private _inputCount;
|
15
|
+
private _count;
|
16
|
+
private _isSwitch;
|
17
|
+
private _isInIf;
|
18
|
+
private _isInLoop;
|
19
|
+
private _codesCol;
|
20
|
+
private _dependsObj;
|
21
|
+
private _enums;
|
22
|
+
private _preRunMembers;
|
23
|
+
private _preRunMembersFuncs;
|
24
|
+
private __count;
|
25
|
+
preParseCode: string;
|
26
|
+
private _hasLeftVisibleBarTime;
|
27
|
+
private _hasRightVisibleBarTime;
|
28
|
+
private _isExperssion;
|
29
|
+
constructor(prefix: string);
|
30
|
+
preParser(values: IKeyObjectValue[]): string | undefined;
|
31
|
+
parser(values: IKeyObjectValue[]): {
|
32
|
+
code: string;
|
33
|
+
hasLeftVisibleBarTime: boolean;
|
34
|
+
hasRightVisibleBarTime: boolean;
|
35
|
+
} | undefined;
|
36
|
+
private _parserStmt;
|
37
|
+
private _parserEnumStatement;
|
38
|
+
private _parserTypeStatement;
|
39
|
+
private _parserVarBlockStmt;
|
40
|
+
private _getDepends;
|
41
|
+
private _parserForToStatement;
|
42
|
+
private _parserForInStatement;
|
43
|
+
private _parserAgainAssign;
|
44
|
+
private _parserSwitchStatement;
|
45
|
+
private _parserCases;
|
46
|
+
private _parserDefaultCase;
|
47
|
+
private _parserCase;
|
48
|
+
private _parserWhileStatement;
|
49
|
+
private _parserIfStatement;
|
50
|
+
private _parserBlockLine;
|
51
|
+
private _parserReturnBlock;
|
52
|
+
private _getMembersCode;
|
53
|
+
private _parserArrowMethod;
|
54
|
+
private _parserArrowFunction;
|
55
|
+
private _parserParameters;
|
56
|
+
private _parserBlock;
|
57
|
+
private _addVarList;
|
58
|
+
private _parserDeclareAssign;
|
59
|
+
private _parserDeclareAssignNames;
|
60
|
+
private _parserSingleExpression;
|
61
|
+
private _parserEqualityExpression;
|
62
|
+
private _parserAdditiveExpression;
|
63
|
+
private _parserMemberIndexExpression;
|
64
|
+
private _getOtherVarMemberIndexs;
|
65
|
+
private _getUserVarMemberIndexs;
|
66
|
+
private _parseLiteral;
|
67
|
+
private _colorToRgba;
|
68
|
+
private _parserName;
|
69
|
+
private _setDepend;
|
70
|
+
private _parserMethodExpression;
|
71
|
+
private _parserMethodElement;
|
72
|
+
private _parserArguments;
|
73
|
+
private _requestParamsHandle;
|
74
|
+
private _getExpressionContext;
|
75
|
+
private _getDependsCode;
|
76
|
+
private _parserBrackethesized;
|
77
|
+
private _functionalProcess;
|
78
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
2
|
+
export default class ParseToLibJs {
|
3
|
+
private _nameMap;
|
4
|
+
private _prefixNameVar;
|
5
|
+
private _prefixNameFunc;
|
6
|
+
private _prefixNameConst;
|
7
|
+
private _userTypes;
|
8
|
+
private _isInFunc;
|
9
|
+
private _currentFuncName?;
|
10
|
+
private _varlist;
|
11
|
+
private _memberIndexList;
|
12
|
+
private _blockCount;
|
13
|
+
private _libTitle;
|
14
|
+
private _exportEles;
|
15
|
+
private _inputCount;
|
16
|
+
private _count;
|
17
|
+
private _isSwitch;
|
18
|
+
private _isInLoop;
|
19
|
+
private _codesCol;
|
20
|
+
private _dependsObj;
|
21
|
+
private _enums;
|
22
|
+
private _preRunMembers;
|
23
|
+
private _isInConditionalStmt;
|
24
|
+
private _preRunMembersFuncs;
|
25
|
+
private _preRunMemberFuncsCount;
|
26
|
+
private __count;
|
27
|
+
constructor(prefix: string, title: string);
|
28
|
+
parser(values: IKeyObjectValue[]): string | undefined;
|
29
|
+
private _parserStmt;
|
30
|
+
private _parserEnumStatement;
|
31
|
+
private _parserTypeStatement;
|
32
|
+
private _parserVarBlockStmt;
|
33
|
+
private _getDepends;
|
34
|
+
private _parserForToStatement;
|
35
|
+
private _parserForInStatement;
|
36
|
+
private _parserAgainAssign;
|
37
|
+
private _parserSwitchStatement;
|
38
|
+
private _parserCases;
|
39
|
+
private _parserDefaultCase;
|
40
|
+
private _parserCase;
|
41
|
+
private _parserWhileStatement;
|
42
|
+
private _parserIfStatement;
|
43
|
+
private _parserBlockLine;
|
44
|
+
private _parserReturnBlock;
|
45
|
+
private _getMembersCode;
|
46
|
+
private _parserArrowMethod;
|
47
|
+
private _parserArrowFunction;
|
48
|
+
private _parserParameters;
|
49
|
+
private _parserBlock;
|
50
|
+
private _addVarList;
|
51
|
+
private _parserDeclareAssign;
|
52
|
+
private _parserDeclareAssignNames;
|
53
|
+
private _parserSingleExpression;
|
54
|
+
private _parserEqualityExpression;
|
55
|
+
private _parserAdditiveExpression;
|
56
|
+
private _parserMemberIndexExpression;
|
57
|
+
private _getOtherVarMemberIndexs;
|
58
|
+
private _getUserVarMemberIndexs;
|
59
|
+
private _parseLiteral;
|
60
|
+
private _colorToRgba;
|
61
|
+
private _parserName;
|
62
|
+
private _setDepend;
|
63
|
+
private _parserMethodExpression;
|
64
|
+
private _parserMethodElement;
|
65
|
+
private _parserArguments;
|
66
|
+
private _requestParamsHandle;
|
67
|
+
private _getExpressionContext;
|
68
|
+
private _getDependsCode;
|
69
|
+
private _parserBrackethesized;
|
70
|
+
private _functionalProcess;
|
71
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Strategy } from "../buildInFuncNamespace";
|
2
|
+
interface IArgs {
|
3
|
+
trade_num: number;
|
4
|
+
}
|
5
|
+
declare class Closedtrdes {
|
6
|
+
private _strategy;
|
7
|
+
constructor(strategy: Strategy);
|
8
|
+
commission({ trade_num }: IArgs, posStr: string): number;
|
9
|
+
entry_bar_index({ trade_num }: IArgs, posStr: string): number | undefined;
|
10
|
+
entry_comment({ trade_num }: IArgs, posStr: string): string;
|
11
|
+
entry_id({ trade_num }: IArgs, posStr: string): string;
|
12
|
+
entry_price({ trade_num }: IArgs, posStr: string): number | undefined;
|
13
|
+
entry_time({ trade_num }: IArgs, posStr: string): number | undefined;
|
14
|
+
exit_bar_index({ trade_num }: IArgs, posStr: string): number | undefined;
|
15
|
+
exit_comment({ trade_num }: IArgs, posStr: string): string | undefined;
|
16
|
+
exit_id({ trade_num }: IArgs, posStr: string): string | undefined;
|
17
|
+
exit_price({ trade_num }: IArgs, posStr: string): number | undefined;
|
18
|
+
exit_time({ trade_num }: IArgs, posStr: string): number | undefined;
|
19
|
+
max_drawdown({ trade_num }: IArgs, posStr: string): number | undefined;
|
20
|
+
max_drawdown_percent({ trade_num }: IArgs, posStr: string): number | undefined;
|
21
|
+
max_runup({ trade_num }: IArgs, posStr: string): number | undefined;
|
22
|
+
max_runup_percent({ trade_num }: IArgs, posStr: string): number | undefined;
|
23
|
+
profit({ trade_num }: IArgs, posStr: string): number | undefined;
|
24
|
+
profit_percent({ trade_num }: IArgs, posStr: string): number | undefined;
|
25
|
+
size({ trade_num }: IArgs, posStr: string): number;
|
26
|
+
private _verifyTradeNum;
|
27
|
+
}
|
28
|
+
export default Closedtrdes;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Strategy } from "../buildInFuncNamespace";
|
2
|
+
import { VDirection } from "../enum";
|
3
|
+
interface IArgs {
|
4
|
+
trade_num: number;
|
5
|
+
}
|
6
|
+
declare class Opentrades {
|
7
|
+
private _strategy;
|
8
|
+
constructor(strategy: Strategy);
|
9
|
+
commission({ trade_num }: IArgs, posStr: string): number;
|
10
|
+
entry_bar_index({ trade_num }: IArgs, posStr: string): number | undefined;
|
11
|
+
entry_comment({ trade_num }: IArgs, posStr: string): string;
|
12
|
+
entry_id({ trade_num }: IArgs, posStr: string): string;
|
13
|
+
entry_price({ trade_num }: IArgs, posStr: string): number | undefined;
|
14
|
+
entry_time({ trade_num }: IArgs, posStr: string): number | undefined;
|
15
|
+
max_drawdown({ trade_num }: IArgs, posStr: string): number | undefined;
|
16
|
+
max_drawdown_percent({ trade_num }: IArgs, posStr: string): number | undefined;
|
17
|
+
max_runup({ trade_num }: IArgs, posStr: string): number | undefined;
|
18
|
+
max_runup_percent({ trade_num }: IArgs, posStr: string): number | undefined;
|
19
|
+
profit({ trade_num }: IArgs, posStr: string): number | undefined;
|
20
|
+
profit_percent({ trade_num }: IArgs, posStr: string): number | undefined;
|
21
|
+
size({ trade_num }: IArgs, posStr: string): number;
|
22
|
+
direction({ trade_num }: IArgs, posStr: string): VDirection | undefined;
|
23
|
+
private _verifyTradeNum;
|
24
|
+
}
|
25
|
+
export default Opentrades;
|
@@ -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,12 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
2
|
+
declare class UserTypeClass {
|
3
|
+
private _defaultParams;
|
4
|
+
private _varipKeys;
|
5
|
+
private _typeName;
|
6
|
+
constructor(params: IKeyObjectValue, keys: string[], typeName: string);
|
7
|
+
copy(typeObject: IKeyObjectValue): any;
|
8
|
+
new(params?: IKeyObjectValue): IKeyObjectValue;
|
9
|
+
private _createDynamicClass;
|
10
|
+
static copy(typeObject: IKeyObjectValue): any;
|
11
|
+
}
|
12
|
+
export default UserTypeClass;
|
@@ -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;
|