@gbozee/ultimate 0.0.2-198 → 0.0.2-199

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
@@ -61584,7 +61584,14 @@ class ExchangePosition {
61584
61584
  }
61585
61585
  }
61586
61586
  async triggerTradeFromConfig(payload) {
61587
- const { place = true, stop, use_current, ignore_config, risky } = payload;
61587
+ const {
61588
+ place = true,
61589
+ stop,
61590
+ use_current,
61591
+ ignore_config,
61592
+ risky,
61593
+ stop_ratio
61594
+ } = payload;
61588
61595
  const position2 = this.instance;
61589
61596
  const config2 = await this.getConfig();
61590
61597
  let condition = ignore_config ? true : position2?.config;
@@ -61601,12 +61608,13 @@ class ExchangePosition {
61601
61608
  use_current,
61602
61609
  stop_percent: config2.stop_percent || 100,
61603
61610
  distribution: config2.distribution,
61604
- hedge: payload.hedge
61611
+ hedge: payload.hedge,
61612
+ stop_ratio
61605
61613
  });
61606
61614
  }
61607
61615
  }
61608
61616
  async placeSharedOrder(action, payload) {
61609
- const { stop_percent = 100 } = payload;
61617
+ const { stop_percent = 100, stop_ratio = 1 } = payload;
61610
61618
  const config2 = await this.getConfig();
61611
61619
  const app_config = await this.buildAppConfig({
61612
61620
  entry: payload.entry,
@@ -61693,7 +61701,7 @@ class ExchangePosition {
61693
61701
  const instance = this.instance;
61694
61702
  let result = await this.exchange.placeStopOrders({
61695
61703
  symbol: this.symbol,
61696
- quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
61704
+ quantity: (payload.use_current ? instance.quantity : trades[0].avg_size) * stop_ratio,
61697
61705
  kind: app_config.kind,
61698
61706
  stop: payload.stop,
61699
61707
  price_places: app_config.price_places,
@@ -61880,7 +61888,8 @@ class ExchangePosition {
61880
61888
  risky,
61881
61889
  limit = true,
61882
61890
  target_pnl,
61883
- hedge
61891
+ hedge,
61892
+ stop_ratio
61884
61893
  } = payload;
61885
61894
  if (cancel) {
61886
61895
  await this.cancelOrders({
@@ -61905,7 +61914,8 @@ class ExchangePosition {
61905
61914
  ignore_config,
61906
61915
  risky,
61907
61916
  place,
61908
- hedge
61917
+ hedge,
61918
+ stop_ratio
61909
61919
  });
61910
61920
  }
61911
61921
  await this.updateConfigPnl();
package/dist/index.d.ts CHANGED
@@ -1897,6 +1897,7 @@ export declare class ExchangePosition {
1897
1897
  ignore_config?: boolean;
1898
1898
  risky?: boolean;
1899
1899
  hedge?: boolean;
1900
+ stop_ratio?: number;
1900
1901
  }): Promise<any>;
1901
1902
  placeSharedOrder(action: "place_limit_orders" | "place_stop_orders" | "place_tp_orders" | "dangerous_entry_orders", payload: {
1902
1903
  entry: number;
@@ -1910,6 +1911,7 @@ export declare class ExchangePosition {
1910
1911
  stop_percent?: number;
1911
1912
  distribution?: GetEntriesParams["distribution"];
1912
1913
  hedge?: boolean;
1914
+ stop_ratio?: number;
1913
1915
  }): Promise<any>;
1914
1916
  buildAppConfig(payload: {
1915
1917
  entry: number;
@@ -1987,6 +1989,7 @@ export declare class ExchangePosition {
1987
1989
  risky?: boolean;
1988
1990
  target_pnl?: number;
1989
1991
  hedge?: boolean;
1992
+ stop_ratio?: number;
1990
1993
  }): Promise<any>;
1991
1994
  placeStopLimit(payload: {
1992
1995
  place?: boolean;
package/dist/index.js CHANGED
@@ -61521,7 +61521,14 @@ class ExchangePosition {
61521
61521
  }
61522
61522
  }
61523
61523
  async triggerTradeFromConfig(payload) {
61524
- const { place = true, stop, use_current, ignore_config, risky } = payload;
61524
+ const {
61525
+ place = true,
61526
+ stop,
61527
+ use_current,
61528
+ ignore_config,
61529
+ risky,
61530
+ stop_ratio
61531
+ } = payload;
61525
61532
  const position2 = this.instance;
61526
61533
  const config2 = await this.getConfig();
61527
61534
  let condition = ignore_config ? true : position2?.config;
@@ -61538,12 +61545,13 @@ class ExchangePosition {
61538
61545
  use_current,
61539
61546
  stop_percent: config2.stop_percent || 100,
61540
61547
  distribution: config2.distribution,
61541
- hedge: payload.hedge
61548
+ hedge: payload.hedge,
61549
+ stop_ratio
61542
61550
  });
61543
61551
  }
61544
61552
  }
61545
61553
  async placeSharedOrder(action, payload) {
61546
- const { stop_percent = 100 } = payload;
61554
+ const { stop_percent = 100, stop_ratio = 1 } = payload;
61547
61555
  const config2 = await this.getConfig();
61548
61556
  const app_config = await this.buildAppConfig({
61549
61557
  entry: payload.entry,
@@ -61630,7 +61638,7 @@ class ExchangePosition {
61630
61638
  const instance = this.instance;
61631
61639
  let result = await this.exchange.placeStopOrders({
61632
61640
  symbol: this.symbol,
61633
- quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
61641
+ quantity: (payload.use_current ? instance.quantity : trades[0].avg_size) * stop_ratio,
61634
61642
  kind: app_config.kind,
61635
61643
  stop: payload.stop,
61636
61644
  price_places: app_config.price_places,
@@ -61817,7 +61825,8 @@ class ExchangePosition {
61817
61825
  risky,
61818
61826
  limit = true,
61819
61827
  target_pnl,
61820
- hedge
61828
+ hedge,
61829
+ stop_ratio
61821
61830
  } = payload;
61822
61831
  if (cancel) {
61823
61832
  await this.cancelOrders({
@@ -61842,7 +61851,8 @@ class ExchangePosition {
61842
61851
  ignore_config,
61843
61852
  risky,
61844
61853
  place,
61845
- hedge
61854
+ hedge,
61855
+ stop_ratio
61846
61856
  });
61847
61857
  }
61848
61858
  await this.updateConfigPnl();
@@ -68157,7 +68157,14 @@ class ExchangePosition {
68157
68157
  }
68158
68158
  }
68159
68159
  async triggerTradeFromConfig(payload) {
68160
- const { place = true, stop, use_current, ignore_config, risky } = payload;
68160
+ const {
68161
+ place = true,
68162
+ stop,
68163
+ use_current,
68164
+ ignore_config,
68165
+ risky,
68166
+ stop_ratio
68167
+ } = payload;
68161
68168
  const position2 = this.instance;
68162
68169
  const config2 = await this.getConfig();
68163
68170
  let condition = ignore_config ? true : position2?.config;
@@ -68174,12 +68181,13 @@ class ExchangePosition {
68174
68181
  use_current,
68175
68182
  stop_percent: config2.stop_percent || 100,
68176
68183
  distribution: config2.distribution,
68177
- hedge: payload.hedge
68184
+ hedge: payload.hedge,
68185
+ stop_ratio
68178
68186
  });
68179
68187
  }
68180
68188
  }
68181
68189
  async placeSharedOrder(action, payload) {
68182
- const { stop_percent = 100 } = payload;
68190
+ const { stop_percent = 100, stop_ratio = 1 } = payload;
68183
68191
  const config2 = await this.getConfig();
68184
68192
  const app_config = await this.buildAppConfig({
68185
68193
  entry: payload.entry,
@@ -68266,7 +68274,7 @@ class ExchangePosition {
68266
68274
  const instance = this.instance;
68267
68275
  let result = await this.exchange.placeStopOrders({
68268
68276
  symbol: this.symbol,
68269
- quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
68277
+ quantity: (payload.use_current ? instance.quantity : trades[0].avg_size) * stop_ratio,
68270
68278
  kind: app_config.kind,
68271
68279
  stop: payload.stop,
68272
68280
  price_places: app_config.price_places,
@@ -68453,7 +68461,8 @@ class ExchangePosition {
68453
68461
  risky,
68454
68462
  limit = true,
68455
68463
  target_pnl,
68456
- hedge
68464
+ hedge,
68465
+ stop_ratio
68457
68466
  } = payload;
68458
68467
  if (cancel) {
68459
68468
  await this.cancelOrders({
@@ -68478,7 +68487,8 @@ class ExchangePosition {
68478
68487
  ignore_config,
68479
68488
  risky,
68480
68489
  place,
68481
- hedge
68490
+ hedge,
68491
+ stop_ratio
68482
68492
  });
68483
68493
  }
68484
68494
  await this.updateConfigPnl();
@@ -68130,7 +68130,14 @@ class ExchangePosition {
68130
68130
  }
68131
68131
  }
68132
68132
  async triggerTradeFromConfig(payload) {
68133
- const { place = true, stop, use_current, ignore_config, risky } = payload;
68133
+ const {
68134
+ place = true,
68135
+ stop,
68136
+ use_current,
68137
+ ignore_config,
68138
+ risky,
68139
+ stop_ratio
68140
+ } = payload;
68134
68141
  const position2 = this.instance;
68135
68142
  const config2 = await this.getConfig();
68136
68143
  let condition = ignore_config ? true : position2?.config;
@@ -68147,12 +68154,13 @@ class ExchangePosition {
68147
68154
  use_current,
68148
68155
  stop_percent: config2.stop_percent || 100,
68149
68156
  distribution: config2.distribution,
68150
- hedge: payload.hedge
68157
+ hedge: payload.hedge,
68158
+ stop_ratio
68151
68159
  });
68152
68160
  }
68153
68161
  }
68154
68162
  async placeSharedOrder(action, payload) {
68155
- const { stop_percent = 100 } = payload;
68163
+ const { stop_percent = 100, stop_ratio = 1 } = payload;
68156
68164
  const config2 = await this.getConfig();
68157
68165
  const app_config = await this.buildAppConfig({
68158
68166
  entry: payload.entry,
@@ -68239,7 +68247,7 @@ class ExchangePosition {
68239
68247
  const instance = this.instance;
68240
68248
  let result = await this.exchange.placeStopOrders({
68241
68249
  symbol: this.symbol,
68242
- quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
68250
+ quantity: (payload.use_current ? instance.quantity : trades[0].avg_size) * stop_ratio,
68243
68251
  kind: app_config.kind,
68244
68252
  stop: payload.stop,
68245
68253
  price_places: app_config.price_places,
@@ -68426,7 +68434,8 @@ class ExchangePosition {
68426
68434
  risky,
68427
68435
  limit = true,
68428
68436
  target_pnl,
68429
- hedge
68437
+ hedge,
68438
+ stop_ratio
68430
68439
  } = payload;
68431
68440
  if (cancel) {
68432
68441
  await this.cancelOrders({
@@ -68451,7 +68460,8 @@ class ExchangePosition {
68451
68460
  ignore_config,
68452
68461
  risky,
68453
68462
  place,
68454
- hedge
68463
+ hedge,
68464
+ stop_ratio
68455
68465
  });
68456
68466
  }
68457
68467
  await this.updateConfigPnl();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-198",
4
+ "version": "0.0.2-199",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",