@gbozee/ultimate 0.0.2-39 → 0.0.2-40
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/dist/index.d.ts +2 -0
- package/dist/index.js +26 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1026,6 +1026,7 @@ declare class ExchangeAccount$1 {
|
|
|
1026
1026
|
tp?: boolean;
|
|
1027
1027
|
stop?: boolean;
|
|
1028
1028
|
use_current?: boolean;
|
|
1029
|
+
ignore_config?: boolean;
|
|
1029
1030
|
}): Promise<any>;
|
|
1030
1031
|
verifyStopLoss(payload: {
|
|
1031
1032
|
symbol: string;
|
|
@@ -1104,6 +1105,7 @@ declare class ExchangeAccount$1 {
|
|
|
1104
1105
|
stop?: boolean;
|
|
1105
1106
|
raw?: boolean;
|
|
1106
1107
|
cancel?: boolean;
|
|
1108
|
+
ignore_config?: boolean;
|
|
1107
1109
|
}): Promise<any>;
|
|
1108
1110
|
updateConfigPnl(payload: {
|
|
1109
1111
|
symbol: string;
|
package/dist/index.js
CHANGED
|
@@ -37143,13 +37143,24 @@ class ExchangeAccount {
|
|
|
37143
37143
|
}
|
|
37144
37144
|
}
|
|
37145
37145
|
async triggerTradeFromConfig(payload) {
|
|
37146
|
-
const {
|
|
37146
|
+
const {
|
|
37147
|
+
symbol,
|
|
37148
|
+
kind,
|
|
37149
|
+
place = true,
|
|
37150
|
+
stop,
|
|
37151
|
+
use_current,
|
|
37152
|
+
ignore_config
|
|
37153
|
+
} = payload;
|
|
37147
37154
|
const position2 = await this.syncAccount({
|
|
37148
37155
|
symbol,
|
|
37149
37156
|
kind
|
|
37150
37157
|
});
|
|
37151
|
-
|
|
37152
|
-
|
|
37158
|
+
const config = await this.getPositionConfig({
|
|
37159
|
+
symbol,
|
|
37160
|
+
kind
|
|
37161
|
+
});
|
|
37162
|
+
let condition = ignore_config ? true : position2?.config;
|
|
37163
|
+
if (condition) {
|
|
37153
37164
|
let entry = payload.tp ? position2.entry || config.entry : config.entry;
|
|
37154
37165
|
const v = stop ? "place_stop_orders" : "place_limit_orders";
|
|
37155
37166
|
return await this.placeSharedOrder(v, {
|
|
@@ -37906,7 +37917,16 @@ class ExchangeAccount {
|
|
|
37906
37917
|
return 0;
|
|
37907
37918
|
}
|
|
37908
37919
|
async placeTrade(payload) {
|
|
37909
|
-
const {
|
|
37920
|
+
const {
|
|
37921
|
+
symbol,
|
|
37922
|
+
kind,
|
|
37923
|
+
place,
|
|
37924
|
+
tp,
|
|
37925
|
+
raw: _raw,
|
|
37926
|
+
cancel,
|
|
37927
|
+
stop,
|
|
37928
|
+
ignore_config
|
|
37929
|
+
} = payload;
|
|
37910
37930
|
if (cancel) {
|
|
37911
37931
|
await this.cancelOrders({
|
|
37912
37932
|
symbol,
|
|
@@ -37918,7 +37938,8 @@ class ExchangeAccount {
|
|
|
37918
37938
|
symbol,
|
|
37919
37939
|
kind,
|
|
37920
37940
|
raw: payload.raw,
|
|
37921
|
-
stop
|
|
37941
|
+
stop,
|
|
37942
|
+
ignore_config
|
|
37922
37943
|
});
|
|
37923
37944
|
}
|
|
37924
37945
|
await this.syncAccount({
|