@guihz/trading-vue-editor-tes 0.0.12 → 0.0.15
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.
@@ -54,6 +54,27 @@ interface IOrderArgs {
|
|
54
54
|
trail_offset?: number;
|
55
55
|
profit?: number;
|
56
56
|
}
|
57
|
+
type PlaceOrderType = 'order' | 'entry' | 'exit' | 'close' | 'close_all';
|
58
|
+
interface IOrder extends IOrderArgs {
|
59
|
+
isMarketPrice?: boolean;
|
60
|
+
in_price: number;
|
61
|
+
out_price?: number;
|
62
|
+
in_time?: number;
|
63
|
+
out_time?: number;
|
64
|
+
out_comment?: string;
|
65
|
+
total_profit?: number;
|
66
|
+
max_profit?: number;
|
67
|
+
trading_loss?: number;
|
68
|
+
place_order_type?: PlaceOrderType;
|
69
|
+
isDeal?: boolean;
|
70
|
+
hasExit?: boolean;
|
71
|
+
active_price?: number;
|
72
|
+
trail_stop_price?: number;
|
73
|
+
hasOrder?: boolean;
|
74
|
+
isMarketPriceLimit?: boolean;
|
75
|
+
isMarketPriceStop?: boolean;
|
76
|
+
isCancel?: boolean;
|
77
|
+
}
|
57
78
|
type CloseEntriesRuleType = 'FIFO' | 'ANY';
|
58
79
|
export default class Strategy {
|
59
80
|
private _variables;
|
@@ -64,29 +85,47 @@ export default class Strategy {
|
|
64
85
|
private _orders;
|
65
86
|
private _pendingOrders;
|
66
87
|
private _mintick;
|
67
|
-
private _ocaMap;
|
68
88
|
private _funcOptions;
|
69
89
|
constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick?: number);
|
70
90
|
updateOptions(options: IStrategy): void;
|
71
91
|
strategy(args: IStrategy): void;
|
72
|
-
private _calcDefaultQty;
|
73
92
|
order(args: IOrderArgs): void;
|
93
|
+
entry(args: IOrderArgs): void;
|
94
|
+
close(args: IOrder): void;
|
95
|
+
close_all(args: IOrder): void;
|
96
|
+
cancel({ id }: {
|
97
|
+
id: string;
|
98
|
+
}): void;
|
99
|
+
cancel_all(): void;
|
100
|
+
exit(args: IOrderArgs): void;
|
101
|
+
private _calcDefaultQty;
|
102
|
+
private _getCapital;
|
103
|
+
private _calcProfitAndLoss;
|
74
104
|
private _orderHandle;
|
105
|
+
private _judgeCapitalEnough;
|
75
106
|
private _ocaGroupVerify;
|
76
107
|
private _processOrders;
|
77
108
|
private _addPendingOrders;
|
78
109
|
private _orderArgsParse;
|
79
|
-
entry(args: IOrderArgs): void;
|
80
110
|
private _entryHandle;
|
81
111
|
private _entryOrder;
|
112
|
+
private _getEntryOrders;
|
82
113
|
private _addPendingEntry;
|
83
|
-
|
114
|
+
private _closeAllOrders;
|
115
|
+
private _closeOrders;
|
84
116
|
private _pendingOrderHandle;
|
85
|
-
private
|
86
|
-
private
|
117
|
+
private _entryOrderHandle;
|
118
|
+
private _orderOrderHandle;
|
87
119
|
private _closeOrderHandle;
|
88
120
|
private _exitOrderHandle;
|
89
121
|
private _exit;
|
122
|
+
private _ordersToExit;
|
123
|
+
private _stopProfit;
|
124
|
+
private _stopLoss;
|
125
|
+
private _trailStopLoss;
|
126
|
+
private _processExitOnClose;
|
127
|
+
private _processExitOrders;
|
128
|
+
private _processOrder;
|
90
129
|
private _isNaN;
|
91
130
|
}
|
92
131
|
export {};
|