@gbozee/ultimate 0.0.2-60 → 0.0.2-61

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.cjs CHANGED
@@ -56933,12 +56933,14 @@ class ExchangeAccount {
56933
56933
  symbol: payload.symbol,
56934
56934
  _positions: positions
56935
56935
  });
56936
+ let long_target_pnl = payload.kind == "long" ? payload.target_pnl : 0;
56937
+ let short_target_pnl = payload.kind == "short" ? payload.target_pnl : 0;
56936
56938
  if (payload.as_dict) {
56937
56939
  return {
56938
56940
  long: {
56939
56941
  minimum_pnl: config2?.long_minimum_pnl || 0.0001,
56940
56942
  max_size: 0.003,
56941
- profit: config2?.long_profit,
56943
+ profit: long_target_pnl || config2?.long_profit,
56942
56944
  increase: false,
56943
56945
  not_reduce: config2?.not_reduce,
56944
56946
  ratio: config2?.reduce_ratio_long,
@@ -56948,7 +56950,7 @@ class ExchangeAccount {
56948
56950
  short: {
56949
56951
  minimum_pnl: config2?.short_minimum_pnl || 0.0001,
56950
56952
  max_size: 0.003,
56951
- profit: config2?.short_profit,
56953
+ profit: short_target_pnl || config2?.short_profit,
56952
56954
  increase: false,
56953
56955
  not_reduce: config2?.not_reduce,
56954
56956
  ratio: config2?.reduce_ratio_short,
@@ -57010,7 +57012,7 @@ class ExchangeAccount {
57010
57012
  }, accountInfo, trigger2, this.exchange);
57011
57013
  }
57012
57014
  async placeProfitAndStop(payload) {
57013
- const { symbol, trigger: trigger2, refresh, kind } = payload;
57015
+ const { symbol, trigger: trigger2, refresh, kind, target_pnl } = payload;
57014
57016
  if (refresh) {
57015
57017
  await this.syncAccount({
57016
57018
  symbol,
@@ -57024,7 +57026,9 @@ class ExchangeAccount {
57024
57026
  trigger: {
57025
57027
  long: trigger2 || false,
57026
57028
  short: trigger2 || false
57027
- }
57029
+ },
57030
+ kind,
57031
+ target_pnl
57028
57032
  });
57029
57033
  if (!kind) {
57030
57034
  await this.updateConfigPnl({
@@ -58073,7 +58077,8 @@ class ExchangeAccount {
58073
58077
  raw: _raw,
58074
58078
  cancel,
58075
58079
  stop,
58076
- ignore_config
58080
+ ignore_config,
58081
+ target_pnl
58077
58082
  } = payload;
58078
58083
  if (cancel) {
58079
58084
  await this.cancelOrders({
@@ -58102,7 +58107,8 @@ class ExchangeAccount {
58102
58107
  if (tp) {
58103
58108
  await this.placeProfitAndStop({
58104
58109
  symbol,
58105
- trigger: true
58110
+ trigger: true,
58111
+ target_pnl
58106
58112
  });
58107
58113
  }
58108
58114
  return [];
package/dist/index.d.ts CHANGED
@@ -1221,6 +1221,7 @@ declare class ExchangeAccount$1 {
1221
1221
  symbol: string;
1222
1222
  kind?: "long" | "short";
1223
1223
  as_dict?: boolean;
1224
+ target_pnl?: number;
1224
1225
  trigger?: {
1225
1226
  long: boolean;
1226
1227
  short: boolean;
@@ -1290,6 +1291,7 @@ declare class ExchangeAccount$1 {
1290
1291
  trigger?: boolean;
1291
1292
  refresh?: boolean;
1292
1293
  kind?: "long" | "short";
1294
+ target_pnl?: number;
1293
1295
  }): Promise<any>;
1294
1296
  reEnterPositionOnEmpty(symbol: string): Promise<void>;
1295
1297
  generate_config_params(payload: {
@@ -1424,6 +1426,7 @@ declare class ExchangeAccount$1 {
1424
1426
  raw?: boolean;
1425
1427
  cancel?: boolean;
1426
1428
  ignore_config?: boolean;
1429
+ target_pnl?: number;
1427
1430
  }): Promise<any>;
1428
1431
  updateConfigPnl(payload: {
1429
1432
  symbol: string;
package/dist/index.js CHANGED
@@ -56891,12 +56891,14 @@ class ExchangeAccount {
56891
56891
  symbol: payload.symbol,
56892
56892
  _positions: positions
56893
56893
  });
56894
+ let long_target_pnl = payload.kind == "long" ? payload.target_pnl : 0;
56895
+ let short_target_pnl = payload.kind == "short" ? payload.target_pnl : 0;
56894
56896
  if (payload.as_dict) {
56895
56897
  return {
56896
56898
  long: {
56897
56899
  minimum_pnl: config2?.long_minimum_pnl || 0.0001,
56898
56900
  max_size: 0.003,
56899
- profit: config2?.long_profit,
56901
+ profit: long_target_pnl || config2?.long_profit,
56900
56902
  increase: false,
56901
56903
  not_reduce: config2?.not_reduce,
56902
56904
  ratio: config2?.reduce_ratio_long,
@@ -56906,7 +56908,7 @@ class ExchangeAccount {
56906
56908
  short: {
56907
56909
  minimum_pnl: config2?.short_minimum_pnl || 0.0001,
56908
56910
  max_size: 0.003,
56909
- profit: config2?.short_profit,
56911
+ profit: short_target_pnl || config2?.short_profit,
56910
56912
  increase: false,
56911
56913
  not_reduce: config2?.not_reduce,
56912
56914
  ratio: config2?.reduce_ratio_short,
@@ -56968,7 +56970,7 @@ class ExchangeAccount {
56968
56970
  }, accountInfo, trigger2, this.exchange);
56969
56971
  }
56970
56972
  async placeProfitAndStop(payload) {
56971
- const { symbol, trigger: trigger2, refresh, kind } = payload;
56973
+ const { symbol, trigger: trigger2, refresh, kind, target_pnl } = payload;
56972
56974
  if (refresh) {
56973
56975
  await this.syncAccount({
56974
56976
  symbol,
@@ -56982,7 +56984,9 @@ class ExchangeAccount {
56982
56984
  trigger: {
56983
56985
  long: trigger2 || false,
56984
56986
  short: trigger2 || false
56985
- }
56987
+ },
56988
+ kind,
56989
+ target_pnl
56986
56990
  });
56987
56991
  if (!kind) {
56988
56992
  await this.updateConfigPnl({
@@ -58031,7 +58035,8 @@ class ExchangeAccount {
58031
58035
  raw: _raw,
58032
58036
  cancel,
58033
58037
  stop,
58034
- ignore_config
58038
+ ignore_config,
58039
+ target_pnl
58035
58040
  } = payload;
58036
58041
  if (cancel) {
58037
58042
  await this.cancelOrders({
@@ -58060,7 +58065,8 @@ class ExchangeAccount {
58060
58065
  if (tp) {
58061
58066
  await this.placeProfitAndStop({
58062
58067
  symbol,
58063
- trigger: true
58068
+ trigger: true,
58069
+ target_pnl
58064
58070
  });
58065
58071
  }
58066
58072
  return [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-60",
4
+ "version": "0.0.2-61",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",