@guihz/trading-vue-editor-tes 0.0.203 → 0.0.205
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/assets/{parserTccWorker-jsFIW02M.js → parserTccWorker-CiI6FQtq.js} +1 -1
- package/lib/assets/scriptsRunWorker-7iEXpT-k.js +69 -0
- package/lib/components/editor/parseScript/buildInFuncNamespace/strategy.d.ts +16 -0
- package/lib/components/editor/parseScript/buildInVarNamespace/strategy.d.ts +2 -1
- package/lib/trading-vue-editor.js +769 -766
- package/lib/trading-vue-editor.umd.cjs +26 -26
- package/package.json +1 -1
- package/lib/assets/scriptsRunWorker-Bn8CAGnd.js +0 -69
@@ -116,6 +116,17 @@ interface IRisk {
|
|
116
116
|
isTemporaryBan?: boolean;
|
117
117
|
preNetprofit?: number;
|
118
118
|
}
|
119
|
+
interface IData {
|
120
|
+
close: number;
|
121
|
+
high: number;
|
122
|
+
low: number;
|
123
|
+
open: number;
|
124
|
+
}
|
125
|
+
interface IFillsData {
|
126
|
+
data?: IData;
|
127
|
+
tradeData?: IData;
|
128
|
+
index: number;
|
129
|
+
}
|
119
130
|
type CloseEntriesRuleType = 'FIFO' | 'ANY';
|
120
131
|
export default class Strategy {
|
121
132
|
private _variables;
|
@@ -135,6 +146,7 @@ export default class Strategy {
|
|
135
146
|
private _updateOptions;
|
136
147
|
private _id;
|
137
148
|
private _maxDrawdownVerifyIndex;
|
149
|
+
calcOnOrderFillsData: IFillsData;
|
138
150
|
constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick: number, errorListener: TccErrorListener, id: string);
|
139
151
|
get orders(): IOrder[];
|
140
152
|
get historyOrders(): IOrder[];
|
@@ -142,8 +154,10 @@ export default class Strategy {
|
|
142
154
|
get opentrades(): Opentrades;
|
143
155
|
get closedtrades(): Closedtrdes;
|
144
156
|
get risk(): Risk;
|
157
|
+
get isCalcOnEveryTick(): boolean | undefined;
|
145
158
|
updateOptions(options?: IStrategy): void;
|
146
159
|
update(): void;
|
160
|
+
calcCurrentOrder(): void;
|
147
161
|
updateRisk(risk: IRisk): void;
|
148
162
|
endExecution(): void;
|
149
163
|
private _maxIntradayLoss;
|
@@ -165,6 +179,7 @@ export default class Strategy {
|
|
165
179
|
convert_to_symbol({ value }: IArgs): number | undefined;
|
166
180
|
default_entry_qty({ fill_price }: IArgs): number;
|
167
181
|
private _calcDefaultQty;
|
182
|
+
private _getCommQty;
|
168
183
|
private _getLen;
|
169
184
|
private _getCapital;
|
170
185
|
private _calcProfitAndLoss;
|
@@ -207,6 +222,7 @@ export default class Strategy {
|
|
207
222
|
private _calcPercent;
|
208
223
|
private _getCommission;
|
209
224
|
private _calcCurrentOrder;
|
225
|
+
private _calcOrderFillsHandle;
|
210
226
|
private _isNaN;
|
211
227
|
private _paramVerfiy;
|
212
228
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
1
2
|
import { IOrder, IStrategy } from "../buildInFuncNamespace";
|
2
3
|
import { BuiltInVariables } from "../buildInVariables";
|
3
4
|
export declare class Strategy {
|
@@ -31,7 +32,7 @@ export declare class Strategy {
|
|
31
32
|
marginCallLong: number;
|
32
33
|
marginCallShort: number;
|
33
34
|
constructor(variables: BuiltInVariables);
|
34
|
-
update(): void;
|
35
|
+
update(data: IKeyObjectValue): void;
|
35
36
|
private _calcMaxDrawdownAndMaxRunup;
|
36
37
|
updateOrders(orders: IOrder[]): void;
|
37
38
|
private _calcMaxContracts;
|