@guihz/trading-vue-editor-tes 0.0.290 → 0.0.292
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/{scriptsRunWorker-Bj5i72x4.js → scriptsRunWorker-hMb6jZt-.js} +4 -4
- package/lib/components/editor/parseScript/buildInFuncNamespace/strategy.d.ts +5 -0
- package/lib/trading-vue-editor.es.packages.js +9 -1
- package/lib/trading-vue-editor.umd.packages.mjs +2 -2
- package/package.json +1 -1
@@ -36,6 +36,7 @@ export interface IStrategy {
|
|
36
36
|
fill_orders_on_standard_ohlc?: boolean;
|
37
37
|
max_polylines_count?: number;
|
38
38
|
scriptType?: string;
|
39
|
+
keep_short_long?: boolean;
|
39
40
|
}
|
40
41
|
interface IArgs {
|
41
42
|
value?: number;
|
@@ -152,6 +153,8 @@ export default class Strategy {
|
|
152
153
|
private _id;
|
153
154
|
private _maxDrawdownVerifyIndex;
|
154
155
|
calcOnOrderFillsData: IFillsData;
|
156
|
+
private _cacheArgs;
|
157
|
+
private _useSetArgs;
|
155
158
|
constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick: number, errorListener: TccErrorListener, id: string);
|
156
159
|
get _strategyCacheData(): IKeyObjectValue;
|
157
160
|
set _strategyCacheData(val: IKeyObjectValue);
|
@@ -173,6 +176,7 @@ export default class Strategy {
|
|
173
176
|
private _maxDrawdownVerify;
|
174
177
|
private _riskTouchOff;
|
175
178
|
strategy(args: IKeyObjectValue, posStr: string): void;
|
179
|
+
private _updateArgToOptions;
|
176
180
|
order(args: IOrderArgs, posStr: string): void;
|
177
181
|
entry(args: IOrderArgs, posStr: string): void;
|
178
182
|
close(args: IOrder, posStr: string): void;
|
@@ -205,6 +209,7 @@ export default class Strategy {
|
|
205
209
|
private _orderArgsParse;
|
206
210
|
private _entryHandle;
|
207
211
|
private _entryOnCloseHandle;
|
212
|
+
private _getOrders;
|
208
213
|
private _entryOrder;
|
209
214
|
private _getAvailablePositionSize;
|
210
215
|
private _getEntryOrders;
|
@@ -30654,6 +30654,14 @@ else
|
|
30654
30654
|
"const int"
|
30655
30655
|
],
|
30656
30656
|
displayType: "const int"
|
30657
|
+
},
|
30658
|
+
{
|
30659
|
+
name: "keep_short_long",
|
30660
|
+
desc: "当[true](#const_true)时,不同id的多空单不会相互平仓,可以同时存在。可选。默认值为[false](#const_false)。",
|
30661
|
+
allowedTypeIDs: [
|
30662
|
+
"const bool"
|
30663
|
+
],
|
30664
|
+
displayType: "const bool"
|
30657
30665
|
}
|
30658
30666
|
],
|
30659
30667
|
examples: [
|
@@ -69153,7 +69161,7 @@ function br(a, s, r) {
|
|
69153
69161
|
function zw() {
|
69154
69162
|
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
69155
69163
|
}
|
69156
|
-
const Sd = new Worker(new URL("" + new URL("assets/scriptsRunWorker-
|
69164
|
+
const Sd = new Worker(new URL("" + new URL("assets/scriptsRunWorker-hMb6jZt-.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
|
69157
69165
|
Sd.onerror = (a) => {
|
69158
69166
|
console.error(a);
|
69159
69167
|
};
|