@gbozee/ultimate 0.0.2-148 → 0.0.2-149

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
@@ -58512,6 +58512,13 @@ class ExchangeAccount {
58512
58512
  app_config.risk_per_trade = solution.risk_per_trade;
58513
58513
  app_config.min_size = solution.min_size;
58514
58514
  app_config.risk_reward = solution.risk_reward;
58515
+ app_config.kelly = {
58516
+ use_kelly: solution.use_kelly,
58517
+ kelly_confidence_factor: solution.kelly_confidence_factor,
58518
+ kelly_minimum_risk: solution.kelly_minimum_risk,
58519
+ kelly_prediction_model: solution.kelly_prediction_model,
58520
+ kelly_func: solution.kelly_func
58521
+ };
58515
58522
  const options = {
58516
58523
  take_profit: null,
58517
58524
  entry: app_config.entry,
@@ -58525,7 +58532,12 @@ class ExchangeAccount {
58525
58532
  gap: app_config.gap,
58526
58533
  rr: app_config.rr,
58527
58534
  price_places: app_config.price_places,
58528
- decimal_places: app_config.decimal_places
58535
+ decimal_places: app_config.decimal_places,
58536
+ use_kelly: solution.use_kelly,
58537
+ kelly_confidence_factor: solution.kelly_confidence_factor,
58538
+ kelly_minimum_risk: solution.kelly_minimum_risk,
58539
+ kelly_prediction_model: solution.kelly_prediction_model,
58540
+ kelly_func: solution.kelly_func
58529
58541
  };
58530
58542
  const trades = sortedBuildConfig(app_config, options);
58531
58543
  const entry_orders = {
@@ -58642,6 +58654,11 @@ class ExchangeAccount {
58642
58654
  }
58643
58655
  async placeSharedOrder(action, payload) {
58644
58656
  const { stop_percent = 100 } = payload;
58657
+ const kind = payload.entry > payload.stop ? "long" : "short";
58658
+ const config2 = await this.getPositionConfig({
58659
+ symbol: payload.symbol,
58660
+ kind
58661
+ });
58645
58662
  const app_config = await this.buildAppConfig({
58646
58663
  entry: payload.entry,
58647
58664
  stop: payload.stop,
@@ -58649,7 +58666,12 @@ class ExchangeAccount {
58649
58666
  risk: payload.risk,
58650
58667
  symbol: payload.symbol,
58651
58668
  profit: 0,
58652
- update_db: payload.update_db
58669
+ update_db: payload.update_db,
58670
+ use_kelly: config2.kelly?.use_kelly,
58671
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
58672
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
58673
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
58674
+ kelly_func: config2.kelly?.kelly_func
58653
58675
  });
58654
58676
  const { entry_orders, stop_orders, trades } = await this.placeConfigOrders(app_config, {
58655
58677
  risk_reward: payload.risk_reward,
@@ -58660,7 +58682,12 @@ class ExchangeAccount {
58660
58682
  neg_pnl: 0,
58661
58683
  min_size: app_config.min_size,
58662
58684
  symbol: payload.symbol,
58663
- stop_percent
58685
+ stop_percent,
58686
+ use_kelly: config2.kelly?.use_kelly,
58687
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
58688
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
58689
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
58690
+ kelly_func: config2.kelly?.kelly_func
58664
58691
  }, false);
58665
58692
  if (payload.raw) {
58666
58693
  let actual_orders_to_buy = await this.determineAmountToBuy({
package/dist/index.d.ts CHANGED
@@ -1946,6 +1946,11 @@ declare class ExchangeAccount$1 {
1946
1946
  min_size: number;
1947
1947
  symbol: string;
1948
1948
  stop_percent?: number;
1949
+ use_kelly?: boolean;
1950
+ kelly_confidence_factor?: number;
1951
+ kelly_minimum_risk?: number;
1952
+ kelly_prediction_model?: "exponential" | "normal" | "uniform";
1953
+ kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1949
1954
  }, place?: boolean, skip_stop?: boolean): Promise<{
1950
1955
  entry_orders: {
1951
1956
  orders: {
package/dist/index.js CHANGED
@@ -58460,6 +58460,13 @@ class ExchangeAccount {
58460
58460
  app_config.risk_per_trade = solution.risk_per_trade;
58461
58461
  app_config.min_size = solution.min_size;
58462
58462
  app_config.risk_reward = solution.risk_reward;
58463
+ app_config.kelly = {
58464
+ use_kelly: solution.use_kelly,
58465
+ kelly_confidence_factor: solution.kelly_confidence_factor,
58466
+ kelly_minimum_risk: solution.kelly_minimum_risk,
58467
+ kelly_prediction_model: solution.kelly_prediction_model,
58468
+ kelly_func: solution.kelly_func
58469
+ };
58463
58470
  const options = {
58464
58471
  take_profit: null,
58465
58472
  entry: app_config.entry,
@@ -58473,7 +58480,12 @@ class ExchangeAccount {
58473
58480
  gap: app_config.gap,
58474
58481
  rr: app_config.rr,
58475
58482
  price_places: app_config.price_places,
58476
- decimal_places: app_config.decimal_places
58483
+ decimal_places: app_config.decimal_places,
58484
+ use_kelly: solution.use_kelly,
58485
+ kelly_confidence_factor: solution.kelly_confidence_factor,
58486
+ kelly_minimum_risk: solution.kelly_minimum_risk,
58487
+ kelly_prediction_model: solution.kelly_prediction_model,
58488
+ kelly_func: solution.kelly_func
58477
58489
  };
58478
58490
  const trades = sortedBuildConfig(app_config, options);
58479
58491
  const entry_orders = {
@@ -58590,6 +58602,11 @@ class ExchangeAccount {
58590
58602
  }
58591
58603
  async placeSharedOrder(action, payload) {
58592
58604
  const { stop_percent = 100 } = payload;
58605
+ const kind = payload.entry > payload.stop ? "long" : "short";
58606
+ const config2 = await this.getPositionConfig({
58607
+ symbol: payload.symbol,
58608
+ kind
58609
+ });
58593
58610
  const app_config = await this.buildAppConfig({
58594
58611
  entry: payload.entry,
58595
58612
  stop: payload.stop,
@@ -58597,7 +58614,12 @@ class ExchangeAccount {
58597
58614
  risk: payload.risk,
58598
58615
  symbol: payload.symbol,
58599
58616
  profit: 0,
58600
- update_db: payload.update_db
58617
+ update_db: payload.update_db,
58618
+ use_kelly: config2.kelly?.use_kelly,
58619
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
58620
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
58621
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
58622
+ kelly_func: config2.kelly?.kelly_func
58601
58623
  });
58602
58624
  const { entry_orders, stop_orders, trades } = await this.placeConfigOrders(app_config, {
58603
58625
  risk_reward: payload.risk_reward,
@@ -58608,7 +58630,12 @@ class ExchangeAccount {
58608
58630
  neg_pnl: 0,
58609
58631
  min_size: app_config.min_size,
58610
58632
  symbol: payload.symbol,
58611
- stop_percent
58633
+ stop_percent,
58634
+ use_kelly: config2.kelly?.use_kelly,
58635
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
58636
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
58637
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
58638
+ kelly_func: config2.kelly?.kelly_func
58612
58639
  }, false);
58613
58640
  if (payload.raw) {
58614
58641
  let actual_orders_to_buy = await this.determineAmountToBuy({
@@ -65188,6 +65188,13 @@ class ExchangeAccount {
65188
65188
  app_config.risk_per_trade = solution.risk_per_trade;
65189
65189
  app_config.min_size = solution.min_size;
65190
65190
  app_config.risk_reward = solution.risk_reward;
65191
+ app_config.kelly = {
65192
+ use_kelly: solution.use_kelly,
65193
+ kelly_confidence_factor: solution.kelly_confidence_factor,
65194
+ kelly_minimum_risk: solution.kelly_minimum_risk,
65195
+ kelly_prediction_model: solution.kelly_prediction_model,
65196
+ kelly_func: solution.kelly_func
65197
+ };
65191
65198
  const options = {
65192
65199
  take_profit: null,
65193
65200
  entry: app_config.entry,
@@ -65201,7 +65208,12 @@ class ExchangeAccount {
65201
65208
  gap: app_config.gap,
65202
65209
  rr: app_config.rr,
65203
65210
  price_places: app_config.price_places,
65204
- decimal_places: app_config.decimal_places
65211
+ decimal_places: app_config.decimal_places,
65212
+ use_kelly: solution.use_kelly,
65213
+ kelly_confidence_factor: solution.kelly_confidence_factor,
65214
+ kelly_minimum_risk: solution.kelly_minimum_risk,
65215
+ kelly_prediction_model: solution.kelly_prediction_model,
65216
+ kelly_func: solution.kelly_func
65205
65217
  };
65206
65218
  const trades = sortedBuildConfig(app_config, options);
65207
65219
  const entry_orders = {
@@ -65318,6 +65330,11 @@ class ExchangeAccount {
65318
65330
  }
65319
65331
  async placeSharedOrder(action, payload) {
65320
65332
  const { stop_percent = 100 } = payload;
65333
+ const kind = payload.entry > payload.stop ? "long" : "short";
65334
+ const config2 = await this.getPositionConfig({
65335
+ symbol: payload.symbol,
65336
+ kind
65337
+ });
65321
65338
  const app_config = await this.buildAppConfig({
65322
65339
  entry: payload.entry,
65323
65340
  stop: payload.stop,
@@ -65325,7 +65342,12 @@ class ExchangeAccount {
65325
65342
  risk: payload.risk,
65326
65343
  symbol: payload.symbol,
65327
65344
  profit: 0,
65328
- update_db: payload.update_db
65345
+ update_db: payload.update_db,
65346
+ use_kelly: config2.kelly?.use_kelly,
65347
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
65348
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
65349
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
65350
+ kelly_func: config2.kelly?.kelly_func
65329
65351
  });
65330
65352
  const { entry_orders, stop_orders, trades } = await this.placeConfigOrders(app_config, {
65331
65353
  risk_reward: payload.risk_reward,
@@ -65336,7 +65358,12 @@ class ExchangeAccount {
65336
65358
  neg_pnl: 0,
65337
65359
  min_size: app_config.min_size,
65338
65360
  symbol: payload.symbol,
65339
- stop_percent
65361
+ stop_percent,
65362
+ use_kelly: config2.kelly?.use_kelly,
65363
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
65364
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
65365
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
65366
+ kelly_func: config2.kelly?.kelly_func
65340
65367
  }, false);
65341
65368
  if (payload.raw) {
65342
65369
  let actual_orders_to_buy = await this.determineAmountToBuy({
@@ -65165,6 +65165,13 @@ class ExchangeAccount {
65165
65165
  app_config.risk_per_trade = solution.risk_per_trade;
65166
65166
  app_config.min_size = solution.min_size;
65167
65167
  app_config.risk_reward = solution.risk_reward;
65168
+ app_config.kelly = {
65169
+ use_kelly: solution.use_kelly,
65170
+ kelly_confidence_factor: solution.kelly_confidence_factor,
65171
+ kelly_minimum_risk: solution.kelly_minimum_risk,
65172
+ kelly_prediction_model: solution.kelly_prediction_model,
65173
+ kelly_func: solution.kelly_func
65174
+ };
65168
65175
  const options = {
65169
65176
  take_profit: null,
65170
65177
  entry: app_config.entry,
@@ -65178,7 +65185,12 @@ class ExchangeAccount {
65178
65185
  gap: app_config.gap,
65179
65186
  rr: app_config.rr,
65180
65187
  price_places: app_config.price_places,
65181
- decimal_places: app_config.decimal_places
65188
+ decimal_places: app_config.decimal_places,
65189
+ use_kelly: solution.use_kelly,
65190
+ kelly_confidence_factor: solution.kelly_confidence_factor,
65191
+ kelly_minimum_risk: solution.kelly_minimum_risk,
65192
+ kelly_prediction_model: solution.kelly_prediction_model,
65193
+ kelly_func: solution.kelly_func
65182
65194
  };
65183
65195
  const trades = sortedBuildConfig(app_config, options);
65184
65196
  const entry_orders = {
@@ -65295,6 +65307,11 @@ class ExchangeAccount {
65295
65307
  }
65296
65308
  async placeSharedOrder(action, payload) {
65297
65309
  const { stop_percent = 100 } = payload;
65310
+ const kind = payload.entry > payload.stop ? "long" : "short";
65311
+ const config2 = await this.getPositionConfig({
65312
+ symbol: payload.symbol,
65313
+ kind
65314
+ });
65298
65315
  const app_config = await this.buildAppConfig({
65299
65316
  entry: payload.entry,
65300
65317
  stop: payload.stop,
@@ -65302,7 +65319,12 @@ class ExchangeAccount {
65302
65319
  risk: payload.risk,
65303
65320
  symbol: payload.symbol,
65304
65321
  profit: 0,
65305
- update_db: payload.update_db
65322
+ update_db: payload.update_db,
65323
+ use_kelly: config2.kelly?.use_kelly,
65324
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
65325
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
65326
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
65327
+ kelly_func: config2.kelly?.kelly_func
65306
65328
  });
65307
65329
  const { entry_orders, stop_orders, trades } = await this.placeConfigOrders(app_config, {
65308
65330
  risk_reward: payload.risk_reward,
@@ -65313,7 +65335,12 @@ class ExchangeAccount {
65313
65335
  neg_pnl: 0,
65314
65336
  min_size: app_config.min_size,
65315
65337
  symbol: payload.symbol,
65316
- stop_percent
65338
+ stop_percent,
65339
+ use_kelly: config2.kelly?.use_kelly,
65340
+ kelly_confidence_factor: config2.kelly?.kelly_confidence_factor,
65341
+ kelly_minimum_risk: config2.kelly?.kelly_minimum_risk,
65342
+ kelly_prediction_model: config2.kelly?.kelly_prediction_model,
65343
+ kelly_func: config2.kelly?.kelly_func
65317
65344
  }, false);
65318
65345
  if (payload.raw) {
65319
65346
  let actual_orders_to_buy = await this.determineAmountToBuy({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-148",
4
+ "version": "0.0.2-149",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",